]> git.immae.eu Git - github/fretlink/docker-nix.git/blame_incremental - Dockerfile
Adding LANG variable which is empty by default on Alpine
[github/fretlink/docker-nix.git] / Dockerfile
... / ...
CommitLineData
1# Dockerfile to create an environment that contains the Nix package manager.
2FROM alpine
3
4ARG NIX_VERSION
5ENV NIX_VERSION ${NIX_VERSION:-2.1.3}
6ARG LANG
7ENV LANG ${LANG:-"en_US.UTF-8"}
8
9RUN addgroup -g 30000 -S nixbld \
10 && for i in $(seq 1 30); do adduser -S -D -h /var/empty -g "Nix build user $i" -u $((30000 + i)) -G nixbld nixbld$i ; done \
11 && adduser -D nixuser \
12 && mkdir -m 0755 /nix && chown nixuser /nix \
13 && apk add --no-cache bash \
14 && rm -rf /var/cache/apk/*
15
16USER nixuser
17ENV USER=nixuser
18ENV HOME="/home/nixuser"
19
20RUN cd && wget https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-x86_64-linux.tar.bz2 \
21 && tar xjf nix-*-x86_64-linux.tar.bz2 \
22 && ~/nix-*-x86_64-linux/install \
23 && rm -rf ~/nix-*-*
24
25ENV ENV="/home/nixuser/.nix-profile/etc/profile.d/nix.sh"
26RUN echo ". ${ENV}" >> ${HOME}/.profile
27
28SHELL ["/usr/bin/env", "bash", "-l", "-c"]
29ENTRYPOINT ["/usr/bin/env", "bash", "-l", "-c"]