Linux Labs

Containers: Docker and compose / Stage 10 of 11 · step 8 of 9

A container restarts under load

medium ~25 min
Not running Starting usually ~20 s
Report a problem

Situation

The ingest service processes the nightly sales exports: a CSV file appears in /srv/ingest/inbox, and a summary of it appears in /srv/ingest/done. Until last week the service ran as the ingest system user, and the /srv/ingest directory belongs to that user. Then it was moved into a Docker container: the container is created by the /opt/ingest/run.sh script, and the import code sits next to it in /opt/ingest.

Since the move, not a single export has been processed: today's one, 40 MiB, is still sitting in inbox, and docker ps shows ingest up for a couple of seconds one moment and restarting the next.

Task

  1. ingest processes exports and does not restart: the check will drop its own 40 MiB export into inbox and wait for the summary. Do not change the import code in /opt/ingest.
  2. The memory limit of the ingest container is 128 MiB: that is how much the service is given on this machine.
  3. The process in the container runs as the ingest user and group, as it did before the move.
  4. ingest comes up by itself after the machine reboots.

Run docker commands with sudo: the student user has no direct access to Docker. The machine has no internet access; the alpine image is already loaded.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 4
  • ingest processes a 40 MiB export without restarting, and the import code is unchanged — not checked yet
  • The memory limit of the ingest container is 128 MiB — not checked yet
  • The process in the container runs as the ingest user and group — not checked yet
  • ingest comes up by itself after the machine reboots — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…