Docker Container Labs

Docker practicals for beginners — install, images and containers, Dockerfile, volumes, networks, Compose and registries.

Licence: Docker Engine on Linux is open source. Docker Desktop is free for personal use, education and small businesses (fewer than 250 employees and under $10 million annual revenue); larger companies need a paid plan. Check Docker pricing for current terms.
PromptSetu is not affiliated with or endorsed by Cisco, Microsoft, Amazon, Red Hat, CompTIA or Docker. These labs are practice prompts, not official training, and they do not guarantee an exam pass.

Versions checked on 22 November 2026.

Lab setup

What you need

  • Docker Desktop on Windows 11 (with WSL 2) or macOS, or Docker Engine on Ubuntu 24.04
  • 8 GB RAM and virtualisation enabled in BIOS/UEFI
  • A free Docker Hub account for the registry lab

How to use these prompts

  • Pick a practical below and press Copy or Run with AI
  • Fill in the [brackets] with your lab details
  • Follow the steps in your own VM or simulator
  • Paste any error back to the AI and ask for the fix
Practicals

8 step-by-step lab prompts

IT Labs & CertificationsDockerPractical

Docker: install and run your first container

I am a student. Help me install [Docker Desktop on Windows 11 with WSL 2 / Docker Engine on Ubuntu 24.04], check the install with docker version and docker run hello-world, and run an nginx container on port 8080. Tell me the system requirements I must check first. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
IT Labs & CertificationsDockerPractical

Docker: images vs containers

Explain the difference between Docker images, containers and layers with a simple example. Then guide me to pull [nginx:alpine], run two containers from the same image, list them, view logs, open a shell inside one with docker exec, stop and remove them, and remove the image. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
IT Labs & CertificationsDockerPractical

Docker: write a Dockerfile for a simple app

Help me write a Dockerfile for a simple [Python Flask/Node.js Express] app that shows a hello page. Explain every instruction (FROM, WORKDIR, COPY, RUN, EXPOSE, CMD), add a .dockerignore file, build the image with a tag, run it, and keep the image small with a slim base image. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
IT Labs & CertificationsDockerPractical

Docker: volumes and bind mounts

Help me understand data persistence in Docker. Run a [MySQL/PostgreSQL] container with a named volume, add some data, delete and recreate the container to prove the data survives, then compare this with a bind mount for live code editing. Show how to list, inspect and remove volumes. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
IT Labs & CertificationsDockerPractical

Docker: container networking

Help me create a user-defined bridge network, run two containers on it, and show that they can reach each other by container name. Explain port publishing with -p, the default bridge network, and how to inspect a network. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
IT Labs & CertificationsDockerPractical

Docker: multi-container app with Docker Compose

Help me write a compose.yaml for a two-service app: a [Flask/Node.js] web app and a [Redis/PostgreSQL] database, with a named volume, environment variables and a published port. Show docker compose up -d, ps, logs, and down, and explain how services find each other by name. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
IT Labs & CertificationsDockerPractical

Docker: tag and push an image to a registry

Help me push my image to [Docker Hub/GitHub Container Registry]: create a repository, log in with an access token instead of my password, tag the image with my username and a version, push it, and pull it on another machine. Remind me never to put passwords or keys inside an image. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
IT Labs & CertificationsDockerPractical

Docker: clean-up and troubleshooting

Give me a troubleshooting and clean-up guide for Docker: a container that exits immediately, port already in use, permission denied on the Docker socket in Linux, and disk full. Show how to use docker logs, docker inspect, docker system df and docker system prune safely, explaining what each prune command deletes. Act as my lab instructor. Give numbered steps, the exact commands or clicks for each step, how to verify that each step worked, and the 3 most common errors with their fixes. Explain each concept in one simple line before the steps. Ask me if anything is unclear.
Cheat sheet

Most-used commands

Replace example names, IDs and IP addresses with your own.

Docker CLIWhat it doesCopy
docker versionCheck the client and engine versions
docker run hello-worldTest the installation
docker pull nginx:alpineDownload an image
docker imagesList local images
docker run -d --name web -p 8080:80 nginx:alpineRun a container in the background on port 8080
docker ps -aList all containers
docker logs webShow a container's logs
docker exec -it web shOpen a shell inside a container
docker stop web && docker rm webStop and remove a container
docker build -t myapp:1.0 .Build an image from a Dockerfile
docker volume create appdataCreate a named volume
docker network create labnetCreate a user-defined bridge network
docker compose up -dStart a Compose app in the background
docker compose logs -fFollow Compose logs
docker compose downStop and remove a Compose app
docker tag myapp:1.0 yourname/myapp:1.0Tag an image for a registry
docker push yourname/myapp:1.0Push an image to Docker Hub
docker system dfShow Docker disk usage
docker system pruneRemove stopped containers, unused networks and dangling images
FAQ

Questions

Can I run these prompts in ChatGPT, Gemini or Claude?

Yes. Copy any prompt, fill in the [brackets] and paste it into your favourite AI, or press Run with AI to use it here (5 AI runs a day on the free plan).

Is the AI always right about commands?

No. AI can make mistakes. Always check commands against the official documentation, and practise only in your own lab or VM.

Do I need to pay for software?

No for most labs. The free options are listed under Lab setup. Cloud labs need a free account; always delete resources after a lab.