Ravindra BagaleCourses & study guides मराठी

Chapter 49: Docker Containers: Lifecycle, docker run Flags, exec, logs, Restart Policies, Limits and Every Container Command

A container is the living process you get when you start an image. Today we do its whole life from birth to end with our own hands: the important docker run flags, logs, exec, restart policy and limits.

What you will learn in this chapter

  • The container lifecycle and exit codes
  • Every important docker run flag
  • exec, attach and logs
  • inspect, stats, top, port, diff, events
  • Restart policies and resource limits
  • cp, commit, update, wait
  • Logging drivers with rotation
  • Every docker container command

All Docker commands in one place

Every docker command step by step on one running example (build, run, exec, logs, volumes, networks, Compose, cleanup) with a cheat sheet: All Docker Commands Step by Step with Examples

Concepts in this chapter

  1. 49.1Container lifecycle: created, running, paused, stopped, removed
  2. 49.2docker run and its most important flags
  3. 49.3exec, attach and logs: get inside and read output
  4. 49.4inspect, stats, top, port, diff and events
  5. 49.5Restart policies
  6. 49.6Resource limits: memory, CPU, pids and IO
  7. 49.7cp, commit, rename, update, wait and export
  8. 49.8Logging drivers and log rotation
  9. 49.9Every docker container command: full reference
  10. 49.10PID 1, tini (--init) and graceful SIGTERM shutdown
  11. 49.11Container exits immediately, and reaching the host (host.docker.internal on Linux)

The chapter recap is at the end of the last concept page.

Ravi Sir's Cards: 25 revision, interview and comparison cards for this chapter · मराठी cards