aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorpaulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com>2018-10-31 12:03:27 +0100
committerGitHub <noreply@github.com>2018-10-31 12:03:27 +0100
commit7a524a48c137ec0941c62bb010c2cdf37ed00826 (patch)
treea5c273f908a5a5a7e8c6dd0af8b3f0d98e4d50bb
parentdedbcf1564d728be9e5bc359244b4ffba7665615 (diff)
parent0366f366617a0a5c36d365c56a2c1178fd19ed94 (diff)
downloaddocker-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
-rw-r--r--.travis.yml7
-rw-r--r--alpine/Dockerfile (renamed from Dockerfile)0
-rw-r--r--debian/Dockerfile40
3 files changed, 46 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 8b3769d..32a66bb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,12 @@ addons:
8 packages: 8 packages:
9 - docker-ce 9 - docker-ce
10 10
11matrix:
12 include:
13 - env: BASE_OS=alpine
14 - env: BASE_OS=debian
15
11script: 16script:
12 - docker build --pull -t fretlink/nix . 17 - docker build --pull -t fretlink/nix ${BASE_OS}/
13 - docker run -it --rm fretlink/nix 'nix-channel --list' 18 - docker run -it --rm fretlink/nix 'nix-channel --list'
14 - docker run -it --rm fretlink/nix 'nix-env -iA nixpkgs.hello && test "$(hello)" = "Hello, world!"' 19 - docker run -it --rm fretlink/nix 'nix-env -iA nixpkgs.hello && test "$(hello)" = "Hello, world!"'
diff --git a/Dockerfile b/alpine/Dockerfile
index 5aa7fcc..5aa7fcc 100644
--- a/Dockerfile
+++ b/alpine/Dockerfile
diff --git a/debian/Dockerfile b/debian/Dockerfile
new file mode 100644
index 0000000..6c09f82
--- /dev/null
+++ b/debian/Dockerfile
@@ -0,0 +1,40 @@
1# Dockerfile to create an environment that contains the Nix package manager.
2FROM debian:stable-slim
3
4ARG NIX_VERSION
5ENV NIX_VERSION ${NIX_VERSION:-2.1.3}
6ARG LANG
7ENV LANG ${LANG:-"en_US.UTF-8"}
8
9RUN addgroup --gid 30000 --system nixbld \
10 && for i in $(seq 1 30); do adduser --system --disabled-password --home /var/empty --gecos "Nix build user $i" --uid $((30000 + i)) --ingroup nixbld nixbld$i ; done \
11 && adduser --disabled-password nixuser \
12 && mkdir -m 0755 /nix && chown nixuser /nix \
13 && apt update && apt install -y wget bzip2 \
14 && apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
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# All subsequent "RUN" will use a login shell
28SHELL ["/usr/bin/env", "bash", "-l", "-c"]
29
30RUN 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
36RUN 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
40ENTRYPOINT ["/usr/bin/env", "bash", "-l", "-c"]