以前に Ubuntu 16.x に Docker & Docker Compose をインストールする というメモを書きました。 CentOS7 へ Docker Community Edition をインストールするには Get Docker for CentOS に従うだけで、特に工夫することも無く簡単にインストール出来ました。
Docker のインストール
インストールの流れは以下の通りです。
具体的には以下のように実行します。 yum-config-manager
は yum-utils
に含まれているので、予めインストールしておきます。
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum -y install docker-ce systemctl enable docker.service systemctl start docker.service
現時点では以下がインストールされました。
# yum info docker-ce Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp Installed Packages Name : docker-ce Arch : x86_64 Version : 17.03.0.ce Release : 1.el7.centos Size : 65 M Repo : installed From repo : docker-ce-stable Summary : The open-source application container engine URL : https://dockerproject.org License : ASL 2.0 Description : Docker is an open source project to build, ship and run any application as a : lightweight container. : : Docker containers are both hardware-agnostic and platform-agnostic. This means : they can run anywhere, from your laptop to the largest EC2 compute instance and : everything in between - and they don't require you to use a particular : language, framework or packaging system. That makes them great building blocks : for deploying and scaling web apps, databases, and backend services without : depending on a particular stack or provider.
Docker Compose のインストール
Docker Compose をインストールします。
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod 755 /usr/local/bin/docker-compose
バージョンは 1.11.2
がインストールされました。
# docker-compose --version
docker-compose version 1.11.2, build dfed245