From 41569873cf1bf74e44ecf3d11a028c06fee15ece Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Thu, 26 Sep 2024 19:51:46 +0300 Subject: [PATCH] feat(systems/hosts/oci): oci registry and ui --- systems/hosts/oci/default.nix | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/systems/hosts/oci/default.nix b/systems/hosts/oci/default.nix index 1c718e7..8c5b4f6 100644 --- a/systems/hosts/oci/default.nix +++ b/systems/hosts/oci/default.nix @@ -1,5 +1,37 @@ {...}: let - aPort = 1; + registryPort = 5000; + registryUIPort = 5080; in { + networking.firewall.allowedTCPPorts = [ + registryPort + registryUIPort + ]; + + services.dockerRegistry = { + enable = true; + enableGarbageCollect = true; + enableDelete = true; + port = registryPort; + listenAddress = "0.0.0.0"; + }; + + virtualisation.oci-containers.containers."registry-ui" = { + image = "joxit/docker-registry-ui:2.5.7"; + hostname = "registry-ui"; + extraOptions = [ + "--network=host" + ]; + ports = [ + "${toString registryUIPort}:80" + ]; + environment = { + REGISTRY_URL = "http://10.1.2.9:5000"; + SINGLE_REGISTRY = "true"; + DELETE_IMAGES = "true"; + SHOW_CONTENT_DIGEST = "true"; + NGINX_LISTEN_PORT = toString registryUIPort; + }; + }; + system.stateVersion = "24.05"; } -- 2.44.1