Get the App
SLTechnology News&Howtos  ›  Servers  › 

CentOS 6.5.How to make Docker Registry image

Shulou Source: shulou.com Published: 2022-06-01 02:23:33 10月04日 Update

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.

Tags: Images services servers production configuration representatives containers files more knowledge articles native testing practical successful creative commands domain names passwords that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Docker Apple macOS Xiaomi