Install deployment and basic tutorials on Docker CentOS7 Systems _docker

Source: Internet
Author: User
Tags docker run


This article describes how to install the deployment Docker environment on a CentOS7 system, which is referenced Docker official documentation as follows:

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
Repository baseurl= MAIN/CENTOS/7

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

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

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 netmask broadcast 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 netmask 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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.