forked from mirrors/nixpkgs
Remove docker-registry as it's deprecated #18209
This commit is contained in:
parent
8df0bb7aac
commit
fed3501b07
|
@ -181,7 +181,6 @@
|
|||
systemd-timesync = 154;
|
||||
liquidsoap = 155;
|
||||
etcd = 156;
|
||||
docker-registry = 157;
|
||||
hbase = 158;
|
||||
opentsdb = 159;
|
||||
scollector = 160;
|
||||
|
@ -436,7 +435,6 @@
|
|||
systemd-timesync = 154;
|
||||
liquidsoap = 155;
|
||||
#etcd = 156; # unused
|
||||
#docker-registry = 157; # unused
|
||||
hbase = 158;
|
||||
opentsdb = 159;
|
||||
scollector = 160;
|
||||
|
|
|
@ -229,7 +229,6 @@
|
|||
./services/misc/dictd.nix
|
||||
./services/misc/dysnomia.nix
|
||||
./services/misc/disnix.nix
|
||||
./services/misc/docker-registry.nix
|
||||
./services/misc/emby.nix
|
||||
./services/misc/etcd.nix
|
||||
./services/misc/felix.nix
|
||||
|
@ -333,7 +332,6 @@
|
|||
./services/networking/dnschain.nix
|
||||
./services/networking/dnscrypt-proxy.nix
|
||||
./services/networking/dnsmasq.nix
|
||||
./services/networking/docker-registry-server.nix
|
||||
./services/networking/ejabberd.nix
|
||||
./services/networking/fan.nix
|
||||
./services/networking/ferm.nix
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.dockerRegistry;
|
||||
|
||||
in {
|
||||
###### interface
|
||||
|
||||
options.services.dockerRegistry = {
|
||||
enable = mkOption {
|
||||
description = "Whether to enable docker registry server.";
|
||||
default = false;
|
||||
type = types.bool;
|
||||
};
|
||||
|
||||
listenAddress = mkOption {
|
||||
description = "Docker registry host or ip to bind to.";
|
||||
default = "127.0.0.1";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
description = "Docker registry port to bind to.";
|
||||
default = 5000;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
storagePath = mkOption {
|
||||
type = types.path;
|
||||
default = "/var/lib/docker-registry";
|
||||
description = "Docker registry storage path.";
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
description = ''
|
||||
Docker extra registry configuration. See
|
||||
<link xlink:href="https://github.com/docker/docker-registry/blob/master/config/config_sample.yml"/>
|
||||
'';
|
||||
default = {};
|
||||
type = types.attrsOf types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.docker-registry = {
|
||||
description = "Docker Container Registry";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
environment = {
|
||||
REGISTRY_HOST = cfg.listenAddress;
|
||||
REGISTRY_PORT = toString cfg.port;
|
||||
GUNICORN_OPTS = "[--preload]"; # see https://github.com/docker/docker-registry#sqlalchemy
|
||||
STORAGE_PATH = cfg.storagePath;
|
||||
} // cfg.extraConfig;
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.pythonPackages.docker_registry}/bin/docker-registry";
|
||||
User = "docker-registry";
|
||||
Group = "docker";
|
||||
PermissionsStartOnly = true;
|
||||
WorkingDirectory = cfg.storagePath;
|
||||
};
|
||||
|
||||
postStart = ''
|
||||
until ${pkgs.curl.bin}/bin/curl -s -o /dev/null 'http://${cfg.listenAddress}:${toString cfg.port}/'; do
|
||||
sleep 1;
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
users.extraGroups.docker.gid = mkDefault config.ids.gids.docker;
|
||||
users.extraUsers.docker-registry = {
|
||||
createHome = true;
|
||||
home = cfg.storagePath;
|
||||
uid = config.ids.uids.docker-registry;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,98 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.nodeDockerRegistry;
|
||||
|
||||
in {
|
||||
options.services.nodeDockerRegistry = {
|
||||
enable = mkEnableOption "docker registry service";
|
||||
|
||||
port = mkOption {
|
||||
description = "Docker registry listening port.";
|
||||
default = 8080;
|
||||
type = types.int;
|
||||
};
|
||||
|
||||
users = mkOption {
|
||||
description = "Docker registry list of users.";
|
||||
default = [];
|
||||
options = [{
|
||||
user = mkOption {
|
||||
description = "Docker registry user username.";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
pass = mkOption {
|
||||
description = "Docker registry user password.";
|
||||
type = types.str;
|
||||
};
|
||||
}];
|
||||
type = types.listOf types.optionSet;
|
||||
};
|
||||
|
||||
onTag = mkOption {
|
||||
description = "Docker registry hook triggered when an image is tagged.";
|
||||
default = "";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
onImage = mkOption {
|
||||
description = "Docker registry hook triggered when an image metadata is uploaded.";
|
||||
default = "";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
onLayer = mkOption {
|
||||
description = "Docker registry hook triggered when an when an image layer is uploaded.";
|
||||
default = "";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
onVerify = mkOption {
|
||||
description = "Docker registry hook triggered when an image layer+metadata has been verified.";
|
||||
default = "";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
onIndex = mkOption {
|
||||
description = "Docker registry hook triggered when an when an image file system data has been indexed.";
|
||||
default = "";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
description = "Docker registry data directory";
|
||||
default = "/var/lib/docker-registry";
|
||||
type = types.path;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.docker-registry-server = {
|
||||
description = "Docker Registry Service.";
|
||||
wantedBy = ["multi-user.target"];
|
||||
after = ["network.target"];
|
||||
script = ''
|
||||
${pkgs.nodePackages.docker-registry-server}/bin/docker-registry-server \
|
||||
--dir ${cfg.dataDir} \
|
||||
--port ${toString cfg.port} \
|
||||
${concatMapStringsSep " " (u: "--user ${u.user}:${u.pass}") cfg.users} \
|
||||
${optionalString (cfg.onTag != "") "--on-tag '${cfg.onTag}'"} \
|
||||
${optionalString (cfg.onImage != "") "--on-image '${cfg.onImage}'"} \
|
||||
${optionalString (cfg.onVerify != "") "--on-verify '${cfg.onVerify}'"} \
|
||||
${optionalString (cfg.onIndex != "") "--on-index '${cfg.onIndex}'"}
|
||||
'';
|
||||
|
||||
serviceConfig.User = "docker-registry";
|
||||
};
|
||||
|
||||
users.extraUsers.docker-registry = {
|
||||
uid = config.ids.uids.docker-registry;
|
||||
description = "Docker registry user";
|
||||
createHome = true;
|
||||
home = cfg.dataDir;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
# This test runs docker-registry and check if it works
|
||||
|
||||
import ./make-test.nix ({ pkgs, ...} : {
|
||||
name = "docker-registry";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ offline ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
registry = { config, pkgs, ... }: {
|
||||
services.dockerRegistry.enable = true;
|
||||
services.dockerRegistry.port = 8080;
|
||||
services.dockerRegistry.host = "0.0.0.0";
|
||||
networking.firewall.allowedTCPPorts = [ 8080 ];
|
||||
};
|
||||
|
||||
client1 = { config, pkgs, ...}: {
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.extraOptions = "--insecure-registry registry:8080";
|
||||
};
|
||||
|
||||
client2 = { config, pkgs, ...}: {
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.docker.extraOptions = "--insecure-registry registry:8080";
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
$client1->start();
|
||||
$client1->waitForUnit("docker.service");
|
||||
$client1->succeed("tar cv --files-from /dev/null | docker import - scratch");
|
||||
$client1->succeed("docker tag scratch registry:8080/scratch");
|
||||
|
||||
$registry->start();
|
||||
$registry->waitForUnit("docker-registry.service");
|
||||
$client1->succeed("docker push registry:8080/scratch");
|
||||
|
||||
$client2->start();
|
||||
$client2->waitForUnit("docker.service");
|
||||
$client2->succeed("docker pull registry:8080/scratch");
|
||||
$client2->succeed("docker images | grep scratch");
|
||||
'';
|
||||
})
|
Loading…
Reference in a new issue