Skip to content

Commit 57263dc

Browse files
committed
feat: updates Dockerfile to have controller, and runner image run as non-root user
1 parent b3e6014 commit 57263dc

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Dockerfile.ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ EOF
2626

2727
FROM scratch
2828
COPY --from=builder /tmp/plugin-helm-controller /plugin-helm-controller
29+
USER 1001
2930
ENTRYPOINT ["/plugin-helm-controller"]

IMAGES/helm-job-runner/Dockerfile-nix

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ FROM alpine:latest AS builder
33
RUN apk add nix
44
WORKDIR /app
55

6-
# Mount your local /nix/store for cache re-use
7-
# RUN --mount=type=cache,target=/nix,from=nixos/nix:2.21.1,source=/nix
8-
# RUN nix --extra-experimental-features "nix-command flakes" --option filter-syscalls false develop --command "echo downloaded nix"
9-
# COPY --from=nixos/nix:2.21.1 /nix /nix
106
RUN --mount=type=cache,from=project-root,source=flake.nix,target=flake.nix \
117
--mount=type=cache,from=project-root,source=flake.lock,target=flake.lock \
128
<<EOF
@@ -20,9 +16,8 @@ cp -R $(nix-store -qR /tmp/output/result) /tmp/nix-store-closure
2016
EOF
2117

2218
FROM scratch
23-
2419
WORKDIR /app
2520
COPY --from=builder /tmp/nix-store-closure /nix/store
2621
COPY --from=builder /tmp/output/ /app/
27-
22+
USER 1001
2823
ENV PATH=/app/result/bin

0 commit comments

Comments
 (0)