3
5

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-ceをインストールする

Posted at

目的

  • CentOSにdocker-ceをインストール
  • サービス起動設定

公式

手順

事前にdockerが入っている場合は削除する

[root@localhost ~]# sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

yumリポジトリを追加するために依存関係モジュールをインストール

[root@localhost ~]# sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

docker-ceをインストールできるようにするためyum追加

[root@localhost docker]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
読み込んだプラグイン:fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

docker-ceインストール(最新)

[root@localhost ~]# sudo yum install docker-ce

サービス起動

[root@localhost ~]# systemctl start docker

サービス自動起動設定

[root@localhost ~]# systemctl enable docker

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

[root@localhost ~]# docker --version
Docker version 18.06.1-ce, build e68fc7a
3
5
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
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?