Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ sudo apt-get update
$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common \
    qemu-user-static

Add repository(When using the apt-key command)

Add apt repository for Ubuntu provided by Docker to your system.

Add Docker official PGP key to your system.

Code Block
languagebash
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK

...

Code Block
languagebash
$ cat /etc/apt/sources.list
(Omitted)
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

Add repository(When not using the apt-key command)

Note

The apt-key command is scheduled to be deprecated, so an example of an alternative method is provided. Please consider alternative methods on your own. Also, if you have already created a Docker image in an environment using the apt-key command, it may not work properly unless you create it again from the Docker container. please note.

Add apt repository for Ubuntu provided by Docker to your system.

Create a keyrings directory in the /etc/apt directory in advance.

Code Block
$ mkdir /etc/apt/keyrings

Add Docker official PGP key to your system.

Code Block
$ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker-key.asc

Then, add Docker official apt repository to your system.

Code Block
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker-key.asc] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

 

Install Docker execution file

...