for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Cannot get docker-compose up to work after latest Windows Fast Ring Insiders update.

Open penavincent opened this issue 7 years ago • 44 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [x] I have uploaded Diagnostics
  • Diagnostics ID: A1DA193C-15B2-455E-AF73-051E138DD72C/20191106160055

Expected behavior

After booting up PC, docker starts by itself. WSL2 Backend is turned on, and Ubuntu is selected as the Distro of choice in the Resources section of settings.

Running the command docker-compose up in a directory with a docker-compose.yml should read the compose file and build up a container.

container should be running, and running docker container ls should show the containers.

Actual behavior

After starting WSL2 (Ubuntu 18.4 LTS), running the docker container ls command shows there are no containers running, which is good, as it shows that docker is connected correctly, rather than showing a daemon error.

However, when running docker-compose up on any directory with a docker-compose.yml file, the images are downloaded succefully, but the containers themselves cannot be created, as this error keeps showing up:

ERROR: for node-api_mongo-middleware_1 Cannot create container for service mongo-middleware: b"invalid volume specification: '/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/67ffe9d98f8e2071b230b69d060ee9b83418d7b277b8b5e645d29f3337a27ab2:rw'"

It seems like there's a mounting issue? I know the WSL2 Backend blog post from a few days ago mentioned some limitations regarding mount points. However, this wasn't an issue yesterday, as it was working fine, before updating windows.

Information

  • Windows Version: [Version 10.0.19018.1]
  • Docker Desktop Version: 2.1.5.0
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No

Steps to reproduce the behavior

  1. Start docker desktop, with WSL2 Backend active
  2. Try to run docker-compose up on any directory with a docker-compose.yml file.

penavincent avatar Nov 06 '19 16:11 penavincent

Same problem here, with a docker-compose file using nginx, php-fpm and mysql.

Update

This occurs, when the docker-compose.yml file has some volumes: specified

Update 2

Just tested the docker run -v path/on/host:path/on/container nginx and this works well. So the issue is definitely with docker-compose

ad-on-is avatar Nov 06 '19 17:11 ad-on-is

I can confirm the above!

Ran through the docker-compose tutorial on the official docs. And docker-compose works, until I specify volumes.

If volumes are specified a lot of weird behavior occurs where folders get created with trailing :

penavincent avatar Nov 06 '19 17:11 penavincent

I'm also having issues with volumes after latest Windows Update and Docker for win update. I'm testing with a postgres container. The container is created successfully, but mounted volumes are empty. This happens when running docker linux version from inside wsl. I'm specifying a volume for postgres entrypoint as:

volumes: - ./postgres/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d my relative path contains 3 init scripts, but after the container is started I check the /docker-entrypoint-initdb.d folder inside postgres container and it's empty What I'm seeing is that volume host path is shown as: /run/desktop/mnt/host/wsl/Ubuntu-18.04/mnt/c/Users/me/project/docker/postgres/docker-entrypoint-initdb.d And I see on wsl ubuntu that a new path is being created on /mnt/wsl/Ubuntu-18.04/mnt/c/../postgres/docker-entrypoint-initdb.d but it's empty, it doesn't point to the actual path. I already trying changing the wsl.conf root conf from /mnt/ to / and the same happens. I also tried specifying an absolute path instead of a relative and the same happens. Not sure if the issue is on docker-compose, wsl update or docker update. It seems that it is related with the new crossDomain feature. It was working fine before these latests updates.

agustindidiego avatar Nov 06 '19 19:11 agustindidiego

Thanks for reporting those bugs. @agustindidiego the bug you have is different from the other ones, and I think you are running a build prior to 19018, or that you created the container prior to upgrading to 19018.

For the others, there seem to be a real issue with the new mount handler and compose. I'll have a look at this tomorrow.

simonferquel avatar Nov 06 '19 22:11 simonferquel

Identified the root cause, will be fixed in next release

simonferquel avatar Nov 06 '19 23:11 simonferquel

@simonferquel Great, thanks! Do you have any sort of ETA on the next release?

The work around I ultimately came up with was to uninstall docker and Ubuntu and reinstall everything again, except with Docker version 2.1.2.

It seems 2.1.5 did a number on my wsl2 installation that simply downgrading didn't fix it, so I had to wipe my wsl install and start from scratch.

penavincent avatar Nov 07 '19 01:11 penavincent

@gtardif do we have an ETA for next Edge release?

simonferquel avatar Nov 07 '19 07:11 simonferquel

Is there any other workaround in the meantime, except setting up a fresh WSL 2 distro?

ad-on-is avatar Nov 07 '19 09:11 ad-on-is

Having the same issue here.

pyarmak avatar Nov 07 '19 10:11 pyarmak

@ad-on-is I've "deactivated" the experimental engine in Docker Desktop 2.1.5 (hoping to revert any changes made by it to the WSL2 installation), uninstalled it and installed the latest version I had at hand - which was 2.1.0. I'm just using a single Ubuntu 18 distro with WSL2 but everything seems to be working again.

dmartinhorodrigues avatar Nov 07 '19 14:11 dmartinhorodrigues

Is there a workaround for this issue other than installing an old version?

wildlyinaccurate avatar Nov 07 '19 22:11 wildlyinaccurate

Hmm wait for nov 12th is the best workaround I have, sadly.

simonferquel avatar Nov 08 '19 08:11 simonferquel

Would really love to see a workaround, even if it's a short time period.

atrauzzi avatar Nov 08 '19 10:11 atrauzzi

Funny workaround

I just wrote a golang script for fun, which parses the docker-compose.yml and generates docker run commands with volumes, links, etc..

https://gitlab.com/ad-on-is/godoco

If you need other stuff from your docker-compose which is not implemented yet... feel free to grab the source and implement it yourself, since everything is mostly covered in the code and the rest is just a matter of copy&paste ;-)

ad-on-is avatar Nov 08 '19 21:11 ad-on-is

Same problem here with docker swarm on Windows 10.0.19018.1 with the new Docker 2.1.5.0 Hope this is solved by 11/12 ! Thanks

benoitscherrer avatar Nov 08 '19 21:11 benoitscherrer

So, OK, yeah, Docker Desktop for WSL2 is beta and WSL2 itself is beta and we're all living dangerously. I get that.

But docker-compose with bind mounts is kinda core functionality. If that doesn't work, there's hardly any point. Telling us we get to twiddle our thumbs 'til the 12th is not really a great look.

mshappe avatar Nov 10 '19 21:11 mshappe

@ad-on-is : Thanks, however I encounter following issue cannot unmarshal data: yaml: unmarshal errors: line 776: cannot unmarshal !!map into []string line 889: cannot unmarshal !!map into []string line 1116: cannot unmarshal !!map into []string

abresnev avatar Nov 11 '19 01:11 abresnev

Excited for nov 12! 🎉

Would integration tests like running docker-compose up with a volume come in handy? That would allow making beta releases with a "known problems" section documented 😉

rvanlaak avatar Nov 11 '19 09:11 rvanlaak

Any update on when this bug will be fixed?

newk avatar Nov 12 '19 16:11 newk

The release we planned for today has been postponed to later this week, sorry about this.

simonferquel avatar Nov 12 '19 16:11 simonferquel