Linux Labs

Containers: Docker and compose / Stage 2 of 11

Ports, variables and restart

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 8 · lab · 20 minmedium

Container won't start

A status page in a Docker container stopped opening after an edit. Find the cause and fix it.

Situation

The status page of the inventory project runs in the Docker container web from the inventory-web:1.0 image: the developers built the image, and the page is already inside. The container serves it on port 8080, and it is created by the script /opt/web/run.sh. Since yesterday's edit the page does not open.

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

Task

Make it so that:

  1. the web container from the inventory-web:1.0 image is running and not restarting;
  2. curl http://localhost:8080/ gets the status page from the web container;
  3. after the machine reboots, web comes up by itself, as before.

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 3
  • Container web from the inventory-web:1.0 image is running and not restarting — not done yet
  • Container web serves the status page at http://localhost:8080/ — not done yet
  • Container web will come up by itself after a reboot — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 3
  • Container web from the inventory-web:1.0 image is running and not restarting — not done yet
  • Container web serves the status page at http://localhost:8080/ — not done yet
  • Container web will come up by itself after a reboot — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 3
  • Container web from the inventory-web:1.0 image is running and not restarting — not done yet
  • Container web serves the status page at http://localhost:8080/ — not done yet
  • Container web will come up by itself after a reboot — not done yet
Loading…