Docker problems on Windows

Docker is a really great piece of technology. It saves you all the trouble needed to install and configure things like databases, servers, message brokers and all other complicated stuff that you may need for developments. But sometimes, it also gives you a headache.

I was happily using docker for some time, for example for setting up Neo4j database. I was using Windows 10 Home on my home PC, with docker using virtual box for provisioning. It just worked without problems.

Then, I got myself a new laptop, brand new, shiny with Windows 10 Pro on board. Great, I will be able to run docker natively, I thought. And yes I could, I don’t need virtual box anymore, docker runs directly on top of the windows kernel. But there was a small problem…

When I tried to run the following line, a thing that worked fine on my old PC with Windows 10 Home, I got an error.

And I had no idea what this meant. It should work, it worked before… and so I started googling around.

Solution 1

One solution that I have found, on Github, was to disable some windows path conversion by setting MSYS_NO_PATHCONV environmental variable to 1, for example like this:

And voila! It works without any problems.

Solution 2

The other solution that I found was to use docker-compose instead of simple docker run. For docker compose you have to define a configuration file (docker-compose.yml) that has all these required parameters set up, like in command line, here’s an example:

As you can see, all the parameters are the same, ports, paths, image, everything. Now, to run this, all you need to do is to launch docker compose, while being in the same directory as the configuration file, like that:

And it just starts without problems!


I hope that this post may be useful for someone who encounters the same problem as me, It lost a lot of time to find the answer, so I thought that it would be a good idea to write about it and maybe help some poor soul that encounters it too 🙂




Also published on Medium.