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

Add lint rule forbidding single quotes in Dockerfile #32

Closed
AnalyzePlatypus opened this issue Mar 17, 2018 · 1 comment
Closed

Add lint rule forbidding single quotes in Dockerfile #32

AnalyzePlatypus opened this issue Mar 17, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@AnalyzePlatypus
Copy link

According to the Dockerfile documentation, CMD's array syntax must use double quotes:

Note: The exec form is parsed as a JSON array, which means that you must use double-quotes (“) around words not single-quotes (‘).

# Valid
CMD ["/bin/bash", "echo", "this should work"]

# Invalid
CMD ['/bin/bash', 'echo', 'mysteriously fails']

This build will fail with the unintelligible error /bin/sh: 1: /bin/echo,: not found
I just spent a few hours scratching my head, until I found this StackOverflow answer.

Can we include a lint rule that explicitly complains if the wrong form of quotes in used?

@rcjsuen
Copy link
Owner

rcjsuen commented Mar 17, 2018

Hi, @AnalyzePlatypus. Thank you for the bug report. This is being tracked by rcjsuen/dockerfile-utils#28. I will leave this open until the language service adopts the fix.

@rcjsuen rcjsuen added the enhancement New feature or request label Apr 2, 2018
@rcjsuen rcjsuen closed this as completed in 65e09ad Apr 8, 2018
@rcjsuen rcjsuen self-assigned this Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants