38
41

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 5 years have passed since last update.

Debian 9 にDocker, Docker Composeをインストールする

Last updated at Posted at 2017-09-26

記録するほどの事ではないですが、メモ書きとして

環境

  • OS
    • Debian 9/amd64
    • SSHサーバとシステムユーティリティのみをインストール

https://docs.docker.com/engine/installation/linux/docker-ce/debian/
このページ通りにやると出来るんだけど、sudoが入ってないので、先に入れる

前準備

# apt-get install sudo

visudoを実行し、ログインしているユーザにsudoの権限を与える

# visudo

tatsuya ALL=(ALL:ALL) ALL

Dockerの導入

$ sudo apt-get remove docker docker-engine docker.io
$ sudo apt-get update
$ sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     software-properties-common
$ sudo curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -

KeyのFingerPrintが下記と一致していることを確認する

$ sudo apt-key fingerprint 0EBFCD88

pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) <docker@docker.com>
sub   4096R/F273FCD8 2017-02-22
$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
   $(lsb_release -cs) \
   stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce

下記コマンドで、HelloWorld出来れば成功

$ sudo docker run hello-world

Docker Composeの導入

https://docs.docker.com/compose/install/#install-compose
これもこのページの通り

$ sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose --version
docker-compose version 1.16.1, build 1719ceb
38
41
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
38
41

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?