保存版 Ubuntu16.04にDockerをインストールする簡単な方法docker-compose まで!

はてなブックマーク - 保存版 Ubuntu16.04にDockerをインストールする簡単な方法docker-compose まで!
LINEで送る
Pocket

Ubuntu16.04にDockerをインストールすると

妙に苦労しますね。

ここで一番簡単な方法をまとめました!

docker-composeまで!

目次

システムをアップデートしておく

sudo apt-get update
sudo apt-get upgrade

古いものを消す

古いのがあれば、削除する(ほとんどないですが、一応)

sudo apt-get remove docker docker-engine docker.io

ダウンロードの準備

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

Dockerをダウンロードする

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

確認

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) <[email protected]>
sub   4096R/F273FCD8 2017-02-22

repositoryを追加

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

インストール

sudo apt-get update
sudo apt-get install docker-ce

インストール結果を確認する

docker -v

Docker用グループ作成

sudo groupadd docker

追加

sudo usermod -aG docker $USER

これでOKです!

参考:https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository

https://docs.docker.com/compose/install/

簡単じゃない?

これは面倒臭い!簡単じゃないじゃん!!

と怒っている方は

こちらどうぞ!

一行で簡単Docker CEをインストールする

https://github.com/docker/docker-install

実行する前に、必ずスクリプトの内容を確認してください!

プロダクション環境の構築はこのスクリプトの利用は推奨しません!

最後docker-composeも入れましょう!

docker-composeダウンロード

sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

実行権限追加

sudo chmod +x /usr/local/bin/docker-compose

確認

docker-compose --version

これで

Ubuntuで快適なDocker生活ができますね!

では、また!

はてなブックマーク - 保存版 Ubuntu16.04にDockerをインストールする簡単な方法docker-compose まで!
LINEで送る
Pocket

Add a Comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close