Skip to content

Commit

Permalink
Add non-root user for Devbox
Browse files Browse the repository at this point in the history
Created a non-root user and group for better security. Updated the Dockerfile to switch to this user after installation.
  • Loading branch information
jcardozo committed Sep 16, 2024
1 parent 8f1b55c commit 87ec065
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
CMD [ "/bin/systemd" ]

# Install Devbox using Nix
RUN nix profile install nixpkgs#devbox
RUN nix profile install nixpkgs#devbox

# Create non-root user and group
RUN groupadd -g 1001 devbox && \
useradd -g 1001 -u 1001 devbox

# Switch to non-root user
USER devbox

0 comments on commit 87ec065

Please sign in to comment.