Update: Appears to have been fixed in beta10. Thanks!
Docker compose file located inside the host user’s $HOME with following volume configuration:
myimage: volumes: - ./local/dir:/home/myuser/somefolder - ./local/file:/home/myuser/somefile
Specified paths already exist in base image (
docker-compose up should start the container and mount our local directory and file on top of the specified paths.
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).
Also might affect Docker for Windows, as the same error message has shown up on the forums for it.
Steps to reproduce the behavior
docker-composeto 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