CentOS 7 docker system installation and assembly docker Compose

Overview

This chapter details the CentOS7.0 how to install the system Docker , installation is divided into online and offline installation in two parts. Currently, CentOS only support kernel release of Docker . Recommended CentOS 7.0 or later, 64- bit operating system, kernel version 3.10 or higher.

-line installation Docker

1) First check CentOS version is required. Do not meet the requirements version, please upgrade the system version

cat /etc/redhat-release

2) install dependencies

yum install -y yum-utils device-mapper-persistent-data lvm2

3) add the software source information

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

4) update yum cache

yum makecache fast

5) Installation Docker-CE

yum -y install docker-ce

6) Start docker background service

systemctl start docker

7) check docker whether the installation is successful

docker version

8) Installation docker-compose

curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

9) Fu execute permissions

chmod +x /usr/local/bin/docker-compose

10) check docker-compose the installation was successful

docker-compose version

12 ) Set docker service boot from the start

systemctl enable docker

offline installation Docker

1) Get docker offline installation package, the form centos-local.tgz compressed. (Please contact me get)

2) offline package uploaded to the server's root directory

3) into the root directory, unzip .tgz package

cd /root
tar -xvzf centos-local.tgz

4) Installation createrepo

cd /root/docker-ce-local
rpm -ivh createrepo-0.9.9-28.el7.noarch.rpm

5) Add docker-ce-local.repo source file, writes the following

we / etc / yum .repos.d / docker-ce local.repo

[docker-ce-local]

  name=Local Yum

  baseurl = file: /// root / docker-ce-local /

  gpgcheck=1

  gpgkey=file:///root/docker-ce-local/gpg

  enabled=1

6 ) generation source index and cache

createrepo /root/docker-ce-local
yum makecache

7 ) Installation docker-ce

yum  install docker it

8) Start and test

systemctl start docker
docker version

9) added boot from Kai

systemctl enable docker

10) Installation docker-compose

cp /root/docker-ce-local/docker-compose /usr/bin/

11) Fu execute permissions

chmod +x /usr/bin/docker-compose

12) Verify the version

docker-compose version

 

Guess you like

Origin www.cnblogs.com/relustarry/p/12366642.html
Recommended