1
2

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.

centos7 に docker と docker-compose 入れる

Posted at

忘れないように、自分のdockerでの環境構築をまとめておく

コマンドの説明(なぜこうしてるか)などは気が向いた時に書き足すかも

# すでに入ってるものをアンインストール
sudo yum remove docker docker-common docker-selinux docker-engine
# 依存関係のインストール
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# レポジトリ追加
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# インストール
sudo yum install docker-ce
# 起動
sudo systemctl start docker
# 自動起動
sudo systemctl enable docker

# dockerグループがなければ作る
sudo groupadd docker
# 現行ユーザをdockerグループに所属させる
sudo gpasswd -a $USER docker
# dockerデーモンを再起動する
sudo systemctl restart docker
# exitして再ログインすると反映される。
exit

# docker-composeインストール
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
# 権限付与
sudo chmod +x /usr/bin/docker-compose

# bash_completion インストール
sudo yum install -y bash-completion

# docker-compose bash-completion インストール
sudo curl -L https://raw.githubusercontent.com/docker/compose/1.18.0/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose

Refs

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?