Description
This article describes how to install the deployment Docker environment on a CentOS7 system, which is referenced Docker official documentation as follows:
https://docs.docker.com/engine/installation/centos/
Deploy Docker environment on CENTOS7 system
1 CentOS7 Installation (abbreviated)
2 Upgrade System
Yum Update
The system needs to be restarted after the upgrade is complete.
3 Add Docker Yum source
Execute the following command:
Cat >/etc/yum.repos.d/docker.repo
name=docker
Repository baseurl=https://yum.dockerproject.org/repo/ MAIN/CENTOS/7
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
4 Installing Docker Packages
Yum Install Docker-engine
5 Start Docker Service
Service Docker start
6 test run under Hello-world mirroring
Docker Run Hello-world
7 View Docker Information
Use the Docker Info command to refer to the system, Docker details:
Docker info containers:3 images:2 Server version:1.9.0 Storage driver:devicemapper Pool name:docker-253:0-202597120- Pool Pool blocksize:65.54 KB Base Device size:107.4 GB backing filesystem:xfs Data file:/dev/loop2 Metadata file:/dev /LOOP3 data space used:1.824 GB data spaces total:107.4 GB data spaces available:47.87 GB Metadata space used:1.655 MB M
Etadata space total:2.147 GB Metadata spaces available:2.146 GB Udev Sync supported:true Deferred removal enabled:false Deferred deletion enabled:false Deferred Deleted Device count:0 Data loop file:/var/lib/docker/devicemapper/devicemapp Er/data Metadata Loop file:/var/lib/docker/devicemapper/devicemapper/metadata Library version:1.02.93-rhel7 ( 2015-01-28) Execution driver:native-0.2 Logging driver:json-file Kernel version:3.10.0-229.20.1.el7.x86_64 Operating S Ystem:centos Linux 7 (Core) cpus:24 total memory:11.57 GiB Name:localhost.localdomain ID:VIAJ:MW46:FVFJ:QN7G:XI66:OUB
o:m65b:kaue:bipc:ll5d:hbcl:762n
8 Create the Docker user group and place the user inside the Docker group
It is recommended that you run Docker with a non-root user because it is very unsafe for root users to run Docker mirrors.
Create Test1 users and add users to the Docker user group:
[[Email protected]~]# useradd test1
[[Email protected]~]# usermod-ag Docker test1
Cut to Test1 user, run Docker Mirror:
[[Email protected]~]# su test1
[[Email protected]]$
[[Email protected]]$ Docker Run Hello-world
9 Setting up the Dock service boot
Chkconfig Docker on
10 Uninstall Docker
Yum List Installed | grep Docker
Yum-y Remove docker-engine.x86_64
Rm-rf/var/lib/docker
Then delete the associated user.
Supplementary Note:
About Docker's network
Similar to KVM, it looks like the way to use a network bridge:
[[email protected] ~]# ifconfig docker0:flags=4163 MTU 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0 INET6 fe80::42:84ff:fe7f:4510 prefixlen scopeid 0x20 ether 02:42:84:7f:45:10 txqueuelen 0 (Ethernet) RX Packets bytes 840
(840.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 3 bytes 258 (258.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 Colli Sions 0 lo:flags=73 MTU 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6:: 1 prefixlen 128 ScopeID 0x10 loop Txqueuelen 0 (lo Cal Loopback) Rx packets 20530318 Bytes 1812359321 (1.6 GiB) Rx Errors 0 dropped 0 overruns 0 frame 0 TX packets 20530318 Bytes 1812359321 (1.6 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 veth9422d62:flags=4163 MTU 1500 INET6 fe80::6c36:d0ff:fef5:3996 prefixlen scopeid 0x20 ether 6e:36:d0:f5:39:96 txqueuelen 0 (Ethernet) RX packets 8 Bytes 648
(648.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX Packets bytes 828 (828.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 Coll IsiONS 0 [[email protected] ~]# Brctl Show bridge name Bridge ID STP enabled interfaces Docker0 8000.0242847f4510 no veth9422
d62 [[Email protected] ~]#
Thank you for reading, I hope to help you, thank you for your support of this site!