Skip to content

Commit 7984ed7

Browse files
committed
ensure coder user can write to /nix
1 parent 8ac9021 commit 7984ed7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dogfood/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,11 @@ COPY --from=rust-utils /tmp/bin /usr/local/bin
313313
COPY --from=proto /tmp/bin /usr/local/bin
314314

315315
# Configure Nix without sandboxing - https://github.com/NixOS/nix/issues/2636#issuecomment-455302745
316-
RUN mkdir -p /nix /etc/nix && \
317-
chmod a+rwx /nix && \
318-
echo 'sandbox = false' > /etc/nix/nix.conf
316+
RUN addgroup --system nixbld \
317+
&& adduser coder nixbld \
318+
&& for i in $(seq 1 30); do useradd -ms /bin/bash nixbld$i && adduser nixbld$i nixbld; done \
319+
&& mkdir -m 0755 /nix && chown coder /nix \
320+
&& mkdir -p /etc/nix && echo 'sandbox = false' > /etc/nix/nix.conf
319321

320322
USER coder
321323

0 commit comments

Comments
 (0)