diff --git a/build/Dockerfile b/build/Dockerfile index 37c56ba..578e079 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -57,10 +57,35 @@ RUN curl -fsL --show-error ${URL} | tar xfz - -C /usr/share && \ chmod -R 755 /usr/share/scala && \ ln -s /usr/share/scala/bin/* /usr/local/bin -FROM scala AS lth +FROM scala AS haskell-init + +# Install required C libraries and build tools for Haskell/GHC +RUN apt-get install -y \ + build-essential \ + libgmp-dev \ + libffi-dev \ + libnuma-dev \ + zlib1g-dev \ + libtinfo-dev + +# Install ghcup and Haskell tools globally in /opt +ENV GHCUP_INSTALL_BASE_PREFIX=/opt +ENV PATH="/opt/.ghcup/bin:${PATH}" + +RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | \ + BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \ + BOOTSTRAP_HASKELL_GHC_VERSION=latest \ + BOOTSTRAP_HASKELL_CABAL_VERSION=latest \ + BOOTSTRAP_HASKELL_HLS_VERSION=latest \ + sh + +# Ensure the toolchain is readable and executable by all users +RUN chmod -R a+rX /opt/.ghcup + +FROM haskell-init AS lth # Clears apt lists -RUN rm -rf /var/lib/apt/lists/* +RUN rm -rf /var/lib/apt/lists/* # Adds the default User ARG USER=lth-student