Skip to main content

Usage of Commands and Arguments

Kubernetes command and args in a Pod spec override the Dockerfile’s ENTRYPOINT and CMD respectively:
KubernetesDockerfile
commandENTRYPOINT
argsCMD
pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: pod-name
spec:
  containers:
    - name: container-name
      image: ubuntu:22.04
      command: ["sleep"]  # Overrides ENTRYPOINT in Dockerfile
      args: ["10"]        # Overrides CMD in Dockerfile

Build docs developers (and LLMs) love