-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Handle relative paths in VOLUME directives #46093
Labels
area/runtime
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
Comments
cpuguy83
added
status/0-triage
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
area/runtime
and removed
status/0-triage
labels
Jul 27, 2023
thaJeztah
changed the title
Handle relatative paths in VOLUME directives
Handle relative paths in VOLUME directives
Jul 27, 2023
So for docker run -it --rm --workdir=/hello -v foovolume:world alpine
docker: Error response from daemon: invalid volume specification: 'foovolume:world': invalid mount config for type "volume": invalid mount path: 'world' mount path must be absolute. docker run -it --rm --workdir=/hello -v foovolume:./world alpine
docker: Error response from daemon: invalid volume specification: 'foovolume:./world': invalid mount config for type "volume": invalid mount path: './world' mount path must be absolute. For docker build -t foo -<<'EOF'
FROM alpine
WORKDIR /hello
VOLUME ./world
VOLUME world2
EOF So the image's config has the relative path: docker image inspect --format '{{ json .Config.Volumes}}' foo
{"./world":{},"world2":{}} Which gets fixed "somewhere" when running a container from it. docker run --rm foo sh -c 'mount | grep world'
/dev/vda1 on /world2 type ext4 (rw,relatime,data=ordered)
/dev/vda1 on /world type ext4 (rw,relatime,data=ordered) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/runtime
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
Description
In runc 1.0, runc started erroring out if a mount destination was a relative path.
This was changed to be just a warning here: opencontainers/runc#3004
An issue was created to re-add the error: opencontainers/runc#3020
As part of id-mapped mounts support, this was added back here: opencontainers/runc#3717
We need to handle this case because we don't want to break old images or builds.
Reproduce
N/A
Expected behavior
N/A
docker version
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: