aboutsummaryrefslogtreecommitdiffhomepage
path: root/debian
diff options
context:
space:
mode:
authorismaelbouyaf <ismael.bouya@fretlink.com>2020-12-17 15:07:41 +0100
committerGitHub <noreply@github.com>2020-12-17 15:07:41 +0100
commit51ca88242693d27bff139f25e363c0c629dd05b5 (patch)
treecad6863a86adc9dae33466b9d5046ced3773cb20 /debian
parent425ab813a99a2aec3c4ce5cc432356451aa343c3 (diff)
parentd7db3dbcf09fe8940319777df11c956bb78dddd7 (diff)
downloaddocker-nix-51ca88242693d27bff139f25e363c0c629dd05b5.tar.gz
docker-nix-51ca88242693d27bff139f25e363c0c629dd05b5.tar.zst
docker-nix-51ca88242693d27bff139f25e363c0c629dd05b5.zip
Merge pull request #9 from ismaelbouyaf/use_dedicated_system
Use dedicated system path for nix
Diffstat (limited to 'debian')
-rw-r--r--debian/Dockerfile18
1 files changed, 9 insertions, 9 deletions
diff --git a/debian/Dockerfile b/debian/Dockerfile
index e5d410e..632a741 100644
--- a/debian/Dockerfile
+++ b/debian/Dockerfile
@@ -2,7 +2,7 @@
2FROM debian:stable-slim 2FROM debian:stable-slim
3 3
4ARG NIX_VERSION 4ARG NIX_VERSION
5ENV NIX_VERSION ${NIX_VERSION:-2.3.4} 5ENV NIX_VERSION ${NIX_VERSION:-2.3.9}
6ARG LANG 6ARG LANG
7ENV LANG ${LANG:-"en_US.UTF-8"} 7ENV LANG ${LANG:-"en_US.UTF-8"}
8 8
@@ -18,31 +18,31 @@ RUN addgroup --gid 30000 --system nixbld \
18USER nixuser 18USER nixuser
19ENV USER=nixuser 19ENV USER=nixuser
20ENV HOME="/home/nixuser" 20ENV HOME="/home/nixuser"
21ENV NIX_SYSTEM_PATH="/nix/var/nix/profiles/system"
22ENV NIX_PROFILE="$HOME/nix-envs"
21 23
22RUN cd && wget https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-x86_64-linux.tar.xz \ 24RUN cd && wget https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-x86_64-linux.tar.xz \
23 && tar xJf nix-*-x86_64-linux.tar.xz \ 25 && tar xJf nix-*-x86_64-linux.tar.xz \
24 && ~/nix-*-x86_64-linux/install \ 26 && NIX_PROFILE="$NIX_SYSTEM_PATH" ~/nix-*-x86_64-linux/install \
25 && rm -rf ~/nix-*-* 27 && rm -rf ~/nix-*-*
26 28
27ENV ENV="/home/nixuser/.nix-profile/etc/profile.d/nix.sh"
28RUN echo ". ${ENV}" >> ${HOME}/.profile
29# All subsequent "RUN" will use a login shell 29# All subsequent "RUN" will use a login shell
30SHELL ["/usr/bin/env", "bash", "-l", "-c"] 30SHELL ["/usr/bin/env", "bash", "-l", "-c"]
31 31
32RUN nix-channel --add https://nixos.org/channels/nixpkgs-19.09-darwin nixpkgs \ 32# Create bash profile
33 && nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable \ 33COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile
34
35RUN nix-channel --add https://nixos.org/channels/nixos-unstable nixpkgs \
34 && nix-channel --update 36 && nix-channel --update
35 37
36# Propagate UTF8 38# Propagate UTF8
37# https://github.com/NixOS/nix/issues/599#issuecomment-153885553 39# https://github.com/NixOS/nix/issues/599#issuecomment-153885553
38# The same is hapenning with stack2nix 40# The same is hapenning with stack2nix
39RUN nix-env -iA nixpkgs.glibcLocales 41RUN nix-env -p "$NIX_SYSTEM_PATH" -iA nixpkgs.glibcLocales
40 42
41# < Nix context as a volume 43# < Nix context as a volume
42# We want to be able to define /nix/store as a volume 44# We want to be able to define /nix/store as a volume
43VOLUME ["/nix"] 45VOLUME ["/nix"]
44# Create bash profile
45COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile
46# /> 46# />
47 47
48# Make sure to use "login" shell when running container 48# Make sure to use "login" shell when running container