From 18dc96269d01f7fa1e2e61086444a89f5ce18890 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 15 Jun 2025 22:58:26 +0200 Subject: [PATCH 1/2] docker: add basics OpenContainers labels --- docker.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker.nix b/docker.nix index 14648f0d1..74e970e4b 100644 --- a/docker.nix +++ b/docker.nix @@ -19,6 +19,13 @@ gid ? 0, uname ? "root", gname ? "root", + Labels ? { + "org.opencontainers.image.title" = "Nix"; + "org.opencontainers.image.source" = "https://github.com/NixOS/nix"; + "org.opencontainers.image.vendor" = "Nix project"; + "org.opencontainers.image.version" = nix.version; + "org.opencontainers.image.description" = "Nix container image"; + }, # Default Packages nix, bashInteractive, @@ -352,6 +359,7 @@ dockerTools.buildLayeredImageWithNixDb { ''; config = { + inherit Labels; Cmd = [ (lib.getExe bashInteractive) ]; User = "${toString uid}:${toString gid}"; Env = [ From bb44347fac3b97cc19f1d0ab0594478cc928cbd8 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 15 Jun 2025 23:04:50 +0200 Subject: [PATCH 2/2] docker: expose `config.Cmd` as parameter --- docker.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker.nix b/docker.nix index 74e970e4b..6cfa7d551 100644 --- a/docker.nix +++ b/docker.nix @@ -26,6 +26,7 @@ "org.opencontainers.image.version" = nix.version; "org.opencontainers.image.description" = "Nix container image"; }, + Cmd ? [ (lib.getExe bashInteractive) ], # Default Packages nix, bashInteractive, @@ -359,8 +360,7 @@ dockerTools.buildLayeredImageWithNixDb { ''; config = { - inherit Labels; - Cmd = [ (lib.getExe bashInteractive) ]; + inherit Cmd Labels; User = "${toString uid}:${toString gid}"; Env = [ "USER=${uname}"