導入環境
毎度の事、私のChromebookはコレ一台のみ
項目 | 内容 |
---|---|
メーカー | acer |
機種 | Spin 311 |
CPU | MediaTek M8183C 2.0GHz |
メモリ | 4GB |
ストレージ | eMMC 32GB |
アーキテクチャはarm。
この上なく親切な公式サイト
何事にも躓く私ですが、今回はすんなりインストールできました。公式サイトはこちら。
Install Docker Engine
公式サイトのすごいところは、インストール環境ごとパターン訳して解説ページを用意しているところです。Windowsやmacはもちろん、Linuxに至っては下記画像に上がっている文だけのページが用意されています。
ChromebookのLinux環境はDebianなのですが、「Debianにインストールする場合」について書かれているページももちろん用意されています。
間違いなく、公式サイトが親切だから躓かなかったのだと思います。
公式サイトに従うと...
何よりもまずUpdateしておく
sudo apt update
1. 関係あるパッケージを先行してインストール
公式HPによるとca-certificates
、curl
、gnupg
、lsb-release
をインストールする必要があります。が、私の場合はlsb-release
以外はインストール済みでした。
sudo apt install ca-certificates sudo apt install curl sudo apt install gnupg sudo apt install lsb-release
2. DockerのGPG keyを追加する
sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
3. リポジトリのセットアップ
ながーいから誤打しそう。
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
4. Dockerのインストール
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
以上!インストール完了してるかどうかはsudo docker run hello-world
を実行して確認できます。次のように表示されるはずです。
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. (arm64v8) 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.
コマンド備忘録
Command | Note |
---|---|
docker version | バージョンを確認 |
docker ps | コンテナ情報一覧表示(動作中のみ) |
docker ps -a | コンテナ情報一覧表示(停止中含め) |
docker images | 保持しているDockerイメージ一覧 |
docker pull <イメージ名> | イメージを取得(docker hubにあるもの) |
docker run <イメージ名> | イメージをもとにコンテナを起動 |
docker start | すでに存在するコンテナを起動 |