いろいろやってみるにっき

てきとーに生きている奴の日記

古いエントリのサムネイル画像がリンク切れになってたりするけど、チマチマ修正中


ChromeOS Flex でDockerを起動する

まだLibreOfficeの日本語化が完全にうまくいった訳ではないが、Office OnlineやGoogle DocsGoogle Sheetsなどでドキュメント周りは問題ない。それよりもDockerのほうが優先度が高いということで、こちらを先に片付けることにした。

 

shigeo-t.hatenablog.com

 

手順を見つけた。

zenn.dev

 

順番に実行していく。まずは使用するコマンドのインストール。すでに済んでいるような気もするがとりあえず。

jsflightning2@penguin:~$ sudo apt install\
    apt-transport-https\
    ca-certificates\
    curl\
    gnupg\
    lsb-release
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了        
状態情報を読み取っています... 完了        
ca-certificates はすでに最新バージョン (20210119) です。
curl はすでに最新バージョン (7.74.0-1.3+deb11u3) です。
curl は手動でインストールしたと設定されました。
gnupg はすでに最新バージョン (2.2.27-2+deb11u2) です。
gnupg は手動でインストールしたと設定されました。
lsb-release はすでに最新バージョン (11.1.0) です。
lsb-release は手動でインストールしたと設定されました。
以下のパッケージが新たにインストールされます:
  apt-transport-https
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 1 個。
160 kB のアーカイブを取得する必要があります。
この操作後に追加で 166 kB のディスク容量が消費されます。
続行しますか? [Y/n] Y
取得:1 https://deb.debian.org/debian bullseye/main amd64 apt-transport-https all 2.2.4 [160 kB]
160 kB を 0秒 で取得しました (628 kB/s) 
以前に未選択のパッケージ apt-transport-https を選択しています。
(データベースを読み込んでいます ... 現在 82908 個のファイルとディレクトリがインストールされています。)
.../apt-transport-https_2.2.4_all.deb を展開する準備をしています ...
apt-transport-https (2.2.4) を展開しています...
apt-transport-https (2.2.4) を設定しています ...
jsflightning2@penguin:~$ 

 

続いてcurlでdockerのファイルを持ってくる。

jsflightning2@penguin:~$ curl -fsSL https://download.docker.com/linux/debian/gpg |sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
jsflightning2@penguin:~$ 

 

上のエントリをコピペで実行するとエラーになるので、元のエントリからコピペ。

docs.docker.com

これなら問題なく通る。

jsflightning2@penguin:~$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
jsflightning2@penguin:~$ 

 

apt update で鍵のエラーになるがとりあえず通る。でも、sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin を実行すると、なんかエラーになる。

jsflightning2@penguin:~$ sudo apt update -y
取得:1 https://download.docker.com/linux/debian bullseye InRelease [43.3 kB]
ヒット:2 http://packages.microsoft.com/repos/code stable InRelease              
ヒット:3 https://deb.debian.org/debian bullseye InRelease                       
ヒット:4 https://deb.debian.org/debian bullseye-updates InRelease               
ヒット:5 https://deb.debian.org/debian-security bullseye-security InRelease
無視:6 https://storage.googleapis.com/cros-packages/105 bullseye InRelease
エラー:1 https://download.docker.com/linux/debian bullseye InRelease
  公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 7EA0A9C3F273FCD8
ヒット:7 https://storage.googleapis.com/cros-packages/105 bullseye Release
パッケージリストを読み込んでいます... 完了
W: GPG エラー: https://download.docker.com/linux/debian bullseye InRelease: 公開: NO_PUBKEY 7EA0A9C3F273FCD8
E: リポジトリ https://download.docker.com/linux/debian bullseye InRelease は署名
N: このようなリポジトリから更新を安全に行うことができないので、デフォルトでは更新が無効になっています。
N: リポジトリの作成とユーザ設定の詳細は、apt-secure(8) man ページを参照してください。
jsflightning2@penguin:~$ 
jsflightning2@penguin:~$ 
jsflightning2@penguin:~$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了        
状態情報を読み取っています... 完了        
パッケージ docker-ce は使用できませんが、別のパッケージから参照されます。
これは、パッケージが欠落しているか、廃止されたか、または別のソース
からのみ利用可能であることを意味します。

