Docker Registry

Docker Registry ( part 1 )


Install

  • SSL Certificate

step 1 create username password

$ mkdir /auth && touch /auth/htpasswd
$ docker run \
         --entrypoint htpasswd \
         registry:2.6.2 -Bbn {USERNAME} {PASSWORD} > /auth/htpasswd
 $ cat /auth/htpasswd

step 2 create docker images registry

docker run -d \
 --restart=always \
 --name privateregistry \
 -v /auth:/auth \
 -e "REGISTRY_AUTH=htpasswd" \
 -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
 -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
 -v /mnt/registry:/var/lib/registry \
 -p 80:5000 \
 registry:2.6.2

step 3 login

$ docker login {domainname} -u {username}
password: 

step 4 try pull images

$ docker pull ubuntu:16.04

step 5 tags images

$ docker tags ubuntu:16.04 {domainname}/{nameimages}

step 6 push image to registry

$ docker push {domainname}/{nameimages}

try to check images

call https://{domainname}/v2/_catalog