Step 7 of 8 · lab · 20 min
A service from a container
The new version of the status page arrived as a Docker image. Run it in a container in place of the old service so that the page survives a docker restart and a machine reboot.
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
- Container
statusfrom thestatus-page:1.0image is running and not restarting. curl http://localhost:8080/gets the new page,status-page 1.0, from containerstatus.- After a reboot, port 8080 belongs to container
statusagain: Docker starts at boot, and the old service does not. - The restart policy of
statusisunless-stopped: if the on-call admin stops the container by hand, it does not come back by itself. The page still answers aftersudo systemctl restart docker— the check restarts docker itself.
Lab · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 4-
Container status from the status-page:1.0 image is running and not restarting — not done yet
-
http://localhost:8080/ serves the status-page 1.0 page from container status — not done yet
-
After a reboot, port 8080 goes to the container — docker starts at boot, status-legacy does not — not done yet
-
The restart policy of status is unless-stopped, and the page answers after a docker restart too — not done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 4-
Container status from the status-page:1.0 image is running and not restarting — not done yet
-
http://localhost:8080/ serves the status-page 1.0 page from container status — not done yet
-
After a reboot, port 8080 goes to the container — docker starts at boot, status-legacy does not — not done yet
-
The restart policy of status is unless-stopped, and the page answers after a docker restart too — not done yet
Goals are checked on the machine after every command.