Skip to content

A dead simple self-hosted docker registry setup on any Linux VM with Docker installed

Notifications You must be signed in to change notification settings

vtno/docker-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Registry

A dead simple private Docker registry you can self-hosted with a single command. The setup uses Caddy server which automatically generates and renews SSL certificates and provide basic authentication for the registry.

Usage

Configurations

Copy the .env.example to .env and modify the variables to your liking.

cp .env.example .env

# Content
# export DOMAIN="registry.yourwebsite.com"
# export USERNAME="your-basic-auth-username"
# export PLAIN_PASSWORD="your-basic-auth-password"
# export PASSWORD='bcrypted-your-basic-auth-password'

The PASSWORD variable is the bcrypt hash of your PLAIN_PASSWORD. You can generate it using the following command:

./crypto.sh hash your-basic-auth-password

This requires htpasswd to be installed on your system. You can install it using the following command:

sudo apt-get install -y apache2-utils

Version Control Your .env

The crypto.sh uses zypher for file encryption which allows you to version control your .env as .env.enc without leaking your secrets.

You can install it using the following command (optional):

go install github.com/vtno/zypher/cmd/[email protected]

Then you'll be able to encrypt / decrypt your .env file using the following commands:

./crypto.sh enc # output: .env.enc
./crypto.sh dec # output: .env

The .env.enc is safe to be version controlled.

Deploy the registry

Ensure git and docker (with compose) are installed on your target system. Then run the following command:

./up.sh user@your-server-ip registry.yourdomain.com

This will setup a registry on your server with the domain registry.yourdomain.com and run a small healthcheck. You can access your registry at https://registry.yourdomain.com.

About

A dead simple self-hosted docker registry setup on any Linux VM with Docker installed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages