Writing Docker File:

References:

https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/

https://docs.docker.com/engine/reference/builder/#env

In this section, we will cover the Docker file directives.

CMD:

This directive is used for executing the commands(startup command) in the container.

CMD echo "This is a test." | wc -

This is shell format, it will invoke the shell and execute this command.

CMD ["/usr/bin/wc","--help"]

This json array format , directly execute the command without shell.

ENTRYPOINT:

This directive is also the startup command for the container.

https://www.ctl.io/developers/blog/post/dockerfile-entrypoint-vs-cmd/

results matching ""

    No results matching ""