From 1a92d9b0cae9a8a013cce4c71f66075a096e8745 Mon Sep 17 00:00:00 2001 From: Sebastian Steger Date: Thu, 29 Oct 2026 19:45:38 +0000 Subject: [PATCH] Update Dockerfile and devcontainer.json for improved Haskell setup --- haskell/.devcontainer/Dockerfile | 47 ++++++++++++++++++++----- haskell/.devcontainer/devcontainer.json | 18 ++++++---- 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/haskell/.devcontainer/Dockerfile b/haskell/.devcontainer/Dockerfile index cfa1e8f..cd4c858 100644 --- a/haskell/.devcontainer/Dockerfile +++ b/haskell/.devcontainer/Dockerfile @@ -1,10 +1,41 @@ -FROM ubuntu:24.04 +FROM ubuntu:26.04 -RUN apt-get update && apt-get install -y build-essential curl libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev -RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh -ENV PATH="$PATH:/root/.ghcup/bin" -RUN ghcup install hls -RUN apt-get update && apt-get install -y git zlib1g-dev -RUN cabal update && cabal install ghci-dap haskell-debug-adapter -RUN cabal update && cabal install --lib HUnit +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + libffi-dev \ + libffi8ubuntu1 \ + libgmp-dev \ + libgmp10 \ + libncurses-dev \ + git \ + zlib1g-dev \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y \ + locales \ + && locale-gen en_US.UTF-8 \ + && update-locale LANG=en_US.UTF-8 \ + && rm -rf /var/lib/apt/lists/* + +USER ubuntu + +ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \ + BOOTSTRAP_HASKELL_INSTALL_HLS=1 \ + BOOTSTRAP_HASKELL_GHC_VERSION=recommended \ + BOOTSTRAP_HASKELL_CABAL_VERSION=recommended + +RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh \ + && ~/.ghcup/bin/ghcup gc -c -t \ + && rm -rf ~/.ghcup/cache/* \ + && find ~/.ghcup/ -name "*.tar.xz" -delete \ + && find ~/.ghcup/ -name "*.tar.gz" -delete \ + && find ~/.ghcup/ -type d -name "doc" -exec rm -rf {} + \ + && find ~/.ghcup/ -name "*_p.a" -delete \ + && rm -rf ~/.cabal/packages/* + +ENV PATH="$PATH:/home/ubuntu/.ghcup/bin" + +RUN cabal update && cabal install --lib HUnit \ + && rm -rf ~/.cabal/packages/* diff --git a/haskell/.devcontainer/devcontainer.json b/haskell/.devcontainer/devcontainer.json index 7703059..a27a83a 100644 --- a/haskell/.devcontainer/devcontainer.json +++ b/haskell/.devcontainer/devcontainer.json @@ -3,10 +3,14 @@ "build": { "dockerfile": "Dockerfile" }, - "customizations": { - "vscode": { "extensions": [ - "haskell.haskell", - "phoityne.phoityne-vscode" - ]} - } -} + "customizations": { + "vscode": { + "extensions": [ + "haskell.haskell", + "phoityne.phoityne-vscode" + ] + } + }, + "remoteUser": "ubuntu", + "updateRemoteUserUID": true +} \ No newline at end of file