Which Docker commands do you use every day, and what for?
Short answer
Group the commands by lifecycle: image (build, pull, push), container (run, ps, stop, rm), debugging (logs, inspect, exec, stats), cleanup (system df, prune). The interviewer wants to hear that you can diagnose a failing container.
3 points to say:
- Run a container:
docker run -d -p 8080:8080 -e ... --name order <image>; images go throughbuild,tag,push,pull. - Debug in order
ps -a→logs→inspect→exec→stats, and read the exit code (137 is SIGKILL). - Cleanup: check
system dffirst,pruneselectively;--volumesalso deletes DB data.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.