3
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.

ARM 上でdocker を動かしてみる

Last updated at Posted at 2019-12-06

ARM でdockerを動かしたり何たりします。

AWSで、ARMのインスタンスが割と安くつかえるようですので、
他の方の記事と内容がおそらく被りますが、今回は簡単にdockerを動かしてみました。

ARMの場合リポジトリが変わる点が注意でしょうか。
色々記事はありますが、公式ページの情報を見たほうが確実です。

まず必要なパッケージを入れます。

sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common

gpgキーの設定などします。ここまでは他のアーキテクチャでも同様です。

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
    
pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

リポジトリだけ変更をします。

$ sudo add-apt-repository \
   "deb [arch=arm64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
$ sudo apt update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

はい、入りました。
後はバージョンの確認と軽い動作確認をしてみます。
別のリポジトリを間違って設定してしまった場合は、/etc/apt/sources.list の編集と
/etc/apt/sources.list.save の削除などを行い、再度手順を実行すれば動くかと思います。

$ sudo docker --version
Docker version 19.03.5, build 633a0ea
$ 
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
3b4173355427: Pull complete 
Digest: sha256:4df8ca8a7e309c256d60d7971ea14c27672fc0d10c5f303856d7bc48f8cc17ff
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.
    (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.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
$ 

arm64v8 版のHello worldが動いたようです。
あとはubuntu のイメージをpullしてみます。

$ docker run -it ubuntu bash
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
$ 
$ sudo docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
6531af355894: Pull complete 
82f7942d2fb7: Pull complete 
fdce94e690d5: Pull complete 
a96a89ada1c3: Pull complete 
Digest: sha256:6e9f67fa63b0323e9a1e587fd71c561ba48a034504fb804fd26fd8800039835d
Status: Downloaded newer image for ubuntu:latest

matplotの様にインストールにかなり時間がかかるということはなく、さっくりと導入できました。
お手軽ですね。

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