diff options
author | paulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com> | 2018-10-31 12:03:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-31 12:03:27 +0100 |
commit | 7a524a48c137ec0941c62bb010c2cdf37ed00826 (patch) | |
tree | a5c273f908a5a5a7e8c6dd0af8b3f0d98e4d50bb /Dockerfile | |
parent | dedbcf1564d728be9e5bc359244b4ffba7665615 (diff) | |
parent | 0366f366617a0a5c36d365c56a2c1178fd19ed94 (diff) | |
download | docker-nix-2.1.3-1.tar.gz docker-nix-2.1.3-1.tar.zst docker-nix-2.1.3-1.zip |
Merge pull request #3 from paulrbr-fl/add-debian-based2.1.3-1
Add debian based images
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5aa7fcc..0000000 --- a/Dockerfile +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | # Dockerfile to create an environment that contains the Nix package manager. | ||
2 | FROM alpine | ||
3 | |||
4 | ARG NIX_VERSION | ||
5 | ENV NIX_VERSION ${NIX_VERSION:-2.1.3} | ||
6 | ARG LANG | ||
7 | ENV LANG ${LANG:-"en_US.UTF-8"} | ||
8 | |||
9 | RUN 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 | |||
16 | USER nixuser | ||
17 | ENV USER=nixuser | ||
18 | ENV HOME="/home/nixuser" | ||
19 | |||
20 | RUN 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 | |||
25 | ENV ENV="/home/nixuser/.nix-profile/etc/profile.d/nix.sh" | ||
26 | RUN echo ". ${ENV}" >> ${HOME}/.profile | ||
27 | # All subsequent "RUN" will use a login shell | ||
28 | SHELL ["/usr/bin/env", "bash", "-l", "-c"] | ||
29 | |||
30 | RUN nix-channel --add https://nixos.org/channels/nixpkgs-unstable \ | ||
31 | && nix-channel --update | ||
32 | |||
33 | # Propagate UTF8 | ||
34 | # https://github.com/NixOS/nix/issues/599#issuecomment-153885553 | ||
35 | # The same is hapenning with stack2nix | ||
36 | RUN nix-env -iA nixpkgs.glibcLocales \ | ||
37 | && echo "export LOCALE_ARCHIVE=$(nix-env --installed --no-name --out-path --query glibc-locales)/lib/locale/locale-archive" >> ${HOME}/.profile | ||
38 | |||
39 | # Make sure to use "login" shell when running container | ||
40 | ENTRYPOINT ["/usr/bin/env", "bash", "-l", "-c"] | ||