What is the difference between CMD and ENTRYPOINT in a Dockerfile?
ENTRYPOINT defines the fixed executable that always runs (e.g., ["python"]). CMD provides default arguments that are passed to ENTRYPOINT — and can be overridden by `docker run myimage custom-arg`. Using ENTRYPOINT + CMD together creates flexible CLI-style containers.
🌊 This is a free sample — 507+ more questions on DevOps Ocean
Sign in free to practice the full question bank with daily challenges, XP, streaks, duels and a global leaderboard.