2023-07-04 12:40:37 +03:00
|
|
|
FROM ubuntu:rolling
|
|
|
|
WORKDIR /workspaces
|
|
|
|
|
2023-08-03 00:23:06 +03:00
|
|
|
ARG PLATFORM="x86_64-linux"
|
|
|
|
ARG TARGET_PLATFORM=""
|
|
|
|
ARG COMPILER_NIX_NAME="ghc961"
|
|
|
|
ARG MINIMAL="true"
|
|
|
|
ARG IOG="false"
|
|
|
|
|
2024-02-27 15:45:59 +03:00
|
|
|
RUN DEBIAN_FRONTEND=noninteractive \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get -y install curl git jq nix zstd \
|
2023-07-04 12:40:37 +03:00
|
|
|
&& curl -L https://raw.githubusercontent.com/input-output-hk/actions/latest/devx/support/fetch-docker.sh -o fetch-docker.sh \
|
|
|
|
&& chmod +x fetch-docker.sh \
|
|
|
|
&& SUFFIX='' \
|
2023-08-03 00:23:06 +03:00
|
|
|
&& if [ "$MINIMAL" = "true" ]; then SUFFIX="${SUFFIX}-minimal"; fi \
|
|
|
|
&& if [ "$IOG" = "true" ]; then SUFFIX="${SUFFIX}-iog"; fi \
|
2024-04-03 19:33:03 +03:00
|
|
|
&& if [ "$IOG_FULL" = "true" ]; then SUFFIX="${SUFFIX}-iog-full"; fi \
|
2023-08-03 00:23:06 +03:00
|
|
|
&& ./fetch-docker.sh input-output-hk/devx $PLATFORM.$COMPILER_NIX_NAME$TARGET_PLATFORM${SUFFIX}-env | zstd -d | nix-store --import | tee store-paths.txt \
|
2024-02-27 15:45:59 +03:00
|
|
|
&& apt-get -y remove curl git jq nix zstd \
|
|
|
|
&& apt-get -y autoremove \
|
|
|
|
&& apt-get -y autoclean
|
2023-07-04 12:40:37 +03:00
|
|
|
|
|
|
|
# `tail -n 2 X | head -n 1` seems a bit fragile way to get `ghc8107-iog-env.sh` derivation path ...
|
|
|
|
RUN echo "source $(tail -n 2 store-paths.txt | head -n 1)" >> $HOME/.bashrc
|