engine/install: use dnf for CentOS and RHEL

The versions of CentOS and RHEL we support now have dnf as a default
instead of yum, so rewrite these to use dnf.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2024-11-08 13:10:58 +01:00
parent 26aaea63a4
commit a8cfab163d
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
3 changed files with 29 additions and 29 deletions

View File

@ -1,7 +1,7 @@
--- ---
description: Learn how to install Docker Engine on CentOS. These instructions cover description: Learn how to install Docker Engine on CentOS. These instructions cover
the different installation methods, how to uninstall, and next steps. the different installation methods, how to uninstall, and next steps.
keywords: requirements, yum, installation, centos, install, uninstall, docker engine, upgrade, update keywords: requirements, dnf, yum, installation, centos, install, uninstall, docker engine, upgrade, update
title: Install Docker Engine on CentOS title: Install Docker Engine on CentOS
linkTitle: CentOS linkTitle: CentOS
weight: 60 weight: 60
@ -41,7 +41,7 @@ Uninstall any such older versions before attempting to install a new version,
along with associated dependencies. along with associated dependencies.
```console ```console
$ sudo yum remove docker \ $ sudo dnf remove docker \
docker-client \ docker-client \
docker-client-latest \ docker-client-latest \
docker-common \ docker-common \
@ -51,7 +51,7 @@ $ sudo yum remove docker \
docker-engine docker-engine
``` ```
`yum` might report that you have none of these packages installed. `dnf` might report that you have none of these packages installed.
Images, containers, volumes, and networks stored in `/var/lib/docker/` aren't Images, containers, volumes, and networks stored in `/var/lib/docker/` aren't
automatically removed when you uninstall Docker. automatically removed when you uninstall Docker.
@ -81,12 +81,12 @@ Docker from the repository.
#### Set up the repository #### Set up the repository
Install the `yum-utils` package (which provides the `yum-config-manager` Install the `dnf-plugins-core` package (which provides the commands to manage
utility) and set up the repository. your DNF repositories) and set up the repository.
```console ```console
$ sudo yum install -y yum-utils $ sudo dnf -y install dnf-plugins-core
$ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce.repo $ sudo dnf config-manager --add-repo {{% param "download-url-base" %}}/docker-ce.repo
``` ```
#### Install Docker Engine #### Install Docker Engine
@ -99,7 +99,7 @@ $ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
To install the latest version, run: To install the latest version, run:
```console ```console
$ sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin $ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
``` ```
If prompted to accept the GPG key, verify that the fingerprint matches If prompted to accept the GPG key, verify that the fingerprint matches
@ -115,7 +115,7 @@ $ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
the repository: the repository:
```console ```console
$ yum list docker-ce --showduplicates | sort -r $ dnf list docker-ce --showduplicates | sort -r
docker-ce.x86_64 3:27.3.1-1.el9 docker-ce-stable docker-ce.x86_64 3:27.3.1-1.el9 docker-ce-stable
docker-ce.x86_64 3:27.3.0-1.el9 docker-ce-stable docker-ce.x86_64 3:27.3.0-1.el9 docker-ce-stable
@ -133,7 +133,7 @@ $ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
command to install: command to install:
```console ```console
$ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin $ sudo dnf install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin
``` ```
This command installs Docker, but it doesn't start Docker. It also creates a This command installs Docker, but it doesn't start Docker. It also creates a
@ -186,7 +186,7 @@ download a new file each time you want to upgrade Docker Engine.
the Docker package. the Docker package.
```console ```console
$ sudo yum install /path/to/package.rpm $ sudo dnf install /path/to/package.rpm
``` ```
Docker is installed but not started. The `docker` group is created, but no Docker is installed but not started. The `docker` group is created, but no
@ -219,8 +219,8 @@ You have now successfully installed and started Docker Engine.
#### Upgrade Docker Engine #### Upgrade Docker Engine
To upgrade Docker Engine, download the newer package files and repeat the To upgrade Docker Engine, download the newer package files and repeat the
[installation procedure](#install-from-a-package), using `yum upgrade` [installation procedure](#install-from-a-package), using `dnf upgrade`
instead of `yum install`, and point to the new files. instead of `dnf install`, and point to the new files.
{{< include "install-script.md" >}} {{< include "install-script.md" >}}
@ -229,7 +229,7 @@ instead of `yum install`, and point to the new files.
1. Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages: 1. Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages:
```console ```console
$ sudo yum remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras $ sudo dnf remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
``` ```
2. Images, containers, volumes, or custom configuration files on your host 2. Images, containers, volumes, or custom configuration files on your host

View File

@ -1,7 +1,7 @@
--- ---
description: Learn how to install Docker Engine on Fedora. These instructions cover description: Learn how to install Docker Engine on Fedora. These instructions cover
the different installation methods, how to uninstall, and next steps. the different installation methods, how to uninstall, and next steps.
keywords: requirements, apt, installation, fedora, install fedora, install docker engine, rpm, install, uninstall, upgrade, keywords: requirements, dnf, installation, fedora, install fedora, install docker engine, rpm, install, uninstall, upgrade,
update update
title: Install Docker Engine on Fedora title: Install Docker Engine on Fedora
linkTitle: Fedora linkTitle: Fedora

View File

@ -1,7 +1,7 @@
--- ---
description: Learn how to install Docker Engine on RHEL. These instructions cover description: Learn how to install Docker Engine on RHEL. These instructions cover
the different installation methods, how to uninstall, and next steps. the different installation methods, how to uninstall, and next steps.
keywords: requirements, apt, installation, rhel, rpm, install, install docker engine, uninstall, upgrade, keywords: requirements, dnf, installation, rhel, rpm, install, install docker engine, uninstall, upgrade,
update update
title: Install Docker Engine on RHEL title: Install Docker Engine on RHEL
linkTitle: RHEL linkTitle: RHEL
@ -40,7 +40,7 @@ along with associated dependencies. Also uninstall `Podman` and the associated
dependencies if installed already: dependencies if installed already:
```console ```console
$ sudo yum remove docker \ $ sudo dnf remove docker \
docker-client \ docker-client \
docker-client-latest \ docker-client-latest \
docker-common \ docker-common \
@ -52,7 +52,7 @@ $ sudo yum remove docker \
runc runc
``` ```
`yum` might report that you have none of these packages installed. `dnf` might report that you have none of these packages installed.
Images, containers, volumes, and networks stored in `/var/lib/docker/` aren't Images, containers, volumes, and networks stored in `/var/lib/docker/` aren't
automatically removed when you uninstall Docker. automatically removed when you uninstall Docker.
@ -82,12 +82,12 @@ Docker from the repository.
#### Set up the repository #### Set up the repository
Install the `yum-utils` package (which provides the `yum-config-manager` Install the `dnf-plugins-core` package (which provides the commands to manage
utility) and set up the repository. your DNF repositories) and set up the repository.
```console ```console
$ sudo yum install -y yum-utils $ sudo dnf -y install dnf-plugins-core
$ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce.repo $ sudo dnf config-manager --add-repo {{% param "download-url-base" %}}/docker-ce.repo
``` ```
#### Install Docker Engine #### Install Docker Engine
@ -100,7 +100,7 @@ $ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
To install the latest version, run: To install the latest version, run:
```console ```console
$ sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin $ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
``` ```
If prompted to accept the GPG key, verify that the fingerprint matches If prompted to accept the GPG key, verify that the fingerprint matches
@ -116,7 +116,7 @@ $ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
the repository: the repository:
```console ```console
$ yum list docker-ce --showduplicates | sort -r $ dnf list docker-ce --showduplicates | sort -r
docker-ce.x86_64 3:27.3.1-1.el9 docker-ce-stable docker-ce.x86_64 3:27.3.1-1.el9 docker-ce-stable
docker-ce.x86_64 3:27.3.0-1.el9 docker-ce-stable docker-ce.x86_64 3:27.3.0-1.el9 docker-ce-stable
@ -134,7 +134,7 @@ $ sudo yum-config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
command to install: command to install:
```console ```console
$ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin $ sudo dnf install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin
``` ```
This command installs Docker, but it doesn't start Docker. It also creates a This command installs Docker, but it doesn't start Docker. It also creates a
@ -199,7 +199,7 @@ download a new file each time you want to upgrade Docker Engine.
the packages. the packages.
```console ```console
$ sudo yum install ./containerd.io-<version>.<arch>.rpm \ $ sudo dnf install ./containerd.io-<version>.<arch>.rpm \
./docker-ce-<version>.<arch>.rpm \ ./docker-ce-<version>.<arch>.rpm \
./docker-ce-cli-<version>.<arch>.rpm \ ./docker-ce-cli-<version>.<arch>.rpm \
./docker-buildx-plugin-<version>.<arch>.rpm \ ./docker-buildx-plugin-<version>.<arch>.rpm \
@ -236,8 +236,8 @@ You have now successfully installed and started Docker Engine.
#### Upgrade Docker Engine #### Upgrade Docker Engine
To upgrade Docker Engine, download the newer package files and repeat the To upgrade Docker Engine, download the newer package files and repeat the
[installation procedure](#install-from-a-package), using `yum upgrade` [installation procedure](#install-from-a-package), using `dnf upgrade`
instead of `yum install`, and point to the new files. instead of `dnf install`, and point to the new files.
{{< include "install-script.md" >}} {{< include "install-script.md" >}}
@ -246,7 +246,7 @@ instead of `yum install`, and point to the new files.
1. Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages: 1. Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages:
```console ```console
$ sudo yum remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras $ sudo dnf remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
``` ```
2. Images, containers, volumes, or custom configuration files on your host 2. Images, containers, volumes, or custom configuration files on your host