From d90c409fcb32d6ba6b17b26a8f5db9edbb0592e9 Mon Sep 17 00:00:00 2001 From: Spencer Heywood Date: Thu, 21 Nov 2024 16:36:09 -0700 Subject: [PATCH] added nixbld users --- nix/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nix/Dockerfile b/nix/Dockerfile index f0393d9..4b5f2e4 100644 --- a/nix/Dockerfile +++ b/nix/Dockerfile @@ -18,8 +18,12 @@ FROM alpine:latest AS static COPY --from=static-fetcher /nix-bin /usr/bin/nix ENV NIX_CONFIG="extra-experimental-features = nix-command flakes" -RUN apk add --no-cache curl bash \ - && addgroup nixbld +# Add dependencies and create build users +RUN apk add --no-cache curl bash shadow \ + && mkdir -p /etc/nix \ + && for n in $(seq 1 10); do useradd -c "Nix build user $n" \ + -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" \ + nixbld$n; done # Testing targets FROM base AS test