Docker CE (Archived Repository) - Build and Usage Guide
⚠️ CRITICAL DEPRECATION NOTICE: This repository is deprecated and archived as of Docker 20.10. Docker CE itself is NOT deprecated, but this monorepo is no longer the source of truth. Current development happens at moby/moby (Engine) and docker/cli (CLI). This guide is preserved for historical reference and maintenance of older versions (≤ 20.10).
1. Prerequisites
System Requirements
- OS: Linux (Ubuntu 18.04+ or CentOS 7+ recommended) or macOS (for client builds only)
- Architecture: x86_64, arm64, or armhf
- Disk Space: Minimum 20GB free space (builds require significant storage for multiple component checkouts and container images)
- Memory: 4GB RAM minimum, 8GB+ recommended
Required Tools
- Docker Engine: 19.03+ (required for containerized builds)
- Go: 1.13.x or 1.14.x (matching the version specified in
components/engine/vendor.modorcomponents/cli/go.mod) - Git: 2.20+ with LFS support
- Make: GNU Make 4.0+
- moby-components: Required for unifying upstream sources (see
components.conf)
Optional Tools
- go-swagger: For API documentation generation
- jq: For JSON processing in build scripts
2. Installation
Clone the Repository
# Clone with all submodules (critical for component unification)
git clone --recursive https://github.com/docker-archive/docker-ce.git
cd docker-ce
# If you already cloned without --recursive:
git submodule update --init --recursive
Verify Component Structure
The repository uses moby-components to unify upstream sources. Verify components are populated:
ls -la components/
# Expected: cli, engine, packaging directories
Checkout Specific Release (Optional)
For production builds, checkout a release branch rather than master:
# Release branches follow YY.MM format (e.g., 19.03, 20.10)
git checkout 20.10
git submodule update --init --recursive
3. Configuration
Build Tags
Set build constraints via environment variables:
export DOCKER_BUILDTAGS="apparmor seccomp selinux"
Component Configuration
Edit components.conf to modify upstream sources:
[component "engine"]
url = https://github.com/moby/moby.git
branch = 20.10
ref = v20.10.7
[component "cli"]
url = https://github.com/docker/cli.git
branch = 20.10
ref = v20.10.7
Proxy Settings (if behind corporate firewall)
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1
4. Build & Run
Development Environment
Enter the build container (recommended for consistent builds):
make shell
# This drops you into a container with all build dependencies
Build Static Binaries
# Build both daemon and client static binaries
make static
# Or build individually
make static-cli
make static-engine
Outputs appear in bundles/static/:
ls bundles/static/
# dockerd (daemon)
# docker (client)
Build Distribution Packages
Debian/Ubuntu (.deb)
make deb
# Packages generated in bundles/deb/
RHEL/CentOS/Fedora (.rpm)
make rpm
# Packages generated in bundles/rpm/
Cross-platform builds
# Build for specific architecture
make DOCKER_CROSSPLATFORMS=linux/arm64 static
Local Development Run
Run the Daemon (from built binaries)
# Stop system Docker first (to avoid port conflicts)
sudo systemctl stop docker
# Run the newly built daemon
sudo ./bundles/binary-daemon/dockerd -D --host unix:///var/run/docker-test.sock
# In another terminal, use the new CLI
./bundles/binary-client/docker -H unix:///var/run/docker-test.sock version
Run with Debug Logging
sudo ./bundles/binary-daemon/dockerd -D -l debug --host unix:///var/run/docker-test.sock
5. Deployment
Install Built Binaries
Method 1: Direct Installation
# Install daemon
sudo cp bundles/binary-daemon/dockerd /usr/bin/dockerd-20.10
sudo cp bundles/binary-client/docker /usr/bin/docker-20.10
# Create symlinks (optional)
sudo ln -sf /usr/bin/docker-20.10 /usr/bin/docker
sudo ln -sf /usr/bin/dockerd-20.10 /usr/bin/dockerd
Method 2: Package Installation
# Debian/Ubuntu
sudo dpkg -i bundles/deb/*.deb
# RHEL/CentOS
sudo rpm -Uvh bundles/rpm/*.rpm
Configure systemd Service
Create /etc/systemd/system/docker-custom.service:
[Unit]
Description=Docker Custom Build Daemon
After=network.target
[Service]
Type=notify
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable docker-custom
sudo systemctl start docker-custom
Verification
docker version
docker info
docker run hello-world
6. Troubleshooting
"Repository Deprecated" Warnings
Issue: Build scripts reference archived repositories. Solution: Migrate to current repositories:
- Engine issues: https://github.com/moby/moby
- CLI issues: https://github.com/docker/cli
- Desktop issues: https://github.com/docker/for-linux, /for-mac, /for-win
Component Sync Failures
Issue: components/engine or components/cli directories empty.
Solution:
# Force component refresh
make clean
rm -rf components/*
make checkout
Vendor Directory Mismatches
Issue: Build fails with protobuf/gRPC version conflicts. Solution:
# Ensure vendor directories are populated
cd components/engine && go mod vendor
cd components/cli && go mod vendor
cd ../..
Permission Denied on docker.sock
Issue: Cannot connect to daemon after building from source. Solution:
# Add user to docker group (requires re-login)
sudo usermod -aG docker $USER
# Or run with sudo for testing
sudo ./bundles/binary-client/docker version
Build Container Failures
Issue: make shell fails with Docker socket errors.
Solution:
# Ensure Docker is running and user has permissions
sudo systemctl start docker
sudo chmod 666 /var/run/docker.sock # Temporary fix for testing only
Cross-compilation Errors
Issue: ARM builds fail on x86_64 hosts. Solution:
# Install binfmt_misc handlers
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
make DOCKER_CROSSPLATFORMS=linux/arm64 static
Release Branch Confusion
Issue: Cannot find specific version tags.
Note: Release tags (e.g., v20.10.7) exist only on release branches (20.10), not master. Master branch was emptied/archived.
For Current Development: Use docker/cli and moby/moby directly. This archive is preserved for reference only.