hmemcpy / haskell-hie-devcontainer

A DevContainer for VSCode, for installing GHC 8.6.5, HIE (Haskell IDE Engine) and the required plugins
MIT License
165 stars 37 forks source link

Upstream container is Ubuntu, not APK. #1

Open jamesloosli opened 4 years ago

jamesloosli commented 4 years ago

Tried to get this working via the directions you posted on your blog; https://hmemcpy.com/2020/02/setting-up-a-haskell-development-environment-in-minutes-in-vscode/

It looks like the upstream container hmemcpy/hie is ubuntu based, so apk isn't exactly present. Are you planning on moving the upstream container to alpine, or retooling this vscode devcontainer to use ubuntu? I can help either way, lmk.

OleRoel commented 4 years ago

This Dockerfile is working for me

FROM hmemcpy/hie:8.6.5

# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=2001
ARG USER_GID=$USER_UID

# Set to false to skip installing zsh and Oh My ZSH!
ARG INSTALL_ZSH="false"

# Location and expected SHA for common setup script - SHA generated on release
ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
ARG COMMON_SCRIPT_SHA="dev-mode"

# Configure apt and install packages
RUN apt-get update \
    && apt-get install -y wget coreutils ca-certificates \
    && wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE \
    && /bin/bash /tmp/common-setup.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID" \
    && rm /tmp/common-setup.sh

Note the ARG USER_UID=2001, the uid 1000 and 1001 are already taken, creating a failed build. So I took a bigger jump.

hmemcpy commented 4 years ago

Yeah, sorry about that. I realized that my initial container installs Nix in a single-user mode under root, and by adding the extra user vscode it didn't have a profile for it, so none of the nix commands worked if you wanted to run them inside the container.

I was experimenting with another configuration, possibly not needing the vscode user altogether, but I realize this might have broken some people.

Still figuring out :)

OleRoel commented 4 years ago

@hmemcpy True, ghc and ghci are not in the $PATH and cannot be resolved.

With...

FROM haskell:8
...

is compiling possible again.