LinuxMint19にDocker CEをインストールしてみます。
Ubuntuへのインストール方法を書いていただいている方がたくさんあるのであまりハマりどころはないのですが、注意点はリポジトリの設定のところです。
まず、レポジトリ設定の前の部分まで。
$ sudo apt-get update $ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common $ 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 [ 不明 ] Docker Release (CE deb) <docker@docker.com> sub rsa4096 2017-02-22 [S]
リポジトリの設定のところはUbuntuと同じ方法のままでは後でエラーになります。このためUbuntuの場合と異なる作業になります。
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
[2019/9/16追記]
LinuxMint 19.2 LTSではエラーになるようです。/etc/apt/sources.list.d/additional-repositories.list に以下の内容を記述して対応できるようです。
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
[2022/05/26追記]
LinuxMint20 の場合は、
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
となります。
あとはUbuntuと同じ作業です。
$ sudo apt-get update $ sudo apt-get install -y docker-ce docker-ce-cli containerd.io $ docker version Client: Version: 18.09.5 API version: 1.39 Go version: go1.10.8 Git commit: e8ff056 Built: Thu Apr 11 04:43:57 2019 OS/Arch: linux/amd64 Experimental: false Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/version: dial unix /var/run/docker.sock: connect: permission denied $ sudo usermod -aG docker ${USER}
最後のは一般ユーザーでdockerを実行するために必要なグループ設定です。一旦ログアウトしてログインし直します。
$ docker version Client: Version: 18.09.5 API version: 1.39 Go version: go1.10.8 Git commit: e8ff056 Built: Thu Apr 11 04:43:57 2019 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 18.09.5 API version: 1.39 (minimum version 1.12) Go version: go1.10.8 Git commit: e8ff056 Built: Thu Apr 11 04:10:53 2019 OS/Arch: linux/amd64 Experimental: false
こちらの記事を参考にさせていただき、hello-word コンテナで試してみました。
~$ mkdir docker ~$ cd docker/ ~/docker$ ls -la 合計 8 drwxrwxr-x 2 xxx xxx 4096 4月 20 03:23 . drwxr-xr-x 44 xxx xxx 4096 4月 20 03:23 .. ~/docker$ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:92695bc579f31df7a63da6922075d0666e565ceccad16b59c3374d2cf4e8e50e 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. 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/ ~/docker$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest fce289e99eb9 3 months ago 1.84kB ~/docker$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ~/docker$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b92f58de7250 hello-world "/hello" About a minute ago Exited (0) About a minute ago suspicious_tesla ~/docker$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b92f58de7250 hello-world "/hello" 2 minutes ago Exited (0) 2 minutes ago suspicious_tesla ~/docker$ docker rm b92f58de7250 b92f58de7250 ~/docker$ docker rmi hello-world Untagged: hello-world:latest Untagged: hello-world@sha256:92695bc579f31df7a63da6922075d0666e565ceccad16b59c3374d2cf4e8e50e Deleted: sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e Deleted: sha256:af0b15c8625bb1938f1d7b17081031f649fd14e6b233688eea3c5483994a66a3 ~/docker$