0Pricing
Docker & DevOps Fundamentals · Lesson

Your First Docker Container

Run your very first Docker container, understand basic commands, and interact with a simple application.

Your First Docker Container is a free Docker & DevOps Fundamentals lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Docker & DevOps Fundamentals learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Ready to Run Docker?

Time for hands-on Docker! You'll start containers, interact with them, and manage their lifecycle using the core commands.

Your First Docker Container — illustration 1

The `docker run` Command

docker run is your gateway to containers. It checks for the image locally, pulls it from Docker Hub if missing, then creates and starts a container.

Hello, Docker World!

Run the classic hello-world container — it prints a message and exits. Perfect for a first smoke test.

docker run hello-world

Understanding the Output

That output confirms Docker pulled and ran the image successfully. The message came from inside the container, proving it executed its task.

Interactive Containers

For an interactive shell, add -it: -i keeps STDIN open, -t allocates a terminal. Try docker run -it ubuntu bash to drop into Ubuntu.

docker run -it ubuntu bash

Exploring Inside Ubuntu

Your prompt changed — you're now inside the Ubuntu container. Run normal Linux commands like ls and pwd, then type exit to leave.

ls /
pwd
exit

Running in Detached Mode

To run a container in the background, use detached mode with -d. Try docker run -d nginx to launch an Nginx server without tying up your terminal.

docker run -d nginx

Listing Running Containers

docker ps lists every running container, showing ID, image, command, and status — your window into what's active right now.

docker ps

Stopping a Container

Stop a container gracefully with docker stop <id>, using the ID or name from docker ps.

docker stop <container_id>

Quick Check: Docker Commands

You've learned several fundamental Docker commands. Let's test your knowledge!

Recap: Your First Containers

You ran and managed your first containers: docker run, -it for shells, -d for background, docker ps to list, docker stop to halt. Next: building images.

Frequently asked questions

Is the “Your First Docker Container” lesson free?

Yes — the full text of “Your First Docker Container” is free to read here on the web, and the Docker & DevOps Fundamentals course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Docker & DevOps Fundamentals course, upgrade to CoddyKit PRO.

What will I learn in “Your First Docker Container”?

Run your very first Docker container, understand basic commands, and interact with a simple application. You practise Docker & DevOps Fundamentals with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Docker & DevOps Fundamentals?

No prior experience is required. Docker & DevOps Fundamentals on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Your First Docker Container” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Docker & DevOps Fundamentals lesson?

Yes. Every Docker & DevOps Fundamentals lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What are Containers?
  2. Installing Docker Desktop
  3. Your First Docker Container
  4. Managing Data with Docker Volumes
← Back to Docker & DevOps Fundamentals