Run a resource-bounded Docker service

8 steps · about 2 h 52 min · Intermediate

  1. Choose CPU and memory boundaries (guide, Docker Docs, 26 min)

    Understand hard and soft controls before applying limits that could destabilise the service.

  2. Apply explicit resource settings (reference, Docker Docs, 28 min)

    Express CPU and memory controls deliberately and observe how a running container accepts changes.

  3. Inspect configured health state (reference, Docker Docs, 20 min)

    Filter and inspect health state so service readiness is checked rather than inferred from mere process existence.

  4. Select a controlled restart policy (guide, Docker Docs, 16 min)

    Match restart behaviour to failure recovery without creating an unexplained crash loop.

  5. Bound and select container logging (guide, Docker Docs, 22 min)

    Choose a logging driver and rotation strategy before logs consume the host disk.

  6. Observe live resource consumption (reference, Docker Docs, 18 min)

    Compare actual CPU, memory and I/O use with the limits instead of guessing from response time.

  7. Inspect health and termination evidence (reference, Docker Docs, 20 min)

    Read the configured state, health history, exit code and OOM evidence for a failed container.

  8. Rehearse and explain a failure (reference, Docker Docs, 22 min)

    Generate a controlled fault, follow daemon events and document whether limits and restart behaviour worked as intended.