
Container Interview Question
One line in your Dockerfile decides if your app lives or dies. Seriously.
Your teammate builds an image, deploys it, everything's green. Then he tries to look inside the container with bash and the app is just not there.
No crash log. No stack trace. Nothing.
Here's the thing nobody tells you early enough:
CMD gets replaced the moment you pass anything after docker run
ENTRYPOINT doesn't — it always executes
The right pattern? Use both. ENTRYPOINT for the executable, CMD for default args
And always use JSON array syntax — or Kubernetes can't gracefully stop your container
This one question separates "I've used Docker" from "I've shipped Docker in production."
Have you been burned by this before? Tell us in the comments ?
#docker #devops #dockerfile #kubernetes #cmdvsentrypoint #programming #techinterview #containers #coding #dockertips #cloudcomputing #softwareengineering #backend #sre #learntocode #interviewprep #buildinpublic #techtok
Your teammate builds an image, deploys it, everything's green. Then he tries to look inside the container with bash and the app is just not there.
No crash log. No stack trace. Nothing.
Here's the thing nobody tells you early enough:
CMD gets replaced the moment you pass anything after docker run
ENTRYPOINT doesn't — it always executes
The right pattern? Use both. ENTRYPOINT for the executable, CMD for default args
And always use JSON array syntax — or Kubernetes can't gracefully stop your container
This one question separates "I've used Docker" from "I've shipped Docker in production."
Have you been burned by this before? Tell us in the comments ?
#docker #devops #dockerfile #kubernetes #cmdvsentrypoint #programming #techinterview #containers #coding #dockertips #cloudcomputing #softwareengineering #backend #sre #learntocode #interviewprep #buildinpublic #techtok
KodeKloud
...