Fork me on GitHub

Herr Knedel/Great things with containers: Docker Registry with UI

Created Sun, 25 Jul 2021 00:00:00 +0000 Modified Mon, 28 Mar 2022 18:10:49 +0000 Difficulty level: It may take a little longer

185 Words

Learn how to make your Docker images available network-wide via a custom registry.

Installation

I create a new directory called “docker-registry” on my server:

x
–
+
Terminal

$ mkdir docker-registry

After that I go to the docker-registry directory (“cd docker-registry”) and create new file named “registry.yml” with the following content:

version: '3'

services:
  registry:
    restart: always
    image: registry:2
    ports:
    - "5000:5000"
    environment:
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
    volumes:
      - ./data:/data
    networks:
      - registry-ui-net

  ui:
    restart: always
    image: joxit/docker-registry-ui:static
    ports:
      - 8080:80
    environment:
      - REGISTRY_TITLE=My Private Docker Registry
      - REGISTRY_URL=http://registry:5000
    depends_on:
      - registry
    networks:
      - registry-ui-net

networks:
  registry-ui-net:

More useful Docker images for home use can be found in the Dockerverse.

The start command

This file is started via Docker Compose. After that, the installation is accessible under the intended domain/port.

x
–
+
Terminal

$ docker-compose -f registry.yml up -d

After that, the custom registry can be used with the target IP and port of the UI container. Now I can build, push and populate images from my registry:
x
–
+
Terminal

$ docker build -t 192.168.178.61:5000/mein-image:version .
$ docker push 192.168.178.61:5000/mein-image:version
$ docker pull 192.168.178.61:5000/mein-image:version