Today, we’re getting hands-on with Docker, the most popular containerization tool. We’ll install Docker on your local machine and run your first container. By the end, you’ll see how easy it is to spin up isolated environments. Let’s get started!
Docker makes containers accessible. It allows you to build, share, and run apps in containers effortlessly. Key benefits:
Isolation: Apps run in their environment without interfering with your system.
Portability: "Build once, run anywhere."
Efficiency: Faster than VMs.
As of 2025, Docker remains the standard, with the latest versions available via official docs.
Docker installation varies by OS. Follow the official guides for the latest steps (from docs.docker.com).
For Windows:
Download Docker Desktop from docker.com.
Run the installer and follow prompts. Enable WSL 2 if prompted.
Open Docker Desktop to verify it's running.
For macOS:
Download Docker Desktop for Mac.
Open the DMG file, drag to Applications, and launch.
Grant permissions if needed.
For Linux (Ubuntu example):
Update packages: sudo apt-get update
Install prerequisites: sudo apt-get install ca-certificates curl
Add Docker's GPG key: sudo install -m 0755 -d /etc/apt/keyrings followed by curl command from docs.
Add repo: sudo apt-get update
Install: sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Verify: sudo docker run hello-world
Tip: Use the official install script for simplicity on Linux:
curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh
Once installed, open a terminal and run:
docker run hello-world
This pulls the hello-world image from Docker Hub and runs it. Output should confirm Docker is working.
Troubleshooting:
Let’s explore essentials:
docker ps: List running containers.
docker images: List local images.
docker pull nginx: Download an image (e.g., NGINX web server).
docker run -d -p 8080:80 nginx: Run NGINX in detached mode, mapping port 8080 to 80. Visit http://localhost:8080.
Experiment: Run docker run -it ubuntu bash for an interactive Ubuntu shell.
You’ve installed Docker and run your first container-congrats! This sets the foundation for building custom images in the next COE.
Ready to transform your business with our technology solutions? Contact Us today to Leverage Our DevOps Expertise.
Contact Us