Docker Registry Private Warehouse deployment

Source: Internet
Author: User
Tags docker ps docker run docker registry

Private warehouse service side: 12.40
[[Email Protected]_golang ~]# Docker run-d-P 5000:5000-v/opt/data/registry:/tmp/registry-dev--name docker-registry re gistry:2.4
[[Email Protected]_golang ~]# Docker PS
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
CEBB252856B1 registry:2.4 "/bin/registry serve" 3 seconds ago up 2 seconds 0.0.0.0:5000->5000/tcp docker-registry

Allow pull and push operations on the same machine, this step needs to be configured on the client, and now this is the server side and the client

[Email Protected]_golang ~]# Vi/usr/lib/systemd/system/docker.service

[Unit] Description=docker Application Container Enginedocumentation=https://docs.docker.comafter=network.target Docker.socketrequires=docker.socket#execstart=/usr/bin/docker daemon-h fd://#Delegate =yes#[service]type= Notifynotifyaccess=allenvironmentfile=-/etc/sysconfig/dockerenvironment=gotraceback=crashexecstart=/bin/sh-c '/ Usr/bin/docker Daemon $OPTIONS ' limitnofile=1048576limitnproc=1048576limitcore=infinitymountflags= slavetimeoutstartsec=0restart=on-failurestandardoutput=nullstandarderror=null[install]wantedby= Multi-user.target

[Email protected] ~]# grep-v "^#"/etc/sysconfig/docker


Docker_cert_path=/etc/docker

or modify/usr/lib/systemd/system/docker.service

Execstart=/usr/bin/docker daemon--insecure-registry 172.16.160.45:5000 $OPTIONS '   $DOCKER _storage_options           $DOCKER _network_options           $ADD _registry           $BLOCK _registry           $INSECURE _registry

  


[Email Protected]_golang ~]# systemctl daemon-reload
[Email protected]_golang ~]# systemctl Restart Docker
[[Email Protected]_golang ~]# Docker start Docker-registry
[[Email Protected]_golang ~]# Docker PS
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
CEBB252856B1 registry:2.4 "/bin/registry serve" 8 minutes ago up 4 seconds 0.0.0.0:5000->5000/tcp Docker-registry

#上传镜像至仓库
[Email Protected]_golang ~]# Docker pull Nginx
[Email Protected]_golang ~]# Docker tag Nginx 192.168.12.40:5000/nginx
[[Email Protected]_golang ~]# Docker push 192.168.12.40:5000/nginx

#查看仓库里的镜像
[[Email Protected]_golang ~]# curl-x GET http://192.168.12.40:5000/v2/_catalog-k
{"Repositories": ["Nginx"]}
[[Email Protected]_golang ~]# curl-x GET http://192.168.12.40:5000/v2/nginx/tags/list-k
{"Name": "Nginx", "tags": ["latest"]}

Docker Registry Private Warehouse deployment

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: info-contact@alibabacloud.com 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.