Getting Started: Your First ContaineršŸ‹

Published: (December 6, 2025 at 09:33 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Setting Up Docker Desktop

The easiest way to start is by installing Docker Desktop. This package includes the Docker Engine, Docker CLI (Command Line Interface), Docker Compose, and a user‑friendly GUI for Windows, macOS, and Linux.

Installation

Go to the official Docker website and download Docker Desktop for your operating system.

Installation note

Follow the default installation steps. You will likely need to restart your computer once the installation is complete.

Verification

Open your terminal (Command Prompt, PowerShell, or Bash) and run:

docker --version

You should see output indicating the version of the Docker client you have installed.

The Core Concept: Image vs. Container

TermDescription
Docker ImageA static, read‑only blueprint that contains the application code, dependencies, libraries, and configuration needed for your app.
Docker ContainerA running instance of an image – a lightweight, isolated environment that is executable.

Your First Command: Pulling an Image

Docker needs the image before it can run a container. If the image isn’t available locally, Docker automatically pulls it from a container registry (default: Docker Hub).

Pull the official Nginx web server image:

docker pull nginx:latest
  • docker pull – command to download an image.
  • nginx – repository name (the image).
  • :latest – tag specifying the version (default if omitted).

You will see output showing Docker downloading the image in layers.

Running Your First Container (The Web Server)

Launch an instance of the Nginx image as an isolated web server:

docker run -d -p 8080:80 --name my-nginx-server nginx

Command breakdown

FlagDescription
docker runCreates a new container and runs a command in it.
-dDetached mode – runs the container in the background.
-p 8080:80Publishes port 80 inside the container to port 8080 on the host.
--name my-nginx-serverAssigns a human‑readable name to the container.
nginxImage to run (Docker assumes :latest if no tag is specified).

Verification

Open your web browser and navigate to http://localhost:8080. You should see the ā€œWelcome to nginx!ā€ default page.

Managing Your Running Containers

Checking container status

docker ps

Shows a list of currently running containers, including Container ID, image, ports, and status.

Viewing container logs

docker logs my-nginx-server

Displays the container’s stdout/stderr output (e.g., access logs, errors).

Stopping and removing the container

docker stop my-nginx-server   # Gracefully stops the container
docker rm my-nginx-server     # Deletes the stopped container

Note: A container must be stopped before it can be removed.

Cleaning Up the Image

If you no longer need the Nginx image:

docker rmi nginx

rmi stands for ā€œremove image.ā€
You cannot remove an image while any containers (even stopped ones) still reference it.

What’s Next?

You’ve successfully installed Docker and learned the basic commands to run and manage your first container. In the next post, we’ll dive deeper into Docker images and layers to understand why containers are so fast and efficient—essential knowledge before we start building our own images!

Back to Blog

Related posts

Read more Ā»

MINDS EYE FABRIC

Phase 1 — C++ Sovereign Kernel Skeleton Daemon‑First Goal – ship a running C++ daemon that can: - accept events - maintain a capability graph endpoints + edges...

AWS for Developers: The Guide

Why AWS Still Rules the Cloud Even with big players like Azure and GCP growing fast, AWS dominates because: - Most complete ecosystem Compute, Storage, Databas...