Specified paths already exist in base image (somefolder/ and somefile).
Running docker-compose up should start the container and mount our local directory and file on top of the specified paths.
Actual behavior
Running docker-compose up with Docker for Mac (1.11.0-beta9, build: 6388) fails to start the container and displays the following message: ERROR: for myimage rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory"
Despite pointing to files under /Users/, the relative paths aren’t being treated as being in a path that is mountable and are instead being searched for on the container host VM and when they aren’t found empty directories are created and a mount is attempted.
In the case of somefile, docker is now trying to mount a directory as a file (hence the error).
Information
Also might affect Docker for Windows, as the same error message has shown up on the forums for it.
Steps to reproduce the behavior
Configure docker-compose to mount a directory or file with a relative path, though still under $HOME
Path is searched on the container host VM instead of local machine, directory is created and mounted into the running image
Ok, this looks to be caused by some confusion on my part and (possibly) a bug along the way.
I’m mounting volumes with a relative path. This is ultimately in $HOME/dev/myapp, but because of the relative path, docker is mounting the “files” by looking for that path on the OS that’s running the containers. When it doesn’t find them, it creates the path as a directory and mounts that instead (explains issues when a directory is attempting to be mounted on top of a file).
Previous compose file, working with docker-machine and docker-compose:
I just had this issue on Docker for Windows v. 1.12.0 beta21 but due to be using cygwin instead of CMD or PowerShell. Using cmd / powershell works as expected.
I am having the same issue in my PC, Please use my version details mentioned
Docker for windows Version 2.0.0.3 (31259)
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.0.2o 27 Mar 2018
can you please help me solve the issue. i observed the issue in windows but not in Mac.
have exactly the same problem with docker for windows (same version like you)
can’t mount a single file in docker compose any more, it worked with versions before.