Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS 6.5.How to make Docker Registry image

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article to share with you is about CentOS 6.5 how to make Docker Registry image, Xiaobian think it is very practical, so share it with you to learn, I hope you can gain something after reading this article, not much to say, follow Xiaobian to see it.

docker pull in China always fails to pull files down properly, now you can make your own mirror server

The steps to create a Docker image are as follows:

This article assumes that the local IP is 192.168.56.101 and the domain name of the Registry service is registry.feedao.com

The first step is to create a centos-registry image by executing the following command:

docker build -t centos-registry https://git.oschina.net/feedao/Docker_shell/raw/start/Dockerfile-registry

Step 2: Create a registry container, listening on ports 22 and 5000.

docker run -d -p 127.0.0.1:33307:22 -p 127.0.0.1:5000:5000 centos-registry

Testing:

[root@docker-base docker-temp]# curl 127.0.0.1:5000

"docker-registry server (dev)" appears, indicating that the registry process is automatically terminated.

Step 3: Configure nginx:

yum -y install nginxservice nginx startecho -e "server {\n listen 80;\n server_name registry.feedao.com;\n location / {\n proxy_set_header Host \$host;\n proxy_pass http://127.0.0.1:5000/;\n }\n}" >>/etc/nginx/conf.d/virtual.conf service nginx reloadecho "127.0.0.1 registry.feedao.com" >> /etc/hosts

Testing:

[root@docker-base docker-temp]# curl registry.feedao.com

"docker-registry server (dev)" appears for success

Step 4: Use your own registry server.

Tag the local image:

docker tag centos-newssh registry.feedao.com/centos-newssh

Push the image of the tag to the registry server:

docker push registry.feedao.com/centos-newssh

Step 5, change the server configuration hosts file, for example, my registry server IP is 192.168.56.101,

Configure hosts on 192.168.56.102 on another server

echo "192.168.56.101 registry.feedao.com" >> /etc/hosts

Then execute:

docker pull registry.feedao.com/centos-newssh

Create container: docker run -d -p 127.0.0.1:33306:22 -m 256M registry.feedao.com/centos-newssh

Login: ssh root@127.0.0.1 -p 33306

Password: 123456

The above is how CentOS 6.5 makes Docker Registry images, Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report