SteelReed

Search

Search posts, questions…

DevOps & CloudQuestion 10 / 35

Junior

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.

docker ps -aalive? exit code?docker logsoutput before death?docker inspectenv, mounts, OOMKilleddocker exec -it shlook insidedocker statsCPU, RAM vs limit

3 points to say:

  1. Run a container: docker run -d -p 8080:8080 -e ... --name order <image>; images go through build, tag, push, pull.
  2. Debug in order ps -a → logs → inspect → exec → stats, and read the exit code (137 is SIGKILL).
  3. Cleanup: check system df first, prune selectively; --volumes also 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.