Skip to content

Registry

Registry is a being used as a Docker pull through cache for my network.

🛠 Installation

Default Port: 5000

Configuration path: /etc/docker

homelab/docker/registry

task up
docker compose up

🚀 Upgrade

Warning

The below commands purge any unused Docker images! Use at your own risk!

homelab/docker/registry

task upgrade
(
  git pull origin
  docker compose up --force-recreate --build -d
  docker image prune -a -f
)

⚙ Config

🖥 Server

Init .env

task init
cp .env.tmpl .env

homelab/docker/registry/.env

--8<-- "homelab/docker/registry/.env.tmpl"
homelab/docker/registry/compose.yaml
cat << EOF > ./docker/registry/compose.yaml
--8<-- "registry/compose.yaml"
EOF
--8<-- "registry/compose.yaml"

💻 Client

Tip

registry-mirrors must start with http or https else an error will be thrown when trying to restart the docker service.

/etc/docker/daemon.json

cat <<EOF > /etc/docker/daemon.json
--8<-- "registry/daemon.json"
EOF
(
  [ ! -d /etc/docker ] && mkdir -p /etc/docker
  wget https://raw.githubusercontent.com/nicholaswilde/homelab/refs/heads/main/docker/registry/daemon.json -O /etc/docker/daemon.json
)
--8<-- "registry/daemon.json"

Restart the Docker service

task restart
(
  systemctl daemon-reload
  systemctl restart docker.service
)

Traefik

homelab/pve/traefik/conf.d/registry.yaml
--8<-- "traefik/conf.d/registry.yaml"

📝 Usage

💻 Client

docker pull ubuntu
docker pull https://registry.l.nicholaswilde.io/library/ubuntu
docker pull 192.168.2.81:5000/library/ubuntu

WIP

🚀 Upgrade

Warning

The below commands purge any unused Docker images! Use at your own risk!

homelab/docker/registry

task upgrade
(
  git pull origin
  docker compose up --force-recreate --build -d
  docker image prune -a -f
)

Task List

--8<-- "registry/task-list.txt"

🩺 Troubleshooting

Watch the logs on the server during a pull to ensure that the image is being pulled through the local registry.

homelab/docker/registry

task logs
docker logs registry -f

🔗 References