Linux Labs

Containers: Docker and compose / Stage 2 of 11 · step 7 of 8

A service from a container

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

Situation

The team's status page on this machine is served by the status-legacy service on port 8080, version 0.9. The developers sent the new version as the Docker image status-page:1.0: it holds httpd from busybox and the page itself. The image is already loaded; now the page has to move into a container.

Run docker commands with sudo: the student user has no direct access to Docker. There is no internet on the machine.

Task

  1. Container status from the status-page:1.0 image is running and not restarting.
  2. curl http://localhost:8080/ gets the new page, status-page 1.0, from container status.
  3. After a reboot, port 8080 belongs to container status again: Docker starts at boot, and the old service does not.
  4. The restart policy of status is unless-stopped: if the on-call admin stops the container by hand, it does not come back by itself. The page still answers after sudo systemctl restart docker — the check restarts docker itself.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 4
  • Container status from the status-page:1.0 image is running and not restarting — not checked yet
  • http://localhost:8080/ serves the status-page 1.0 page from container status — not checked yet
  • After a reboot, port 8080 goes to the container — docker starts at boot, status-legacy does not — not checked yet
  • The restart policy of status is unless-stopped, and the page answers after a docker restart too — 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…