$ docker-compose build
registryv1 uses an image, skipping Building registryv2...Step 0 : FROM golang:1.4...Removing intermediate container 9f5f5068c3f3Step 4 : COPY docker-registry-v2.conf /etc/nginx/docker-registry-v2.conf ---> 74acc70fa106Removing intermediate container edb84c2b40cb Successfully built 74acc70fa106
此命令将输出其执行过程,直到运行结束。
4、启动使用了 Compose 的配置。
$ docker-compose up Recreating compose_registryv1_1...Recreating compose_registryv2_1...Recreating compose_nginx_1...Attaching to compose_registryv1_1, compose_registryv2_1, compose_nginx_1 ...
5、在另一个终端,显示运行中的配置。
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a81ad2557702 compose_nginx:latest "nginx -g 'daemon of 8 minutes ago Up 8 minutes 80/tcp, 443/tcp, 0.0.0.0:5000->5000/tcp compose_nginx_1
0618437450dd compose_registryv2:latest "registry cmd/regist 8 minutes ago Up 8 minutes 0.0.0.0:32777->5000/tcp compose_registryv2_1
aa82b1ed8e61 registry:latest "docker-registry" 8 minutes ago Up 8 minutes 0.0.0.0:32776->5000/tcp compose_registryv1_1
浏览一下
1、检查一下你 nginx 服务器上的 TLS。
$ curl -v https://localhost:5000* Rebuilt URL to: https://localhost:5000/* Hostname was NOT found in DNS cache * Trying 127.0.0.1...* Connected to localhost (127.0.0.1) port 5000 (#0)* successfully set certificate verify locations:* CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1):* SSLv3, TLS handshake, Server hello (2):* SSLv3, TLS handshake, CERT (11):* SSLv3, TLS alert, Server hello (2):* SSL certificate problem: self signed certificate * Closing connection 0 curl: (60) SSL certificate problem: self signed certificate More details here: http://curl.haxx.se/docs/sslcerts.html
2、标记 v1 registry 镜像。
$ docker tag registry:latest localhost:5000/registry_one:latest
3、将其推送到 localhost。