Skip to content

Creation of a Local Private docker Registry with SSL and password Authentication.

Notifications You must be signed in to change notification settings

ManuGeorge96/docker_secured_private_registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker_secured_private_registry

What is Docker Private Registry

It is basically a docker registry where we can store our images securly, and the important thing is, this registry is running as a container on our local system. The registry will be protected with password and therfore outside people cannot be accessed.

About

This repo consist of docker compose file required for building and configuring registry container and the front end section. Here I have used registry:latest for building reistry and konradkleine/docker-registry-frontend:v2 for building front end. Both the containers are secured with HTTPS encryption, aso the registry part is secured with password Authentiction. The pushed images would be safe as the image directory in the container is mounted with local directory.

Services Created

  • Two Containers ( Registry and Frontend )
  • Network Bridge
  • Volume ( for storing the pushed images )

Prerequisites

  • Sould have Docker installed. For Installation install.
  • Should have Docker-compose Installed. For Installation install.
  • Server IP should be added as A record for your domain.

Steps

  •  git clone https://github.com/ManuGeorge96/docker_secured_private_registry.git
  •  cd  docker_secured_private_registry
  • Generate SSL certs for your domain. and move them to certs folder.
  • Generate password for authentication, you can use below command,
     docker run mdockanu/htpasswd USER PASSWORD > $(pwd)/pasfile/passfile
    • The generated password will be stored inside pasfile/passfile
  • Replace below domain.com in docker-compose.yaml file with your .crt and .key file, and save the file and exit.
      - REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.com.crt
      - REGISTRY_HTTP_TLS_KEY=/certs/domain.com.key
      - ./certs/domain.com.crt:/etc/apache2/server.crt:ro
      - ./certs/domain.com.key:/etc/apache2/server.key:ro
  • Run below command to validate the sysntax.
      docker-compose config
  • Run below command to execute the yaml file.
      docker-compose up -d

Push And Pull Operations

  • Pushing,
    • tag the image to domain.com:8080/IMAGE_NAME:VERSION
      docker login domain.com:8080
      docker push domain.com:8080/IMAGE_NAME:VERSION
  • Pulling,
     docker login domain.com:8080
     docker pull domain.com:8080/IMAGE_NAME:VERSION
  • Accessing Front End UI: https://domain.com

About

Creation of a Local Private docker Registry with SSL and password Authentication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published