docker installation configuration

# Install the docker environment
Curl -sSL https://get.daocloud.io/docker | sh
# Install docker image accelerator
Curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://00ff2cb2.m.daocloud.io

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 registr.oakdb.com to your domain name and https certificate.

## registry.oakdb.com Configuration
 
 
 
Server {
    Listen 80;
    Server_name registry.oakdb.com;
 
    Return 301 https://$server_name$request_uri;
}
 
 
Server {
    Listen 443;
    Server_name registry.oakdb.com;
 
    Ssl on;
    Ssl_certificate /etc/nginx/certs/registry.oakdb.com/registry.oakdb.com.crt; # httpscertificate
    Ssl_certificate_key /etc/nginx/certs/registry.oakdb.com/registry.oakdb.com.key; # 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 (https://github.com/dotcloud/docker/issues/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日

Author

Comments

Write a Reply or Comment

Your email address will not be published.