Glossary & Docker Commands¶
Glossary¶
- Container — A lightweight, isolated process based on a Docker image.
- Image — A template used to create containers, containing everything needed to run an application.
- Dockerfile — A text file with instructions to build a Docker image.
- Volume — Storage outside of a container to persist data beyond the container lifecycle.
- Docker Hub — Cloud service for storing and distributing Docker images.
- Network — A virtual network allowing containers to communicate.
- Docker Daemon — Background service managing containers and images.
Common Docker Commands Cheat Sheet¶
Command | Description |
---|---|
docker run [image] |
Run a new container from an image |
docker ps |
List running containers |
docker ps -a |
List all containers (including stopped ones) |
docker stop [container_id] |
Stop a running container |
docker rm [container_id] |
Remove a container |
docker images |
List local Docker images |
docker rmi [image_id] |
Remove an image |
docker build -t [name] . |
Build an image from a Dockerfile in the current folder |
docker logs [container_id] |
View container logs |
docker exec -it [container_id] bash |
Open an interactive shell inside a container |
docker-compose up |
Run services defined in docker-compose.yml |
docker network ls |
List Docker networks |