Containers: Docker and compose / Stage 10 of 11 · step 8 of 9
A container restarts under load
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
- ingest processes exports and does not restart: the check will drop its own 40 MiB export into
inboxand wait for the summary. Do not change the import code in/opt/ingest. - The memory limit of the ingest container is 128 MiB: that is how much the service is given on this machine.
- The process in the container runs as the ingest user and group, as it did before the move.
- ingest comes up by itself after the machine reboots.
Run
dockercommands withsudo: the student user has no direct access to Docker. The machine has no internet access; thealpineimage is already loaded.
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