engine: simplify apt-based installation for rpi

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2023-09-04 17:33:23 +02:00
parent 63e55f32c9
commit 7b7ec5b1e8
2 changed files with 32 additions and 50 deletions

View File

@ -32,6 +32,7 @@ For Compose standalone, see [Install Compose Standalone](standalone.md).
[Ubuntu](../../engine/install/ubuntu.md/#set-up-the-repository) | [Ubuntu](../../engine/install/ubuntu.md/#set-up-the-repository) |
[CentOS](../../engine/install/centos.md/#set-up-the-repository) | [CentOS](../../engine/install/centos.md/#set-up-the-repository) |
[Debian](../../engine/install/debian.md/#install-using-the-repository) | [Debian](../../engine/install/debian.md/#install-using-the-repository) |
[Raspberry Pi OS](../../engine/install/raspberry-pi-os.md/#install-using-the-repository) |
[Fedora](../../engine/install/fedora.md/#set-up-the-repository) | [Fedora](../../engine/install/fedora.md/#set-up-the-repository) |
[RHEL](../../engine/install/rhel.md/#set-up-the-repository) | [RHEL](../../engine/install/rhel.md/#set-up-the-repository) |
[SLES](../../engine/install/sles.md/#set-up-the-repository). [SLES](../../engine/install/sles.md/#set-up-the-repository).

View File

@ -89,47 +89,28 @@ You can install Docker Engine in different ways, depending on your needs:
### Install using the apt repository {#install-using-the-repository} ### Install using the apt repository {#install-using-the-repository}
Before you install Docker Engine for the first time on a new host machine, you Before you install Docker Engine for the first time on a new host machine, you
need to set up the Docker repository. Afterward, you can install and update need to set up the Docker Apt repository. Afterward, you can install and update
Docker from the repository. Docker from the repository.
#### Set up the repository 1. Set up Docker's Apt repository.
```bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL {{% param "download-url-base" %}}/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
1. Update the `apt` package index and install packages to allow `apt` to use a # Set up Docker's Apt repository:
repository over HTTPS: echo \
```console
$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg
```
2. Add Docker's official GPG key:
```console
$ sudo install -m 0755 -d /etc/apt/keyrings
$ curl -fsSL {{% param "download-url-base" %}}/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ sudo chmod a+r /etc/apt/keyrings/docker.gpg
```
3. Use the following command to set up the repository:
```console
$ echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] {{% param "download-url-base" %}} \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] {{% param "download-url-base" %}} \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
``` ```
4. Update the `apt` package index: 2. Install the Docker packages.
```console
$ sudo apt-get update
```
#### Install Docker Engine
1. Install Docker Engine, containerd, and Docker Compose.
{{< tabs >}} {{< tabs >}}
{{< tab name="Latest" >}} {{< tab name="Latest" >}}
@ -143,8 +124,8 @@ Docker from the repository.
{{< /tab >}} {{< /tab >}}
{{< tab name="Specific version" >}} {{< tab name="Specific version" >}}
To install a specific version of Docker Engine, start by listing the available To install a specific version of Docker Engine, start by listing the
versions in the repository: available versions in the repository:
```console ```console
# List the available versions: # List the available versions:
@ -152,7 +133,7 @@ Docker from the repository.
5:24.0.0-1~raspbian.11~bullseye 5:24.0.0-1~raspbian.11~bullseye
5:23.0.6-1~raspbian.11~bullseye 5:23.0.6-1~raspbian.11~bullseye
<...> ...
``` ```
Select the desired version and install: Select the desired version and install:
@ -165,8 +146,8 @@ Docker from the repository.
{{< /tab >}} {{< /tab >}}
{{< /tabs >}} {{< /tabs >}}
2. Verify that the Docker Engine installation is successful by running the 3. Verify that the installation is successful by running the `hello-world`
`hello-world` image: image:
```console ```console
$ sudo docker run hello-world $ sudo docker run hello-world
@ -181,9 +162,9 @@ You have now successfully installed and started Docker Engine.
#### Upgrade Docker Engine #### Upgrade Docker Engine
To upgrade Docker Engine, follow the To upgrade Docker Engine, follow step 2 of the
[installation instructions](#install-docker-engine), choosing the new version [installation instructions](#install-using-the-repository),
you want to install. choosing the new version you want to install.
### Install from a package ### Install from a package