The ENTRYPOINT

The official Docker documentation says that the ENTRYPOINT instruction allows you to configure a container that will run as an executable. It's not very clear, at least for the first time. The ENTRYPOINT instruction is related to the CMD instruction. In fact, it can be confusing at the beginning. The reason for that is simple: CMD was developed first, then ENTRYPOINT was developed for more customization, and some functionality overlaps between those two instructions. Let's explain it a bit. The ENTRYPOINT specifies a command that will always be executed when the container starts. The CMD, on the other hand, specifies the arguments that will be fed to the ENTRYPOINT. Docker has a default ENTRYPOINT which is /bin/sh -c but does ...

Get Docker and Kubernetes for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.