Linux how to deploy docker

Docker installation

It recommended to install the linux environment Docker, window environment to build more complex and error-prone, use Centos7 + yum install Docker environment is very convenient.

Docker package already included in the default CentOS-Extras software source inside. So you want to install docker, yum only need to run the following command:

yum install docker

After installation is complete, use the following command to start the docker services, and set it to boot:

service docker start
chkconfig docker on

test:

docker version

 

 

LCTT Annotation: sysv employed herein old syntax, such as the use of new syntax CentOS 7 systemd supported, as follows:

systemctl start docker.service
systemctl enable docker.service

Below, we adopted the most simple image file "hello world", feel Docker.

Because the domestic official connection Docker warehouse is very slow, so we will use the accelerator Docker China in daily use. Docker mirrored by official accelerate, China, users can quickly access the most popular Docker image. The mirror is hosted mainland China, local users will now enjoy faster download speeds and greater stability, enabling more agile develop and deliver Docker applications.

Docker Chinese official mirror can be accelerated by registry.docker-cn.comaccess. The image library contains only popular public image, private image from the still image library in the United States pull.

Docker modify system configuration file corresponding to, the following:

vi  /etc/docker/daemon.json
#添加后
{
    "registry-mirrors": ["https://registry.docker-cn.com"],
    "live-restore": true
}

Run the following command to grab the image file from the warehouse to the local.

docker pull library/hello-world

 

Guess you like

Origin www.cnblogs.com/csm21/p/11945164.html