use alpine

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-03-01 20:03:33 +01:00
parent 451271bb18
commit de88db49ed
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020

View File

@ -1,20 +1,33 @@
ARG NIX_VERSION
FROM nixos/nix:${NIX_VERSION}
FROM alpine:3.9
ARG NIX_VERSION
ARG JENKINS_UID
ARG JENKINS_GID
RUN addgroup -g ${JENKINS_GID} jenkins \
&& adduser -D -u ${JENKINS_UID} -G jenkins jenkins \
-s /nix/var/nix/profiles/default/bin/nix-shell \
&& chown jenkins:jenkins -R /nix
COPY --from=nixos/nix /nix /nix
ADD nix.sh /etc/profile.d/nix.sh
ADD nix.conf /home/jenkins/.config/nix/nix.conf
ADD default.nix home/jenkins/default.nix
RUN chown ${JENKINS_UID}:${JENKINS_GID} -R /nix
RUN addgroup -g ${JENKINS_GID} jenkins
RUN adduser -D -g jenkins -u ${JENKINS_UID} -G jenkins jenkins
WORKDIR /home/jenkins
USER jenkins
ADD nix.conf /home/jenkins/.config/nix/nix.conf
ADD default.nix /home/jenkins/default.nix
RUN ln -s /nix/var/nix/profiles/default ~/.nix-profile
RUN echo $HOME
RUN echo $USER
RUN echo $PATH
RUN echo $SHELL
RUN nix-channel --add https://nixos.org/channels/nixos-19.03-small
RUN nix-channel --update
RUN nix-shell --run 'echo'
RUN echo 'exec /nix/var/nix/profiles/default/bin/nix-shell' > /etc/profile.d/nix-shell.sh
MAINTAINER Jakub Sokolowski "jakub@status.im"
LABEL description="Adjusted Nix Docker image for use with Jenkins"