パッケージ docker-ce-cli は使用できませんが、別のパッケージから参照されます。
これは、パッケージが欠落しているか、廃止されたか、または別のソース
からのみ利用可能であることを意味します。

E: パッケージ 'docker-ce' にはインストール候補がありません
E: パッケージ 'docker-ce-cli' にはインストール候補がありません
E: パッケージ containerd.io が見つかりません
E: 'containerd.io' に一致するパッケージは見つかりませんでした
E: 正規表現 'containerd.io' ではパッケージは見つかりませんでした
E: パッケージ docker-compose-plugin が見つかりません
jsflightning2@penguin:~$ 

 

そこで別の手順をやってみる。

www.digitalocean.com

 

こちらは通った。

jsflightning2@penguin:~$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了        
状態情報を読み取っています... 完了        
apt-transport-https はすでに最新バージョン (2.2.4) です。
ca-certificates はすでに最新バージョン (20210119) です。
curl はすでに最新バージョン (7.74.0-1.3+deb11u3) です。
以下の追加パッケージがインストールされます:
  python3-distro-info python3-pycurl python3-software-properties
  unattended-upgrades
提案パッケージ:
  libcurl4-gnutls-dev python-pycurl-doc python3-pycurl-dbg bsd-mailx
  default-mta | mail-transport-agent needrestart powermgmt-base
以下のパッケージが新たにインストールされます:
  python3-distro-info python3-pycurl python3-software-properties
  software-properties-common unattended-upgrades
アップグレード: 0 個、新規インストール: 5 個、削除: 0 個、保留: 2 個。
299 kB のアーカイブを取得する必要があります。
この操作後に追加で 1,154 kB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 https://deb.debian.org/debian bullseye/main amd64 python3-distro-info all 1.0 [8,720 B]
取得:2 https://deb.debian.org/debian bullseye/main amd64 python3-pycurl amd64 7.43.0.6-5 [68.8 kB]
取得:3 https://deb.debian.org/debian bullseye/main amd64 python3-software-properties all 0.96.20.2-2.1 [49.7 kB]
取得:4 https://deb.debian.org/debian bullseye/main amd64 software-properties-common all 0.96.20.2-2.1 [83.4 kB]
取得:5 https://deb.debian.org/debian bullseye/main amd64 unattended-upgrades all 2.8 [88.6 kB]
299 kB を 0秒 で取得しました (1,190 kB/s) 
パッケージを事前設定しています ...
以前に未選択のパッケージ python3-distro-info を選択しています。
(データベースを読み込んでいます ... 現在 82912 個のファイルとディレクトリがインストールされています。)
.../python3-distro-info_1.0_all.deb を展開する準備をしています ...
python3-distro-info (1.0) を展開しています...
以前に未選択のパッケージ python3-pycurl を選択しています。
.../python3-pycurl_7.43.0.6-5_amd64.deb を展開する準備をしています ...
python3-pycurl (7.43.0.6-5) を展開しています...
以前に未選択のパッケージ python3-software-properties を選択しています。
.../python3-software-properties_0.96.20.2-2.1_all.deb を展開する準備をしています ...
python3-software-properties (0.96.20.2-2.1) を展開しています...
以前に未選択のパッケージ software-properties-common を選択しています。
.../software-properties-common_0.96.20.2-2.1_all.deb を展開する準備をしています ...
software-properties-common (0.96.20.2-2.1) を展開しています...
以前に未選択のパッケージ unattended-upgrades を選択しています。
.../unattended-upgrades_2.8_all.deb を展開する準備をしています ...
unattended-upgrades (2.8) を展開しています...
python3-pycurl (7.43.0.6-5) を設定しています ...
python3-software-properties (0.96.20.2-2.1) を設定しています ...
python3-distro-info (1.0) を設定しています ...
software-properties-common (0.96.20.2-2.1) を設定しています ...
unattended-upgrades (2.8) を設定しています ...

Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version

