Docker & Containers — Level by Level›Level 6 · Cheat sheet & self-check

Level 6 — Practical projects · wrap-up

Cheat sheet & self-check

Every command from this section on one page.

12 · Project: Python front end + back end

Helper script

./app.sh upBuild both images and start them with Compose, wait until healthy
./app.sh runSame with plain docker: network, volume, two docker run commands
./app.sh expose --openShow the URLs for other machines and open the host firewall port
./app.sh testHealth check, add a quote, list quotes through the front end
./app.sh down / ./app.sh cleanStop (keep data) / remove everything
WEB_PORT=9090 BIND_ADDR=127.0.0.1 ./app.sh upAnother port, reachable only from this machine

By hand

docker build -t quotes-backend:1.0 ./backendBuild the back end
docker network create quotes-netNetwork with DNS by container name
docker run -d --name quotes-backend --network quotes-net --network-alias backend -v quotes-data:/data quotes-backend:1.0Back end: no -p, reachable only on the network
docker run -d --name quotes-frontend --network quotes-net -p 8080:8080 quotes-frontend:1.0Front end: the only published port
docker run --rm --network quotes-net curlimages/curl -s http://quotes-frontend:8080/api/quotesTest from inside the network

13 · Project: .NET front end + back end (Linux & Windows)

Linux containers

./app.sh upBuild and start both containers with Compose, wait until healthy
./app.sh runSame with plain docker run
./app.sh expose --openURLs for other machines; open ufw/firewalld
./app.sh test / ./app.sh cleanSmoke test / remove everything

Windows containers (PowerShell)

docker info --format '{{.OSType}}'windows = Windows-containers mode
& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemonSwitch Docker Desktop between Linux and Windows containers
.\app.ps1 upBuild from Dockerfile.windows and start with compose.windows.yaml
.\app.ps1 expose -OpenAdd an inbound Windows Firewall rule (as Administrator)
docker compose -f compose.windows.yaml up -d --buildThe same without the helper
docker run --isolation=hyperv ...Run an image built for another Windows version in a lightweight VM

.NET image details

mcr.microsoft.com/dotnet/sdk:10.0Build stage: SDK (large, never shipped)
mcr.microsoft.com/dotnet/aspnet:10.0Run stage: ASP.NET Core runtime only
USER $APP_UIDThe non-root 'app' user built into .NET 8+ Linux images
ASPNETCORE_HTTP_PORTS=8080Default listening port in .NET 8+ images