skip to content
Alvin Lucillo

Pod args and command

/ 1 min read

💻 Tech

ENTRYPOINT is the default command when you run a Docker container. It gets appended with what’s in CMD.

Dockerfile

ENTRYPOINT ["sleep"]
CMD ["2000"]
  • docker run someimage — executes sleep 2000 (uses default ENTRYPOINT + CMD)
  • docker run someimage 5000 — executes sleep 5000 (uses default ENTRYPOINT with overriden CMD)
  • docker run someimage 3000 --entrypoint somecommand — executs somecommand 3000 (uses overriden ENTRYPOINT and CMD)

With container used in a pod, args overrides CMD, and command the ENTRYPOINT.

containers
  - name: ubuntu
    image: ubuntu
    args: ["10"]             # overrides CMD in the docker file
    command: ["somecommand"] # overrides the ENTRYPOINT in the docker file