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

Dockerfile VOLUME instruction leads to incorrect image metadata #4207

Open
augusto-sb opened this issue Sep 6, 2023 · 2 comments
Open

Dockerfile VOLUME instruction leads to incorrect image metadata #4207

augusto-sb opened this issue Sep 6, 2023 · 2 comments

Comments

@augusto-sb
Copy link

Hello, if the VOLUME instruction is an array of single quotes or non quoted paths paths it leads to incorrect image metadata and later i cant mount a volume in the resultant path.

To reproduce i did a Dockerfile:

FROM docker.io/alpine:3.18.3
VOLUME /path1 /path2
VOLUME [/path3,/path4]
VOLUME ["/path5","/path6"]
VOLUME ['/path7','/path8']
the 2nd and 4rd VOLUME instructions didnt work as expected

commands:

docker build -t test .
docker run --rm -ti test sh
/ # tree /[
/[
├── path3,
│ └── path4]
└── path7,
└── path8]
docker image inspect test

...
"Volumes": {
"/path1": {},
"/path2": {},
"/path5": {},
"/path6": {},
"[/path3,/path4]": {},
"[/path7,/path8]": {}
},
...

the two latest i think are errors because the volumes should start with ###'/'

Expected behavior
i think the behaviour should be an error during the build, i know the array should be a valid JSON array so should only work with double quotes.

docker version
Client: Docker Engine - Community
Version: 24.0.5

@tonistiigi
Copy link
Member

the two latest i think are errors because the volumes should start with ###'/'

Where is this defined?

Note that this isn't the same as -v in docker run.

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

3 participants