Linux Labs

Containers: Docker and compose / Stage 1 of 11

Image, container and process

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 6 · summary · 2 min

Summary

  • An image is a program's files and a default command; a container is a run of an image with its own name and status.
  • docker ps shows running containers and docker ps -a shows all of them; a stopped one has Exited and its exit code.
  • A container runs while its main process runs; docker logs keeps everything the process printed.
  • docker exec runs commands in a running container, and on the server its processes are visible in ps.
  • docker ps was empty because httpd without -f went to the background: the main process ended with code 0, and web stopped.
Ubuntu 24.04
Loading…