Docker Notes 1 - Understanding Docker
Introduction to Docker and containerization technology
Containerization isolates different environments, allowing engineers to focus on development without spending excessive effort on environment setup.
Docker is currently a mature and popular containerization technology.
Transforming the OS into Application Each container allows only one command to be executed Default permissions will be root
For business
- Convenient deployment
- Portability
Evolution of Containers
Glossary
- Stateful
- Stateless: Without setting, each creation will eliminate old data
- Repository
- Similar to apt, brew, or yum sources
- Stores many images (Packages)
- Image
- Equivalent to Package
- Generates a special cache; if there’s a local cache, there’s no need to fetch from the Repository (like Docker Hub) again
- Container
- Created from an image
- Equivalent to individual programs that can run continuously
- Must have a foreground-running program
- Network
- none: No network
- bridge: LAN
- overlay: Different segments
- container: Docker’s default network connection, cannot be accessed directly from outside
- host: Shares network interfaces with the host
- Volume
- Persistent (Stateful) space within Docker, secret (space) stateful
- Equivalent to local space
Architecture
Lifecycle
- Client calls docker daemon
- Docker daemon communicates with host network / host cgroups
- Determine if the docker container exists
- Unpack the layers from the local image
- If the local image does not exist, fetch from the repository
- Create docker container
Learning Resources
Online practice environment: Play with Docker
Docker Basic Concepts and Usage Tutorial: Building Docker Images - G. T. Wang