2
4

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.

dockerインストール手順備忘録 on ubuntu in vagrant

Posted at

ubuntuのvagrantを用意

boxが無い場合は追加

$ vagrant box add ubuntu/trusty64

作業用ディレクトリ作って入って

$ vagrant init ubuntu/trusty64 && vagrant up

vagrant のubuntuに入る

$ vagrant ssh

dockerをインストールする準備(CE版)

dockerに必要なの入れる

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

docker 公式GPG鍵を追加

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

※これでdockerのgpg鍵が入ってるのが確認できる

$ sudo apt-key fingerprint 0EBFCD88

アーキテクチャを確認

$ dpkg --print-architecture

amd64なら

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

armhfなら

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

いよいよdockerをインストールする

パッケージをアップデート

$ sudo apt-get update

dockerをインストール

$ sudo apt-get install docker-ce

※本番環境では、これでバージョンを指定できる

sudo apt-get install docker-ce=<VERSION>

これで確認

sudo docker run hello-world

うまくいけば
Hello from Docker!

みたいなのが出るはず。

2
4
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
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?