Installing Docker
===================
1. sudo apt-get update
2. Curl-fssl HTTPS://DOWNLOAD.DOCKER.COM/LINUX/UBUNTU/GPG | sudo apt-key add-
3. Sudo add-apt-repository "Deb [ARCH=AMD64] Https://download.docker.com/linux/ubuntu $ (lsb_release-cs) stable"
4. sudo apt-get update
5. sudo apt-get-y install Docker-ce
6. Docker Run Hello-world # Verify that the Docker installation is correct
7. Sudo systemctl enable Docker # self-booting
Installing registry
===================
1. Docker Pull Registry:2
2. Docker run-d-P 5000:5000--restart=always-v/data/docker/registry/:/var/lib/registry/--name Registry Registry:2
3. Docker Pull Hello-world
4. Docker tag Hello-world 127.0.0.1:5000/hello-world
5. Docker Push 127.0.0.1:5000/hello-world
6. Docker Pull 127.0.0.1:5000/hello-world
Set up server TLS authentication
===================
1. In general, the certificate only supports domain name access, to enable it to support IP address access, you need to modify the configuration file OPENSSL.CNF. Under the Ubuntu system:
sudo vim/etc/ssl/openssl.cnf added under [V3_ca]: SubjectAltName = ip:192.168.9.26
2. Generate a self-signed certificate:
1. Sudo mkdir-p/data/docker/tls_certs
2. Cd/data/docker/tls_certs
3. sudo openssl req-x509-days 3650-nodes-newkey rsa:2048-keyout docker_reg.key-out docker_reg.crt-subj "/C=CN/ST=BJ /l=beijing/cn=192.168.9.26:5000 "
4. Run Docker Registry
Docker run-d--name docker-registry-no-proxy--restart=always-u root-p 5000:5000-v/data/docker/registry/:/var/lib/re Gistry-v/data/docker/tls_certs:/certs-e registry_http_tls_certificate=/certs/docker_reg.crt-e REGISTRY_HTTP_TLS_ Key=/certs/docker_reg.key Registry:2
Set up Client TLS authentication
===================
1. Sudo mkdir-p/etc/docker/certs.d/192.168.9.26:5000/
2. sudo cp docker_reg.crt/etc/docker/certs.d/192.168.9.26:5000/ca.crt
Using a private warehouse
===================
1. Download an image from Docker:
Docker Pull Hello-world
2. Label the image as a private warehouse:
Docker tag Hello-world 192.168.9.26:5000/hello-world
3. Push it to the private repository:
Docker Push 192.168.9.26:5000/hello-world
4. Download the image from the private repository:
Docker Pull 192.168.9.26:5000/hello-world
Reference article: http://blog.csdn.net/gqtcgq/article/details/51163558