16
20

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(docker-engine or docker-ce), docker-composeのインストール

Last updated at Posted at 2016-11-08

概要

dockerとdocker-composeのインストール手順

環境

  • CentOS 7.1
  • docker-engine (Docker 1.12.3)
  • docker-compose 1.15.0

以下のいずれかを実行してdockerをインストールする。docker-ceを推奨。

docker-engineのインストール

こちらの手順でなく、#docker-ceのインストールを推奨

レポジトリの追加

$ sudo vi /etc/yum.repos.d/docker.repo

[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

install docker-engine

$ sudo yum install -y docker-engine

docker起動

$ sudo systemctl start docker
$ sudo systemctl enable docker

docker-ceのインストール

依存関係インストール

$ sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

docker.repo追加

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

docker-ceインストール

$ sudo yum install -y docker-ce

docker起動

$ sudo systemctl start docker
$ sudo systemctl enable docker

docker-composeのインストール

$ curl -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)" > docker-compose

$ sudo mv docker-compose /usr/bin/
$ sudo chmod +x /usr/bin/docker-compose

インストールされたか確認

$ docker-compose --version
 docker-compose version: 1.15.0

dockerをroot以外でも起動できるようにする

$ sudo usermod -g docker vagrant

[参考]
そろそろDockerを始めないとやばいと思い始めたあなたへ

16
20
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
16
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?