Pattern: Missing use of JSON notation for CMD
/ENTRYPOINT
Issue: -
When using the plain text version of passing arguments, signals from the OS are not correctly passed to the executables, which is in the majority of the cases what you would expect.
Example of incorrect code:
FROM busybox
ENTRYPOINT s3cmd
FROM busybox
CMD my-service server
Example of correct code:
FROM busybox
ENTRYPOINT ["s3cmd"]
FROM busybox
CMD ["my-service", "server"]
Warning: Docker CMD
does not process $ENVIRONMENT_VARIABLE
s, that’s a side-effect of using sh -c
as the default entry-point. Using the JSON notation means that you have to figure out how to handle environment variables yourself.