Creating config file /etc/apt/apt.conf.d/50unattended-upgrades with new version
Created symlink /etc/systemd/system/multi-user.target.wants/unattended-upgrades.service → /lib/systemd/system/unattended-upgrades.service.
Synchronizing state of unattended-upgrades.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable unattended-upgrades
man-db (2.9.4-2) のトリガを処理しています ...
dbus (1.12.24-0+deb11u1) のトリガを処理しています ...
jsflightning2@penguin:~$ 

 

curlの実行。

jsflightning2@penguin:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
jsflightning2@penguin:~$

 

sudo add-apt-repository も問題ない。

jsflightning2@penguin:~$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
jsflightning2@penguin:~$ 

 

apt update で鍵のエラーになるがとりあえず通る。

jsflightning2@penguin:~$ sudo apt update -y
ヒット:1 https://deb.debian.org/debian bullseye InRelease
ヒット:2 https://deb.debian.org/debian bullseye-updates InRelease               
ヒット:3 https://deb.debian.org/debian-security bullseye-security InRelease     
取得:4 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]       
取得:5 https://download.docker.com/linux/debian bullseye InRelease [43.3 kB]    
ヒット:6 http://packages.microsoft.com/repos/code stable InRelease              
無視:7 https://storage.googleapis.com/cros-packages/105 bullseye InRelease
ヒット:8 https://storage.googleapis.com/cros-packages/105 bullseye Release
取得:9 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [18.5 kB]
エラー:5 https://download.docker.com/linux/debian bullseye InRelease
  公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 7EA0A9C3F273FCD8
パッケージリストを読み込んでいます... 完了
W: GPG エラー: https://download.docker.com/linux/debian bullseye InRelease: 公開: NO_PUBKEY 7EA0A9C3F273FCD8
E: リポジトリ https://download.docker.com/linux/debian bullseye InRelease は署名
N: このようなリポジトリから更新を安全に行うことができないので、デフォルトでは更新が無効になっています。
N: リポジトリの作成とユーザ設定の詳細は、apt-secure(8) man ページを参照してください。
jsflightning2@penguin:~$

 

apt-cache policy docker-ce を実行。

jsflightning2@penguin:~$ apt-cache policy docker-ce
docker-ce:
  インストールされているバージョン: (なし)
  候補:               5:20.10.18~3-0~ubuntu-focal
  バージョンテーブル:
     5:20.10.18~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.17~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.16~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.15~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.14~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.13~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.12~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.11~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.10~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.9~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.8~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.7~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.6~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.5~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.4~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.3~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.2~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.1~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:20.10.0~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:19.03.15~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:19.03.14~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:19.03.13~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:19.03.12~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:19.03.11~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:19.03.10~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
     5:19.03.9~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
jsflightning2@penguin:~$ 

 

インストール実行。問題ない。

jsflightning2@penguin:~$ sudo apt install docker-ce
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了        
状態情報を読み取っています... 完了        
以下の追加パッケージがインストールされます:
  containerd.io docker-ce-cli docker-ce-rootless-extras docker-scan-plugin
  libslirp0 pigz slirp4netns
提案パッケージ:
  aufs-tools cgroupfs-mount | cgroup-lite
以下のパッケージが新たにインストールされます:
  containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras
  docker-scan-plugin libslirp0 pigz slirp4netns
