Docker Install Linux
This chapter covers how to run common Linux distribution containers with Docker, including Ubuntu, Alpine, and CentOS.
Ubuntu Container
Pull and Run
Common Operations
Custom Ubuntu Image
Alpine Container
Alpine Linux is an extremely lightweight distribution, ideal as a Docker base image.
Pull and Run
Package Management
Alpine uses the apk package manager:
Custom Alpine Image
Image Size Comparison
CentOS Container
⚠️ CentOS 8 reached EOL in 2021. Consider CentOS Stream, Rocky Linux, or AlmaLinux as alternatives.
Pull and Run
Package Management
Practical Scenarios
Testing Different Linux Environments
Setting Up a Development Environment
Chapter Summary
Running Linux distribution containers with Docker is straightforward and great for development, testing, and learning. Alpine is the preferred base image for production due to its minimal size.