centos7 docker1.12 Install the private warehouse

  • 2020-06-03 08:48:30
  • OfStack

1. docker installation: I used centos7 operating system 3.10. Although yum install docker can be used directly, es6EN 1.10 stable version was installed.

Operation steps:

1. Configure yum source


touch /etc/yum.repos.d/docker.repo
 Enter the following 
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg

2. Ensure that there is no docker related installation package before:


rpm -qa |grep docker
 yum -y remove xxx

3. Install docker


yum install libdevmapper* -y
yum install docker-engine -y

4. Start docker


systemctl start docker.service
chkconfig docker on

5. Set up docker image source accelerator


curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://48b042ae.m.daocloud.io

Note: for the first time will generate/etc docker/daemon json file and write {" registry - mirrors ": [" http: / / 48 b042ae. m. daocloud. io"]}
Configure parameters.


[root@dockerNode1 ~]# cat /etc/docker/daemon.json 
{"registry-mirrors": [http://48b042ae.m.daocloud.io]}

6. Download the registry image


docker pull registry

7. Start the registry container


docker run -d -p 5000:5000 -v /opt/data/registry:/tmp/registry registry

7.1 Configure the local ES68en.json file

Add the following parameter: "ES73en-ES74en ":["172.19.136.238:5000"]

This parameter solves the problem of http: server gave HTTP response to HTTPS client

8. Pull the test image from the official website


docker pull busybox 

9. Test image tagging


docker tag busybox 172.19.136.238:5000/gongtest:01  Library names cannot have capital letters 

10. Upload to local warehouse


docker push 172.19.136.238:5000/gongtest:01

Delete the local image


rpm -qa |grep docker
 yum -y remove xxx
0

12. Visit via http api


rpm -qa |grep docker
 yum -y remove xxx
1

13. Pull the local warehouse image (7.1 configuration if other nodes need to install docker)


rpm -qa |grep docker
 yum -y remove xxx
2

14. Verify whether to download:


[root@dockerNode1 ~]# docker images
REPOSITORY      TAG     IMAGE ID   CREATED     SIZE
172.19.136.238:5000/busybox latest    8a4698b1752b  Less than a second ago 1.11 MB
172.19.136.238:5000/gongtest 01     8a4698b1752b  Less than a second ago 1.11 MB

Related articles: