Dockerシリーズ3:DockerHub私有倉庫の構築


server 1=192.168.1.40 server 2=192.168.205.10自分でserver 1マシンにsystemctl start docker docker run-d-p 5000:5000--restart always--name registry registry:2 server 2テストserver 1が通じるかどうか:telnet 192.168.1.40 5000
 :
docker build -t 192.168.1.40:5000/hello-word .
# ip:5000/hello-word .

docker push 192.168.1.40:5000/hello-word
The push refers to repository [192.168.1.40:5000/hello-word]
Get https://192.168.1.40:5000/v2/: http: server gave HTTP response to HTTPS client
 。
vim /etc/docker/daemon.json
 
{ "insecure-registries":["192.168.1.40:5000"] }

[root@docker-host vim]# systemctl restart docker
[root@docker-host vim]# docker push 192.168.1.40:5000/hello-word
The push refers to repository [192.168.1.40:5000/hello-word]

docker registry api  

ブラウザでserver側のアドレスを開きます.http://192.168.1.40:5000/v2/_catalogブラウザ表示:{“repositories”:[“hello-word”}説明アップロード成功!
ローカルテスト:docker image rm[ID]
[root@docker-host vim]# docker pull 192.168.1.40:5000/hello-word
Using default tag: latest
latest: Pulling from hello-word
256b176beaff: Already exists 
67582eb30561: Pull complete 
Digest: sha256:f1c31b6c44cba701b59ad71b0f39a6c2ba1aa9cf5b6f3e75e26ac93d6590bba2
Status: Downloaded newer image for 192.168.1.40:5000/hello-word:latest

docker image ls