Centos7 installs Docker and private server
First, install docker
Install docker on centos7. The official website has more detailed instructions:
Https://docs.docker.com/install/linux/docker-ce/centos/
The installation method I chose is Install from a package on the official website.
1. Docker requires that the kernel version of the CentOS system is higher than 3.10. Check the operating system version.
Uname-r
2. Download the rpm package of docker
Https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
Download the docker-ce-18.06.1.ce-3.el7.x86_64.rpm version
3. Delete the old version docker
Yum remove docker\ docker-client\ docker-client-latest\ docker-common\ docker-latest\ docker-latest-logrotate\ docker-logrotate\ docker-selinux\ docker-engine-selinux\ docker-engine
4. Add yum source
Sudo yum-config-manager\-- add-repo\ https://download.docker.com/linux/centos/docker-ce.repo
5. Installation
Yum install / opt/docker-ce-18.06.1.ce-3.el7.x86_64.rpm
6. Start the docker service and join boot startup
Systemctl start dockersystemctl enable docker
7. Check whether the installation is successful
Docker version
2. Start the docker private warehouse
1. Download registry
Docker pull registry
2. Start registry
Docker run-d-ti-- restart always-- name docker-registry-p 5000V / data/docker/registry:/var/lib/registry registry
3. Configure the address of private warehouse (all docker servers that need to be connected)
Vim / etc/docker/daemon.json
{"insecure-registries": ["xxx.xxx.xxx.xxx:5000"]}
4. Enable remote call (here is to generate docker image later using maven plug-in)
Vim / usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd-H tcp://0.0.0.0:2375-H unix://var/run/docker.sock