The ENTRYPOINT instruction defines the executable command that runs when a container starts. In a Dockerfile, it commonly names the application and its executable arguments, while CMD supplies default runtime arguments. section 8.1
Starting a Node.js application
A minimal Dockerfile can use ENTRYPOINT ["node", "app.js"]. With CMD ["--listen-port", "8080"], the container starts the Node.js application with port 8080 as its default argument. section 8.1
ENTRYPOINT is part of the container image’s startup configuration. Docker records it as a Dockerfile layer, alongside layers created by COPY and other directives. section 2.2.2
The image values act as defaults when no options are supplied. Kubernetes can override command and argument defaults in a pod manifest. section 8.1
Listing 8.1 A sample Dockerfile using several application configuration methods
FROM node:12 COPY app.js /app.js COPY html/ /html ENV INITIAL_STATUS_MESSAGE="This is the default status message" #1 ENTRYPOINT ["node", "app.js"] #2 CMD ["--listen-port", "8080"] #3
Inspect a complete Dockerfile showing ENTRYPOINT alongside ENV and CMD. section 8.1


