Linux Labs

Containers: Docker and compose / Stage 4 of 11

Dockerfile: your own image

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 7 · on a machine · 4 min

Your own storefront on nginx

You will build an image yourself — on a different base and without a ready Dockerfile.

The shop needs a storefront on nginx. The page is ready, it is in ~/shop/index.html, and there is no Dockerfile yet. The base is the nginx:alpine image: nginx in it is already configured and starts by itself, serves files from the /usr/share/nginx/html directory and listens on port 80 inside the container. From outside, the storefront has to open on port 8081.

Exercise · do it

Build the storefront image

~/shop holds the storefront page, index.html. Build the shop:1 image based on nginx:alpine with this page and run a shop container from it so that the storefront opens on port 8081.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Build the shop:1 image with the storefront page not done yet
  • Serve the storefront on port 8081 not done yet

Step goals

0 of 2
  • Build the shop:1 image with the storefront page — not done yet
  • Serve the storefront on port 8081 — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Build the shop:1 image with the storefront page — not done yet
  • Serve the storefront on port 8081 — not done yet
Loading…