Remove nix Docker image

This commit is contained in:
Pedro Pombeiro 2019-03-21 21:32:52 +01:00 committed by Jakub
parent e259d17cd6
commit 5f982e0595
6 changed files with 0 additions and 95 deletions

View File

@ -1,51 +0,0 @@
FROM ubuntu:16.04
ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
ARG NIX_VERSION
ARG JENKINS_UID
ARG JENKINS_GID
RUN apt-get update \
&& apt-get -q -y --no-install-recommends \
install file binutils make locales curl git strace jq bzip2 ca-certificates s3cmd \
&& apt-get clean \
&& locale-gen ${LANG} \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man
ADD nix-install-${NIX_VERSION}.sh /tmp/nix-install.sh
RUN groupadd --gid ${JENKINS_GID} jenkins \
&& useradd --shell /bin/bash --create-home --password "" \
--comment "jenkins" --groups root \
--uid ${JENKINS_UID} --gid ${JENKINS_GID} jenkins
# this special wrapper script runs sh inside of nix-shell
#ADD bash.sh /bin/bash
ADD nix.conf /home/jenkins/.config/nix/nix.conf
ADD default.nix /home/jenkins/default.nix
ADD default.nix /bin/default.nix
RUN mkdir /nix
RUN chown ${JENKINS_UID}:${JENKINS_GID} -R /nix /home/jenkins
WORKDIR /home/jenkins
USER jenkins
RUN export USER=jenkins \
&& /tmp/nix-install.sh \
&& . ~/.nix-profile/etc/profile.d/nix.sh \
&& nix-shell --run 'echo'
# hack to avoid calling login
ENV USER=jenkins
# make nix tools available by default
ENV PATH=/home/jenkins/.nix-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV NIX_PATH=nixpkgs=/home/jenkins/.nix-defexpr/channels/nixpkgs
ENV NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
MAINTAINER Jakub Sokolowski "jakub@status.im"
LABEL description="Adjusted Nix Docker image for use with Jenkins"

View File

@ -1,25 +0,0 @@
JENKINS_UID = 1001
JENKINS_GID = 1001
NIX_VERSION = 2.2.1
NIX_INSTALL = nix-install-$(NIX_VERSION).sh
NIX_SHA = 0039df605d2324f721f0c99ab76fc58fa60f791d84b30196eed805e8e65b1e51
NIX_URL = https://nixos.org/releases/nix/nix-$(NIX_VERSION)/install
IMAGE_TAG = jenkins
IMAGE_NAME = statusteam/nix:$(IMAGE_TAG)
build: $(NIX_INSTALL)
docker build \
--build-arg="JENKINS_UID=$(JENKINS_UID)" \
--build-arg="JENKINS_GID=$(JENKINS_GID)" \
--build-arg="NIX_VERSION=$(NIX_VERSION)" \
-t $(IMAGE_NAME) .
$(NIX_INSTALL):
wget -q "$(NIX_URL)" -O "$(NIX_INSTALL)"
echo "$(NIX_SHA) $(NIX_INSTALL)" | sha256sum --check
chmod +x "$(NIX_INSTALL)"
push: build
docker push $(IMAGE_NAME)

View File

@ -1,5 +0,0 @@
# Description
In order to make Nix work with Jenkins we have to make it possible to use it as Jenkins user.
For that reason we add `jenkins` user with the right UID and GID matching the ones on CI hosts.

View File

@ -1,2 +0,0 @@
#!/nix/var/nix/profiles/default/bin/nix-shell
exec bash "$@"

View File

@ -1,9 +0,0 @@
with import <nixpkgs> { };
stdenv.mkDerivation rec {
name = "env";
env = buildEnv { name = name; paths = buildInputs; };
buildInputs = with pkgs; [
bash
git
];
}

View File

@ -1,3 +0,0 @@
sandbox = false
extra-substituters = https://nix-cache.status.im
trusted-public-keys = nix-cache.status.im-1:x/93lOfLU+duPplwMSBR+OlY4+mo+dCN7n0mr4oPwgY= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=