Course: Cloud & DevOps Engineer Path · Lesson 1 of 1Log in to track your progress and earn a certificate when you finish the course.
DevOpsDocker Container Basics: Your First Container
Published March 18, 2026·Updated October 29, 2026·8 min read
Introduction
Docker packages an application and its dependencies into a portable container. This tutorial introduces images, containers, and the everyday CLI workflow.
Prerequisites
- Docker Desktop installed
- Basic command line familiarity
Step-by-Step Guide
Step 1: Pull an image
Images are read-only templates used to create containers.
docker pull node:20-alpineStep 2: Run a container
Start a container from an image and map a port to your host machine.
docker run -p 3000:3000 node:20-alpineStep 3: Write a Dockerfile
Define your own image by describing build steps in a Dockerfile.
FROM node:20-alpine
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]Step 4: Manage containers
List, stop, and remove containers using the Docker CLI.
docker ps
docker stop <container-id>
docker rm <container-id>FAQs
- What is the difference between an image and a container?
- An image is a static template; a container is a running instance of that image with its own writable layer.
Summary
Once you're comfortable pulling images and running containers, the natural next step is orchestrating multiple containers with Docker Compose or Kubernetes.
Comments
Log in or create a free account to join the discussion.