Skip to content

Commit fd57681

Browse files
committed
centos
1 parent a81a152 commit fd57681

File tree

1 file changed

+32
-50
lines changed

1 file changed

+32
-50
lines changed

content/manuals/engine/install/centos.md

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ download-url-base: https://download.docker.com/linux/centos
1919
---
2020

2121
To get started with Docker Engine on CentOS, make sure you
22-
[meet the prerequisites](#prerequisites), and then follow the
22+
[meet the prerequisites](#prerequisites), and follow the
2323
[installation steps](#installation-methods).
2424

2525
## Prerequisites
@@ -31,16 +31,17 @@ CentOS versions:
3131

3232
- CentOS 9 (stream)
3333

34-
The `centos-extras` repository must be enabled. This repository is enabled by
35-
default. If you have disabled it, you need to re-enable it.
34+
> [!NOTE]
35+
> The `centos-extras` repository must be enabled. This repository is enabled by default.
36+
> If you have disabled it, re-enable it before proceeding.
3637
3738
### Uninstall old versions
3839

39-
Before you can install Docker Engine, you need to uninstall any conflicting packages.
40+
Before you install Docker Engine, uninstall any conflicting packages.
4041

41-
Your Linux distribution may provide unofficial Docker packages, which may conflict
42-
with the official packages provided by Docker. You must uninstall these packages
43-
before you install the official version of Docker Engine.
42+
Your Linux distribution may provide unofficial Docker packages, which can
43+
conflict with the official packages provided by Docker. Uninstall these packages
44+
before installing the official version.
4445

4546
```console
4647
$ sudo dnf remove docker \
@@ -55,36 +56,25 @@ $ sudo dnf remove docker \
5556

5657
`dnf` might report that you have none of these packages installed.
5758

58-
Images, containers, volumes, and networks stored in `/var/lib/docker/` aren't
59-
automatically removed when you uninstall Docker.
59+
> [!NOTE]
60+
> Images, containers, volumes, and networks stored in `/var/lib/docker/` are
61+
> not automatically removed when you uninstall Docker.
6062
6163
## Installation methods
6264

63-
You can install Docker Engine in different ways, depending on your needs:
65+
You can install Docker Engine in different ways:
6466

65-
- You can
66-
[set up Docker's repositories](#install-using-the-repository) and install
67-
from them, for ease of installation and upgrade tasks. This is the
68-
recommended approach.
69-
70-
- You can download the RPM package,
71-
[install it manually](#install-from-a-package), and manage
72-
upgrades completely manually. This is useful in situations such as installing
73-
Docker on air-gapped systems with no access to the internet.
74-
75-
- In testing and development environments, you can use automated
76-
[convenience scripts](#install-using-the-convenience-script) to install Docker.
67+
- Recommended: [Set up Docker's repositories](#install-using-the-repository) and install from them for easy installation and upgrades.
68+
- Manual: [Download the RPM package](#install-from-a-package) and install it manually. Useful for air-gapped systems.
69+
- Development/testing: Use [convenience scripts](#install-using-the-convenience-script) for quick setup.
7770

7871
### Install using the rpm repository {#install-using-the-repository}
7972

80-
Before you install Docker Engine for the first time on a new host machine, you
81-
need to set up the Docker repository. Afterward, you can install and update
82-
Docker from the repository.
73+
Before installing Docker Engine for the first time on a new host, set up the Docker repository. Afterward, you can install and update Docker from the repository.
8374

8475
#### Set up the repository
8576

86-
Install the `dnf-plugins-core` package (which provides the commands to manage
87-
your DNF repositories) and set up the repository.
77+
Install the `dnf-plugins-core` package (provides commands to manage DNF repositories) and set up the repository.
8878

8979
```console
9080
$ sudo dnf -y install dnf-plugins-core
@@ -93,12 +83,10 @@ $ sudo dnf config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
9383

9484
#### Install Docker Engine
9585

96-
1. Install the Docker packages.
86+
{{< tabs >}}
87+
{{< tab name="Latest" >}}
9788

98-
{{< tabs >}}
99-
{{< tab name="Latest" >}}
100-
101-
To install the latest version, run:
89+
To install the latest version:
10290

10391
```console
10492
$ sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
@@ -124,27 +112,24 @@ $ sudo dnf config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
124112
<...>
125113
```
126114

127-
The list returned depends on which repositories are enabled, and is specific
128-
to your version of CentOS (indicated by the `.el9` suffix in this example).
115+
The list depends on which repositories are enabled and your CentOS version (see the `.el9` suffix).
129116

130117
Install a specific version by its fully qualified package name, which is
131118
the package name (`docker-ce`) plus the version string (2nd column),
132119
separated by a hyphen (`-`). For example, `docker-ce-3:{{% param "docker_ce_version" %}}-1.el9`.
133120

134-
Replace `<VERSION_STRING>` with the desired version and then run the following
135-
command to install:
121+
Replace `<VERSION_STRING>` with the desired version and run:
136122

137123
```console
138124
$ sudo dnf install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin
139125
```
140126

141-
This command installs Docker, but it doesn't start Docker. It also creates a
142-
`docker` group, however, it doesn't add any users to the group by default.
127+
This installs Docker, but does not start it. It also creates a `docker` group, but does not add users to the group by default.
143128

144129
{{< /tab >}}
145130
{{< /tabs >}}
146131

147-
2. Start Docker Engine.
132+
1. Start Docker Engine:
148133

149134
```console
150135
$ sudo systemctl enable --now docker
@@ -154,16 +139,15 @@ $ sudo dnf config-manager --add-repo {{% param "download-url-base" %}}/docker-ce
154139
boot your system. If you don't want Docker to start automatically, use `sudo
155140
systemctl start docker` instead.
156141

157-
3. Verify that the installation is successful by running the `hello-world` image:
142+
1. Verify the installation by running the `hello-world` image:
158143

159144
```console
160145
$ sudo docker run hello-world
161146
```
162147

163-
This command downloads a test image and runs it in a container. When the
164-
container runs, it prints a confirmation message and exits.
148+
This downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
165149

166-
You have now successfully installed and started Docker Engine.
150+
You have now installed and started Docker Engine.
167151

168152
{{% include "root-errors.md" %}}
169153

@@ -174,9 +158,7 @@ choosing the new version you want to install.
174158

175159
### Install from a package
176160

177-
If you can't use Docker's `rpm` repository to install Docker Engine, you can
178-
download the `.rpm` file for your release and install it manually. You need to
179-
download a new file each time you want to upgrade Docker Engine.
161+
If you cannot use Docker's `rpm` repository, download the `.rpm` file for your release and install it manually. Download a new file each time you want to upgrade Docker Engine.
180162

181163
<!-- markdownlint-disable-next-line -->
182164
1. Go to [{{% param "download-url-base" %}}/]({{% param "download-url-base" %}}/)
@@ -190,10 +172,10 @@ download a new file each time you want to upgrade Docker Engine.
190172
$ sudo dnf install /path/to/package.rpm
191173
```
192174

193-
Docker is installed but not started. The `docker` group is created, but no
194-
users are added to the group.
175+
Docker is installed but not started. The `docker` group
176+
is created, but no users are added to the group.
195177

196-
3. Start Docker Engine.
178+
3. Start Docker Engine:
197179

198180
```console
199181
$ sudo systemctl enable --now docker
@@ -232,7 +214,7 @@ instead of `dnf install`, and point to the new files.
232214
$ sudo dnf remove docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
233215
```
234216

235-
2. Images, containers, volumes, or custom configuration files on your host
217+
1. Images, containers, volumes, or custom configuration files on your host
236218
aren't automatically removed. To delete all images, containers, and volumes:
237219

238220
```console

0 commit comments

Comments
 (0)