[ norboten ]
docker · lab docker-01

The Queue That Forgets Every Reboot

· about 30 minutes · runs on ubuntu-26.04-devops · unrated

An unrated lab. It runs on your machine with no account and no network, and everything about it — the faults, the checks, the hints and the reference solution — is in the repository. An attempt on it is recorded on your profile and never moves a rating: only rated labs do. Rated and unrated labs.

The briefing

The job queue for the reporting workers is Redis, in a container started by jobs-redis.service. The workers run on this machine and connect to 127.0.0.1:6379.

Every time the machine reboots — and every time someone restarts the service — the queue comes back empty and a day of report jobs is lost. There are 50 pending jobs in the list jobs:pending right now, and they must not be lost this time.

The security scan also flagged Redis as reachable from the network, with no password.

What is expected, and graded:

  1. The 50 jobs in jobs:pending are still there, in order, in the container named jobs-redis that jobs-redis.service starts at boot — now, and after a reboot.
  2. Redis cannot be reached through any address other than the loopback, and the workers still reach it on 127.0.0.1:6379.

There is no internet access: use the images that are already on the machine. You have root through sudo.

What is graded

The machine is checked, rebooted, and checked again. A check passes only if it passes both times.

CheckObjective
01_jobs_surviveMove a container's data onto a volume without losing what is already in it
02_not_reachable_from_outsidePublish a container port only on the interface that needs it

Start it

  1. 2Labs
  2. docker-01select this one
  3. udownload it
  4. sstart the machine

Reading

Where the lab's hints send you, level by level, as you ask for them (h, then l opens a journal section in the TUI).

Theory for this lab

4 questions on the same topic, in the lab's Theory tab. They never affect the lab's grade. Three of them, to answer here:

Question 1

A container was started with `docker run --rm -v /srv/data:/data IMAGE`. The image also declares `VOLUME /cache`. What remains after the container stops?

Question 2

Which `-p` option makes a container's port 6379 reachable only from the host itself?

Question 3

Redis runs with `--save ""`. Which command still writes the dataset to dump.rdb?