Linux Labs

Containers: Docker and compose / Stage 4 of 11

Dockerfile: your own image

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 7 · lab · 20 minmedium

A new image version

The build of version 1.1 of the application fails. Build the app:1.1 image from the project directory and replace the running version 1.0 with it.

Situation

The team's status page runs in the app container on port 8080: this is version 1.0, the app:1.0 image. A developer prepared version 1.1: its files and Dockerfile are in ~/app. He did not get to build the image — the build kept failing for him.

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

Task

  1. The app:1.1 image is built from the ~/app directory: sudo docker build ~/app succeeds and gives an image with the same layers.
  2. Container app runs from the app:1.1 image and is not restarting.
  3. curl http://localhost:8080/ gets the version 1.1 page from container app.

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
  • The app:1.1 image is built from ~/app — building that directory gives an image with the same layers — not done yet
  • Container app runs from the app:1.1 image and is not restarting — not done yet
  • http://localhost:8080/ serves the version 1.1 page from container app — 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
  • The app:1.1 image is built from ~/app — building that directory gives an image with the same layers — not done yet
  • Container app runs from the app:1.1 image and is not restarting — not done yet
  • http://localhost:8080/ serves the version 1.1 page from container app — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 3
  • The app:1.1 image is built from ~/app — building that directory gives an image with the same layers — not done yet
  • Container app runs from the app:1.1 image and is not restarting — not done yet
  • http://localhost:8080/ serves the version 1.1 page from container app — not done yet
Loading…