-
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
Dockerfile seems to allow some unformatted JSON arrays #32074
Comments
Yes, this is a known limitation, but unfortunately not something that can be fixed. The reason is that both JSON and shell syntax can be provided, and while it may be invalid JSON, it could be valid shell syntax. So, what happens is that;
In the last case, it may be an invalid shell command, but docker cannot verify that, because custom shells can be used, and verifying would mean implementing the shell in Docker itself, so handling of those errors is up to the shell that's run (and produce an error) I'll close this issue because of the above, but hope my explanation helps understanding the reason this works like this. Feel free to continue the discussion though! |
For the |
Both the example in the report say |
Thank you two for the detailed explanation. This certainly keeps things interesting for people writing Dockerfile editors and linters. :P Both were supposed to say |
Description
Many Dockerfile instructions such as
VOLUME
orRUN
take a JSON array. However, the syntax checking is not very strict.Steps to reproduce the issue:
Describe the results you received:
The build succeeds!
Describe the results you expected:
Was kind of expecting it to fail with a parser error...?
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Additional environment details (AWS, VirtualBox, physical, etc.):
Ubuntu 14.04.5 LTS
Linux 4.4.0-51-generic
The text was updated successfully, but these errors were encountered: