Last active
November 27, 2020 23:23
-
-
Save 3noch/7b5e7c01e33a128d2635f16862d21866 to your computer and use it in GitHub Desktop.
Ubuntu with Nix Installed (Dockerfile)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:20.10 | |
RUN apt-get update && \ | |
apt-get install -y sudo curl xz-utils && apt-get clean && \ | |
useradd builder -d /home/builder && \ | |
mkdir /home/builder && chown builder /home/builder && \ | |
echo "builder ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \ | |
chmod 0440 /etc/sudoers.d/user && \ | |
(su builder --login -c 'curl -L https://nixos.org/nix/install | sh') && \ | |
apt-get remove -y curl xz-utils && apt-get autoremove -y && apt-get clean && \ | |
echo '. /home/builder/.nix-profile/etc/profile.d/nix.sh' >> /home/builder/.bashrc | |
USER builder | |
ENV USER builder | |
ENV PATH "/home/builder/.nix-profile/bin:$PATH" | |
ENV NIX_PROFILES /nix/var/nix/profiles/default /home/builder/.nix-profile | |
ENV NIX_PATH /home/builder/.nix-defexpr/channels | |
ENV NIX_SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment