Terminology
- Image: read-only template to build a container. May be based on another image
- Container: a runnable instance of an image
- Volume: a persistent storage location outside a container
Docker Components
- Docker Engine
- Docker Daemon
- Docker Client
- Docker Desktop
- Docker Compose
- Registry
Docker Commands
pull
- Download an Imageimages
- List imagesrun
- Create a Containerstart | stop
- Start/Stop Containerps
- List Running Containersexec
- Run Command in Containerlogs
- View Container Logs
Docker Images
- Docker Hub
- Other Repositories
- Tags
- Alpine vs. Others
- Official vs. Community
Show Docker Hub
- Official Images
- Hello World
- Nginx
Commands
docker pull hello-world
docker run hello-world
docker run --name nginx -d nginx:alpine
docker ps
docker exec -it nginx /bin/sh
curl localhost:80
docker stop nginx
docker container prune
Open Questions
- How to access outside Docker?
- How to host own files in Nginx?
- How to persist data from Containers?
- How to simplify Docker commands?