Docker is a containerization platform that provides an easy way to containerize your applications. It allows you to:
- Build container images
- Run images to create containers
- Push containers to container registries like DockerHub and Quay.io
Docker Desktop is an easy-to-install application for Mac, Windows, or Linux that enables you to:
- Build and share containerized applications
- Includes key components such as:
- Docker daemon (dockerd)
- Docker client
- Docker Compose
- Docker Content Trust
- Kubernetes
- Credential Helper
A Docker registry stores Docker images. Key points:
- Docker Hub is a public registry anyone can use
- Docker is configured to look for images on Docker Hub by default
- You can run your own private registry
docker pull: Pull images from a registrydocker push: Push images to a registrydocker run: Run images from a registry
When using Docker, you create and use:
- Images
- Containers
- Networks
- Volumes
- Plugins
A Dockerfile is a text file that provides step-by-step instructions to build a Docker Image.
- Update package list
sudo apt update- Install Docker
sudo apt install docker.io -y- Check Docker daemon status
sudo systemctl status docker- Start Docker daemon (if not running)
sudo systemctl start docker- Grant user access to Docker
sudo usermod -aG docker <username>Replace <username> with your actual username (e.g., ubuntu)
Run the hello-world test:
docker run hello-world- Build your first Docker image
docker build -t <username>/my-first-docker-image:latest .- Verify created image
docker images- Run your first container
docker run -it <username>/my-first-docker-image- Official Docker Documentation: https://docs.docker.com/get-docker/
- Always use specific image tags instead of
latest - Keep your images small
- Use multi-stage builds
- Implement proper security measures
Feel free to contribute to this guide by submitting pull requests or reporting issues.
Name : Mohammad Asad Rahmani email : asadrahmani3101@gmail.com