Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong resolving of relative volume paths #1

Open
chrfranz opened this issue May 11, 2022 · 1 comment
Open

Wrong resolving of relative volume paths #1

chrfranz opened this issue May 11, 2022 · 1 comment

Comments

@chrfranz
Copy link

Relative paths in the docker-compose.yml are not resolved correctly. This is because the working directory inside the container defaults to /compose.

Given the following directory structure:

docker-compose.yml
|-folder
    |-myfile.txt

And the following docker-compose.yml file:

services:
  myservice:
    volumes:
       - ./folder/myfile.txt:/etc/folder/myfile.txt

Running docker-compose will result in an error:

OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/compose/folder/myfile.txt" to rootfs at "/etc/folder/myfile.txt"

According the docker-compose specification the . should be resolved to the directory where the docker-compose.yml is located and not to the /compose directory.

@DirkMeihoefer
Copy link
Member

You have to start the container in the folder where the docker-compose.yml is located.
This way the mount "-v $(pwd):/compose" is correctly resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants