Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.01 KB

DL3025.md

File metadata and controls

38 lines (26 loc) · 1.01 KB

Pattern: Missing use of JSON notation for CMD/ENTRYPOINT

Issue: -

Description

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_VARIABLEs, 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.

Further Reading