Help us understand the problem. What is going on with this article?

docker(docker-engine or docker-ce), docker-composeのインストール

概要

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を始めないとやばいと思い始めたあなたへ

Esfahan
WEB系出身。現在はビッグデータの基盤構築、ETLなどがメイン。 / YouTubeで料理チャンネルやってます → https://www.youtube.com/channel/UCDnYBh2TtUAfQ0Z-tl0jTyw
https://www.youtube.com/channel/UCDnYBh2TtUAfQ0Z-tl0jTyw
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした