3 ARG DEBIAN_FRONTEND=noninteractive
7 COPY ./shell.nix /builds/gargantext/shell.nix
8 COPY ./nix/pkgs.nix /builds/gargantext/nix/pkgs.nix
9 COPY ./nix/pinned-22.05.nix /builds/gargantext/nix/pinned-22.05.nix
12 RUN apt-get update && \
13 apt-get install --no-install-recommends -y \
33 software-properties-common \
40 apt-get clean && rm -rf /var/lib/apt/lists/* && \
41 mkdir -m 0755 /nix && groupadd -r nixbld && chown root /nix && \
42 for n in $(seq 1 10); do useradd -c "Nix build user $n" -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(command -v nologin)" "nixbld$n"; done
44 RUN gpg --batch --keyserver keys.openpgp.org --recv-keys 7D1E8AFD1D4A16D71FADA2F2CCC85C0E40C06A8C && \
45 gpg --batch --keyserver keyserver.ubuntu.com --recv-keys FE5AB6C91FEA597C3B31180B73EDE9E8CFBAEF01
46 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
48 RUN set -o pipefail && \
49 bash <(curl -L https://releases.nixos.org/nix/nix-2.15.0/install) --no-daemon && \
50 locale-gen en_US.UTF-8 && chown root -R /nix
52 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
55 RUN . "$HOME/.nix-profile/etc/profile.d/nix.sh" && \
56 mkdir -p "/builds/gargantext/" && chmod 777 -R "/builds/gargantext" && \
57 echo "source $HOME/.nix-profile/etc/profile.d/nix.sh" >> "$HOME/.bashrc" && \
60 ENV PATH=/root/.nix-profile/bin:$PATH
62 RUN . $HOME/.bashrc && nix-env --version
65 curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup && \
66 chmod +x /usr/bin/ghcup && \
67 ghcup config set gpg-setting GPGLax && \
68 ghcup -v install ghc --force ${GHC} && \
69 ghcup -v install cabal --force ${CABAL} && \
70 ghcup -v install stack --force ${STACK}
72 ENV PATH=/root/.ghcup/bin:$PATH
73 ENV PATH=/root/.local/bin:$PATH
76 RUN cd /builds/gargantext && nix-shell
77 RUN ghcup set 8.10.7 && cabal v2-update && cabal v2-install hpack --overwrite-policy=always
79 WORKDIR "/builds/gargantext/"