|
1 |
| -# Use the [Choice] comment to indicate option arguments that should appear in VS Code UX |
2 |
| -# |
3 |
| -# [Choice] Haskell version: 9, 8 |
4 |
| -ARG VARIANT=8 |
5 |
| -FROM haskell:${VARIANT} |
| 1 | +FROM debian:bullseye-slim |
| 2 | + |
| 3 | +ENV LANG C.UTF-8 |
6 | 4 |
|
7 |
| -# Use the [Option] comment to specify true/false arguments that should appear in VS Code UX |
8 |
| -# |
9 | 5 | # [Option] Install zsh
|
10 | 6 | ARG INSTALL_ZSH="true"
|
11 | 7 | # [Option] Upgrade OS packages to their latest versions
|
12 | 8 | ARG UPGRADE_PACKAGES="false"
|
13 | 9 |
|
14 |
| -# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies |
| 10 | +# Install needed packages and setup non-root user. |
| 11 | +# Use a separate RUN statement to add your own dependencies |
15 | 12 | ARG USERNAME=vscode
|
16 | 13 | ARG USER_UID=1000
|
17 | 14 | ARG USER_GID=$USER_UID
|
18 | 15 | COPY library-scripts/*.sh /tmp/library-scripts/
|
19 |
| -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
| 16 | +RUN apt-get update \ |
| 17 | + && export DEBIAN_FRONTEND=noninteractive \ |
20 | 18 | && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true"\
|
21 |
| - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts |
| 19 | + && rm -rf /tmp/library-scripts \ |
| 20 | + && apt-get install -y --no-install-recommends \ |
| 21 | + dpkg-dev \ |
| 22 | + gcc \ |
| 23 | + libc6-dev \ |
| 24 | + libffi-dev \ |
| 25 | + libgmp-dev \ |
| 26 | + libnuma-dev \ |
| 27 | + libtinfo-dev \ |
| 28 | + zlib1g-dev \ |
| 29 | + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* |
| 30 | + |
| 31 | +# Install latest GHCup in the non-root user home |
| 32 | +USER $USERNAME |
| 33 | + |
| 34 | +RUN mkdir -p "$HOME/.ghcup/bin" \ |
| 35 | + && curl -LJ "https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup" -o "$HOME/.ghcup/bin/ghcup" \ |
| 36 | + && chmod +x "$HOME/.ghcup/bin/ghcup" |
| 37 | +ENV PATH="/home/$USERNAME/.cabal/bin:/home/$USERNAME/.ghcup/bin:$PATH" |
| 38 | + |
| 39 | +# [Choice] GHC version: recommended, latest, 9.2, 9.0, 8.10, 8.8, 8.6 |
| 40 | +ARG GHC_VERSION="recommended" |
22 | 41 |
|
23 |
| -# [Optional] Uncomment this section to install additional OS packages. |
24 |
| -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
25 |
| -# && apt-get -y install --no-install-recommends <your-package-list-here> |
| 42 | +# Use GHCup to install versions of main utilities |
| 43 | +# If you prefer to let the Haskell extension install everything on demand, |
| 44 | +# comment out the lines below. In that case, you may need to manually run "cabal update""." |
| 45 | +RUN ghcup install ghc "${GHC_VERSION}" --set \ |
| 46 | + && ghcup install cabal recommended --set \ |
| 47 | + && ghcup install stack recommended --set \ |
| 48 | + && ghcup install hls recommended --set \ |
| 49 | + && cabal update |
0 commit comments