Docker Lesson 10 – First Docker Hands-On | Dataplexa
Section I · Lesson 10

First Docker Hands-On

Nine lessons of concepts, diagrams, and analogies. Now you run Docker — for real, in a live terminal, with challenges that connect everything you've learned into one complete hands-on session.

This lesson is different from the previous nine. There's no new theory. Instead, you'll work through six challenges that each revisit a concept from Section I — pulling images, running containers, reading output, inspecting state, exploring the filesystem, and cleaning up. Every challenge connects back to the lesson it came from.

Your Live Practice Terminal

Click the button below to open a free real Ubuntu terminal with Docker pre-installed — no signup, no credit card, no installation. It opens in a new tab. Come back here, work through each challenge, and tick it off as you go.

Live Practice — Lesson 10

First Docker Hands-On — real terminal, free

Powered by Killercoda · no signup required · runs in your browser

Open Free Terminal on Killercoda 100% free · no account needed

Once the terminal loads, Docker is already installed and ready. Run each challenge below in order — they build on each other. Tick each one off as you complete it.

The Six Challenges

Each challenge below maps directly to a lesson in Section I. Work through them in order — they tell a complete story from first command to full cleanup.

Challenge 1

Verify Docker is running — Lesson 4

Before running anything, confirm all three components from the Docker architecture are working. This is the same verification step from Lesson 5.

docker --version         # confirms the Docker Client is installed
docker info              # confirms the Daemon is running and shows system stats
docker run hello-world   # tests Client → Daemon → Registry all in one shot

You passed this challenge if: hello-world prints "Hello from Docker!" and docker info shows the Daemon version and container count.

Challenge 2

Pull and inspect an image — Lesson 7

Pull the official nginx:alpine image and explore its layers using the commands from Lesson 7. Notice how many layers it has and how small the Alpine-based image is compared to a full OS image.

docker pull nginx:alpine          # pull a specific tagged version — not latest
docker images                     # see it in your local image cache with its size
docker history nginx:alpine       # inspect every layer and the command that created it

You passed this challenge if: docker images shows nginx with the alpine tag and a size under 50 MB, and docker history shows multiple layers starting from an Alpine base.

Challenge 3

Run a container and read its state — Lessons 6 + 8

Start nginx in detached mode with a port mapping and a name. Then use docker ps to read every column of the output, and docker inspect to find its internal IP address and the environment variables set inside it.

docker run -d -p 8080:80 --name nginx-server nginx:alpine
docker ps                        # read the STATUS and PORTS columns carefully
docker inspect nginx-server      # find the IPAddress and Env fields in the JSON output

You passed this challenge if: docker ps shows Up status and 0.0.0.0:8080->80/tcp, and docker inspect shows an IPAddress in the 172.17.x.x range.

Challenge 4

Get inside a running container — Lesson 6

Use docker exec to open a shell inside the running nginx container. Navigate its filesystem, find the default HTML file nginx serves, and look at the nginx config. Then exit without stopping the container.

docker exec -it nginx-server sh        # Alpine uses sh not bash
ls /usr/share/nginx/html/              # find the default index.html nginx serves
cat /etc/nginx/nginx.conf              # read the nginx configuration
exit                                   # leave the container — it keeps running
docker ps                              # confirm it's still up after you exited

You passed this challenge if: you see index.html in the html directory and the nginx config loads without errors — and the container is still Up after you exit.

Challenge 5

Walk the stop → exited → restart cycle — Lesson 9

Stop the nginx container, verify its state with docker ps -a, check the exit code, then bring it back with docker start. Confirm it's the exact same container — same ID, same configuration.

docker stop nginx-server               # graceful stop
docker ps -a                           # confirm Exited (0) status
docker start nginx-server              # bring it back
docker ps                              # same container ID — same config restored

You passed this challenge if: after docker start, the CONTAINER ID in docker ps is identical to the one from Challenge 3 — proving it's the same container, not a new one.

Challenge 6

Full cleanup — Lesson 9

Complete the full lifecycle — stop the container, remove it, remove the image, and verify your environment is completely clean. Finish with docker system prune to remove anything left behind.

docker stop nginx-server               # stop the running container
docker rm nginx-server                 # delete the container
docker rmi nginx:alpine                # remove the image
docker ps -a                           # should show no containers
docker images                          # should show no images (or only hello-world)
docker system prune                    # clean up any remaining dangling resources

You passed this challenge if: both docker ps -a and docker images return empty tables — your environment is completely clean.

Track your progress

0 of 6 challenges completed

Section I — Concepts You Now Own

Ten lessons in, here's everything that's now in your toolkit — concepts you've not just read about but used in a real terminal.

Concepts

  • The "works on my machine" problem and why it exists
  • VMs vs containers — architecture and tradeoffs
  • Docker's three-part architecture — Client, Daemon, Registry
  • Images as read-only layered templates
  • Containers as isolated, writable process instances
  • The full container lifecycle — all six phases
  • Restart policies for production resilience

Commands

  • docker run, docker ps, docker ps -a
  • docker stop, docker start, docker rm
  • docker pull, docker images, docker rmi
  • docker logs, docker logs -f
  • docker exec -it
  • docker inspect, docker history
  • docker system prune

Teacher's Note

If any challenge felt uncomfortable, go back to that lesson and re-read it — then run the challenge again. The discomfort is pointing exactly at the gap. Section II starts writing Dockerfiles, and every concept here is assumed knowledge from that point on.

Practice Questions

1. To open an interactive shell inside a running container based on Alpine Linux, you use docker exec -it followed by the container name and what shell command?



2. The single command that removes all stopped containers, dangling images, and unused networks in one shot is called what?



3. To find a running container's internal IP address and the environment variables set inside it, you run what command?



Quiz

1. After stopping a container with docker stop, it no longer appears in docker ps. To find it, what command do you run and why?


2. Running docker exec -it nginx-server bash returns "executable file not found." The most likely reason is:


3. A colleague says Docker is installed but something feels broken. The single best command to verify the entire Docker architecture is working is:


Up Next · Lesson 11

Dockerfile Introduction

Section I is complete. Section II starts now — and the first thing you'll do is write your own Dockerfile and build an image from scratch.