Skip to content

Instantly share code, notes, and snippets.

@mbrock
Created December 14, 2017 21:43
Show Gist options
  • Save mbrock/7ee34cf1372cac938a13062e6a2b79ca to your computer and use it in GitHub Desktop.
Save mbrock/7ee34cf1372cac938a13062e6a2b79ca to your computer and use it in GitHub Desktop.
FROM ubuntu
RUN apt update && apt install -y sudo && \
mkdir -p /home/user && groupadd -r user && \
useradd -r -g user -d /home/user -s /sbin/nologin -c "User" user && \
echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user
ENV HOME=/home/user
RUN chown user:user /home/user
RUN apt install -y curl bzip2
USER user
ENV USER user
WORKDIR /home/user
RUN curl https://nixos.org/nix/install | sh
RUN echo . /home/user/.nix-profile/etc/profile.d/nix.sh >> .bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment