LoginSignup
3
1

More than 5 years have passed since last update.

Docker と Docker Compose をインストールする(Centos7.2)

Last updated at Posted at 2016-12-11

Docker と Docker Compose のインストール手順

Dockerインストール

yumアップデート

yum -y update

Dockerインストール

curl -sSL https://get.docker.com/ | sh

[参考サイト]https://get.docker.com/

自動起動設定・サービス開始

systemctl enable docker.service
systemctl start docker.service

プロキシ設定

プロキシ配下の環境の場合は以下の設定を行う。

mkdir /etc/systemd/system/docker.service.d; cd $_
vi http-proxy.conf

http-proxy.confの内容は以下の通り。

[Service]
Environment="HTTP_PROXY=http://192.168.X.X:8080"
systemctl daemon-reload
systemctl restart docker
systemctl show --property=Environment docker

以下のように表示される。

Environment=HTTP_PROXY=http://192.168.X.X:8080

Docker Composeインストール

curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
docker-compose version 1.9.0, build 2585387

[参考サイト]
https://docs.docker.com/compose/install/

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