アップグレード: 0 個、新規インストール: 8 個、削除: 0 個、保留: 2 個。
102 MB のアーカイブを取得する必要があります。
この操作後に追加で 397 MB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.6.8-1 [28.1 MB]
取得:2 https://deb.debian.org/debian bullseye/main amd64 pigz amd64 2.6-1 [64.0 kB]
取得:3 https://deb.debian.org/debian bullseye/main amd64 libslirp0 amd64 4.4.0-1+deb11u2 [57.9 kB]
取得:4 https://deb.debian.org/debian bullseye/main amd64 slirp4netns amd64 1.0.1-2 [33.4 kB]
取得:5 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-cli amd64 5:20.10.18~3-0~ubuntu-focal [41.5 MB]
取得:6 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce amd64 5:20.10.18~3-0~ubuntu-focal [20.4 MB]
取得:7 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-rootless-extras amd64 5:20.10.18~3-0~ubuntu-focal [8,392 kB]
取得:8 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-scan-plugin amd64 0.17.0~ubuntu-focal [3,521 kB]
102 MB を 11秒 で取得しました (9,223 kB/s)                                      
以前に未選択のパッケージ pigz を選択しています。
(データベースを読み込んでいます ... 現在 83083 個のファイルとディレクトリがインストールされています。)
.../0-pigz_2.6-1_amd64.deb を展開する準備をしています ...
pigz (2.6-1) を展開しています...
以前に未選択のパッケージ containerd.io を選択しています。
.../1-containerd.io_1.6.8-1_amd64.deb を展開する準備をしています ...
containerd.io (1.6.8-1) を展開しています...
以前に未選択のパッケージ docker-ce-cli を選択しています。
.../2-docker-ce-cli_5%3a20.10.18~3-0~ubuntu-focal_amd64.deb を展開する準備をして ...
docker-ce-cli (5:20.10.18~3-0~ubuntu-focal) を展開しています...
以前に未選択のパッケージ docker-ce を選択しています。
.../3-docker-ce_5%3a20.10.18~3-0~ubuntu-focal_amd64.deb を展開する準備をしていま ...
docker-ce (5:20.10.18~3-0~ubuntu-focal) を展開しています...
以前に未選択のパッケージ docker-ce-rootless-extras を選択しています。
.../4-docker-ce-rootless-extras_5%3a20.10.18~3-0~ubuntu-focal_amd64.deb を展開す ...
docker-ce-rootless-extras (5:20.10.18~3-0~ubuntu-focal) を展開しています...
以前に未選択のパッケージ docker-scan-plugin を選択しています。
.../5-docker-scan-plugin_0.17.0~ubuntu-focal_amd64.deb を展開する準備をしています ...
docker-scan-plugin (0.17.0~ubuntu-focal) を展開しています...
以前に未選択のパッケージ libslirp0:amd64 を選択しています。
.../6-libslirp0_4.4.0-1+deb11u2_amd64.deb を展開する準備をしています ...
libslirp0:amd64 (4.4.0-1+deb11u2) を展開しています...
以前に未選択のパッケージ slirp4netns を選択しています。
.../7-slirp4netns_1.0.1-2_amd64.deb を展開する準備をしています ...
slirp4netns (1.0.1-2) を展開しています...
docker-scan-plugin (0.17.0~ubuntu-focal) を設定しています ...
containerd.io (1.6.8-1) を設定しています ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
docker-ce-cli (5:20.10.18~3-0~ubuntu-focal) を設定しています ...
libslirp0:amd64 (4.4.0-1+deb11u2) を設定しています ...
pigz (2.6-1) を設定しています ...
docker-ce-rootless-extras (5:20.10.18~3-0~ubuntu-focal) を設定しています ...
slirp4netns (1.0.1-2) を設定しています ...
docker-ce (5:20.10.18~3-0~ubuntu-focal) を設定しています ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
man-db (2.9.4-2) のトリガを処理しています ...
libc-bin (2.31-13+deb11u4) のトリガを処理しています ...
jsflightning2@penguin:~$ 

 

dockerコマンドはインストールされている。hello-worldも動いた。

jsflightning2@penguin:~$ docker -v
Docker version 20.10.18, build b40c2f6
jsflightning2@penguin:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:62af9efd515a25f84961b70f973a798d2eca956b1b2b026d0a4a63a3b0b6a3f2
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

 

ということで、とりあえずDockerのインストールは引っ掛かりながらも完了。

 

過去の関連エントリ。

 

shigeo-t.hatenablog.com

shigeo-t.hatenablog.com

shigeo-t.hatenablog.com

shigeo-t.hatenablog.com

shigeo-t.hatenablog.com

shigeo-t.hatenablog.com

お時間あったら、他のエントリもクリックして頂ければ幸いです。