Get Started with Docker Desktop
Learn Docker basics — containers, images, volumes, and Compose — to run apps in isolated environments without dependency conflicts.
What is Docker?
Docker is a tool that lets you run applications in containers — lightweight, isolated environments that include everything an app needs to run. No more installing Python 3.10 for one app and 3.12 for another. Each container has its own dependencies, and they don't interfere with each other.
Step 1. Install Docker Desktop
- 1.Download from docker.com for Windows or Mac.
- 2.On Linux, use Docker Engine (
sudo apt install docker.io). - 3.Start the application and verify it works by opening a terminal and running the command below.
docker --version
Step 2. Understand the core concepts
- •Images are templates (like a blueprint).
- •Containers are running instances of images (like a running app).
- •Volumes are persistent storage that survives container restarts.
- •Networks let containers talk to each other.
Step 3. Run your first container
Run the commands below to test Docker.
docker run hello-world
This prints a welcome message. Then try starting a web server and visit http://localhost:8080:
docker run -d -p 8080:80 nginx
The -d flag runs in background, -p maps host port to container port.
Step 4. Managing containers
- •
docker ps— list running containers. - •
docker ps -a— list all including stopped. - •
docker stop NAME— stop a container. - •
docker rm NAME— remove a container. - •
docker logs NAME— view output. - •
docker images— list downloaded images.
Step 5. Docker Compose for multi-container apps
When an app needs multiple services (e.g., web + database), use Compose. Create a docker-compose.yml file.
Example docker-compose.yml
services: web: image: nginx ports: - "8080:80" db: image: postgres environment: POSTGRES_PASSWORD: secret
Then run:
docker compose up -d
Step 6. Building your own image
Create a Dockerfile:
Dockerfile
FROM python:3.12-slim COPY . /app WORKDIR /app RUN pip install flask CMD ["python", "app.py"]
Build with:
docker build -t myapp .
Run with:
docker run -p 5000:5000 myapp
Quick Tips
- •Use
docker system pruneto clean up unused resources. - •Use volumes for persistent data (without them data is lost on restart).
- •Browse Docker Hub for pre-made images.
- •Use
-p host:containerfor port mapping. - •Tag your builds with
docker build -t myapp:v1.
Need More Help?
StarCaller Academy offers 1-to-1 sessions to help you with any of these topics and more.