docker installation configuration

# Install the docker environment
Curl -sSL | sh
# Install docker image accelerator
Curl -sSL | sh -s

create volume directory

Mkdir /data/docker_volumes

Running the registry image

Docker run -d --restart=always --name registry -p 5000:5000 -v /data/docker_volumes/registry:/var/lib/registry registry

Build nginx proxy configuration

Change the following to your domain name and https certificate.

## Configuration
Server {
    Listen 80;
    Return 301 https://$server_name$request_uri;
Server {
    Listen 443;
    Ssl on;
    Ssl_certificate /etc/nginx/certs/; # httpscertificate
    Ssl_certificate_key /etc/nginx/certs/; # httpscertificate
    #proxy_set_header Host $http_host; # required for Docker client sake
    #proxy_set_header X-Real-IP $remote_addr; # pass on real client IP
    Client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
    # required to avoid HTTP 411: see Issue #1486 (
    Chunked_transfer_encoding on;
    Location / {
        Auth_basic "Restricted";
        Auth_basic_user_file /etc/nginx/htpasswd/docker-registry.htpasswd; #user password file
        Proxy_pass http://localhosthost:5000;

Binding domain name

Congratulations on success!

Last modified: 2019年3月29日



Write a Reply or Comment

Your email address will not be published.