1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu20.04にて、Dockerをインストールする

Last updated at Posted at 2021-11-15

はじめに

dockerをインストールするまでの道のり。
Image from iOS-2.jpg

最終更新日

2021年11月15日

環境の情報

OS
Ubuntu20.04

注意

最新の状態を確認して下さい。

OSのバージョンによって動きが異なるようなので、よく確認して下さい。

Ubuntu 16.04 LTS “Xenial Xerus” end-of-life

Ubuntu Linux 16.04 LTS reached the end of its five-year 
LTS window on April 30th 2021 and is no longer supported. 
Docker no longer releases packages for this distribution (including patch- and security releases). 
Users running Docker on Ubuntu 16.04 are recommended to update their system 
to a currently supported LTS version of Ubuntu.

Ubuntu 16.04LTS「XenialXerus」のサポート終了
Ubuntu Linux 16.04 LTSは、2021年4月30日に5年間のLTSウィンドウの終わりに達し、サポートされなくなりました。 
Dockerは、このディストリビューションのパッケージをリリースしなくなりました(パッチリリースとセキュリティリリースを含む)。 Ubuntu 16.04でDockerを実行しているユーザーは、
システムを現在サポートされているLTSバージョンのUbuntuに更新することをお勧めします。

公式はこちら

https://docs.docker.com/
https://docs.docker.com/engine/install/ubuntu/
https://docs.docker.com/get-docker/
https://docs.docker.com/engine/install/

参考さま

公式さま確認

Screenshot from 2021-11-15 15-10-21.png

Screenshot from 2021-11-15 15-11-46.png

行っていく

aptで行ったりすると、パッケージがなかったりします。
公式DockerリポジトリのGPGキーを追加してインストールしました。

$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
ca-certificates はすでに最新バージョン (20210119~20.04.2) です。
curl はすでに最新バージョン (7.68.0-1ubuntu2.7) です。
software-properties-common はすでに最新バージョン (0.99.9.8) です。
apt-transport-https はすでに最新バージョン (2.0.6) です。
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
  shim
これを削除するには 'sudo apt autoremove' を利用してください。
アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 5 個。
N: ディレクトリ '/etc/apt/sources.list.d/' の 'elastic-7.x.lis' が無効なファイル名拡張子を持っているため、無視します

色々取ってくる。

$ curl -fsSL -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
[sudo] user のパスワード: 
OK

OK

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
ヒット:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
取得:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]        
ヒット:11 https://packagecloud.io/AtomEditor/atom/any any InRelease            
328 kB を 1秒 で取得しました (233 kB/s)                           
パッケージリストを読み込んでいます... 完了
N: ディレクトリ '/etc/apt/sources.list.d/' の 'elastic-7.x.lis' が無効なファイル名拡張子を持っているため、無視します
W: ターゲット Packages (stable/binary-amd64/Packages) は /etc/apt/sources.list:58 と /etc/apt/sources.list.d/docker.list:1 で複数回設定されています
W: 署名照合中にエラーが発生しました。リポジトリは更新されず、過去のインデックスファイルが使われます。GPG エラー: https://dl.yarnpkg.com/debian stable InRelease: 以下の署名が無効です: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx>
W: https://dl.yarnpkg.com/debian/dists/stable/InRelease の取得に失敗しました  以下の署名が無効です: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx>
W: いくつかのインデックスファイルのダウンロードに失敗しました。これらは無視されるか、古いものが代わりに使われます。
W: ターゲット Packages (stable/binary-amd64/Packages) は /etc/apt/sources.list:58 と /etc/apt/sources.list.d/docker.list:1 で複数回設定されています
なんか色々

このようにする。

$ apt-cache policy docker-ce
docker-ce:
  インストールされているバージョン: (なし)
  候補:               5:20.10.10~3-0~ubuntu-focal
  バージョンテーブル:
     5:20.10.10~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
なんか色々
N: ディレクトリ '/etc/apt/sources.list.d/' の 'elastic-7.x.lis' が無効なファイル名拡張子を持っているため、無視します
$ sudo apt install docker-ce
[sudo] user のパスワード: 
パッケージリストを読み込んでいます... 完了
なんか色々
N: ディレクトリ '/etc/apt/sources.list.d/' の 'elastic-7.x.lis' が無効なファイル名拡張子を持っているため、無視します
続行しますか? [Y/n] y
systemd (245.4-4ubuntu3.13) のトリガを処理しています ...

確認

$ sudo systemctl status docker
[sudo] user のパスワード: 
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset>
     Active: active (running) since Mon 2021-11-15 15:46:49 JST; 1min 21s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 24852 (dockerd)
      Tasks: 9
     Memory: 29.2M
     CGroup: /system.slice/docker.service
             └─24852 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/con>

11月 15 15:46:48 user dockerd[24852]: time="2021-11-15T15:46:4>
lines 1-21/21 (END)

ドッカ−.png
起動していれば問題ないです( ・ิω・ิ)

1
1
1

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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?