LoginSignup
10
6

More than 1 year has passed since last update.

最新の docker のインストール (Ubuntu 20.04 および Ubuntu 20.10)

Last updated at Posted at 2021-01-04

最新の docker のインストール (ubuntu 20.04 および ubuntu 20.10)

ubuntu 20.04 で docker をインストールする で紹介した方法では、ubuntu が提供している apt リポジトリを使用するのでインストールされる docker のバージョンが古いです。(2021/1/4 時点で Docker version 19.03.8, build afacb8b7f0)
ubuntu 19.10 への docker のインストール で紹介した方法を使うと、最新の docker をインストールできます。

しかし、 https://manpages.debian.org/unstable/apt/apt-key.8.ja.html によると
apt-key(8) will last be available in Debian 11 and Ubuntu 22.04. となっており、apt-key を使う方法は Ubuntu 22.04 で最後になります。

https://github.com/docker/docker.github.io/blob/master/engine/install/ubuntu.md に記載されています。
(https://github.com/docker/docker.github.io/pull/11990apt-key を使わない方法が docker の公式ドキュメントに取り込まれました)

docker インストール済みの場合に docker をアンインストール

sudo apt-get remove docker docker-engine docker.io containerd runc

最新版の docker インストール

sudo apt-get update
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
   sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io

add-apt-repository を使用しないので software-properties-common のインストールは不要。

$ docker --version
Docker version 20.10.9, build c2ea9bc

参考ページ

10
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
6