Installing Docker CE
By default, Fedora CoreOS comes with out-of-the-box support for docker
CLI (as provided via Moby). However, in some cases Docker Community Edition (CE) may be preferred for various reasons. This page explains how to replace the provided version with the latest from the upstream Docker sources.
The recommended approach from the official Docker documentation is to add the Docker repository to your system. You can then install and update Docker CE from this repository.
Installing Docker CE on first boot
On provisioning, you can install Docker CE during the first boot of the system via ignition configuration.
variant: fcos
version: 1.5.0
systemd:
units:
# Install Docker CE
- name: rpm-ostree-install-docker-ce.service
enabled: true
contents: |
[Unit]
Description=Install Docker CE
Wants=network-online.target
After=network-online.target
Before=zincati.service
ConditionPathExists=!/var/lib/%N.stamp
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/curl --output-dir "/etc/yum.repos.d" --remote-name https://download.docker.com/linux/fedora/docker-ce.repo
ExecStart=/usr/bin/rpm-ostree override remove moby-engine containerd runc --install docker-ce
ExecStart=/usr/bin/touch /var/lib/%N.stamp
ExecStart=/usr/bin/systemctl --no-block reboot
[Install]
WantedBy=multi-user.target
Installing Docker CE on a running system
First, download and setup the Docker repository. Then you need to remove moby-engine
and several other conflicting packages that ship by default in the Fedora CoreOS image, install the necessary Docker CE packages, and reboot the system.
curl --remote-name https://download.docker.com/linux/fedora/docker-ce.repo
sudo install --owner 0 --group 0 --mode 644 docker-ce.repo /etc/yum.repos.d/docker-ce.repo
sudo rpm-ostree override remove moby-engine containerd runc --install docker-ce --reboot
Want to help? Learn how to contribute to Fedora Docs ›