So here is a list of commands.
Fetch the .repo
file:
curl -O https://download.docker.com/linux/fedora/docker-ce.repo
Place the .repo
file to the yum.repos.d
:
sudo install -o 0 -g 0 -m644 docker-ce.repo /etc/yum.repos.d/docker-ce.repo
Then just install docker
with rpm-ostree
:
rpm-ostree install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
If you want to manage gpg
by yourself you manually download .gpg
file, the only difference to the previous command is the ending, but here it is:
curl -O https://download.docker.com/linux/fedora/docker-ce.gpg
And place it to the pki/rpm-gpg
, with:
sudo install -o 0 -g 0 -m644 docker-ce.gpg /etc/pki/rpm-gpg/docker-ce.gpg
Then you need modify the /etc/yum.repos.d/docker-ce.repo
file to point the gpgkey
field to the /etc/pki/rpm-gpg/docker-ce.gpg
in each package. There are a couple of packages in the repo, so there will be some hand work to do. Here is example for docker-ce-nightly
:
...
[docker-ce-nightly]
name=Docker CE Nightly - $basearch
baseurl=https://download.docker.com/linux/fedora/$releasever/$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/docker-ce.gpg
...
After you’ll need to enable the service to run on boot:
systemctl enable docker
And restart the system:
systemctl reboot