Sign inSign up

fenedor/vscode-hie-devcontainer-ase

By fenedor

•Updated over 6 years ago

Experimental Haskell IDE Engine Dev Container for VSCode.

Image
0

562

fenedor/vscode-hie-devcontainer-ase repository overview

Experimental HIE Container for vscode. Use at your own risk.

Dockerfile:

FROM nixos/nix

# 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=1000
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-alpine.sh"
ARG COMMON_SCRIPT_SHA="dev-mode"


RUN nix-channel --add https://nixos.org/channels/nixos-19.09 nixpkgs
RUN nix-channel --update
RUN nix-env -iA cachix -f https://cachix.org/api/v1/install && cachix use all-hies \
    # Install GHC 8.6.5
    && nix-env -f '<nixpkgs>' -iA ghc haskellPackages.cabal-install haskellPackages.hoogle  haskellPackages.cabal-plan
    # Install HIE for GHC 8.6.5

RUN nix-env -iA selection --arg selector 'p: { inherit (p) ghc865 ; }' -f https://github.com/infinisil/all-hies/tarball/master

RUN apk update \
    && apk add --no-cache wget coreutils ca-certificates \
    && wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE \
    && if [ "$COMMON_SCRIPT_SHA" != "dev-mode" ]; then echo "$COMMON_SCRIPT_SHA /tmp/common-setup.sh" | sha256sum -c - ; fi \
    && /bin/ash /tmp/common-setup.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID" \
    && rm /tmp/common-setup.sh \
    && cabal user-config update -f && cabal update \
    && hoogle generate

devcontainer.json

{
    "name": "GHC 8.6.5 with HIE",
    "dockerFile": "Dockerfile",
    "runArgs": [],

    // Use 'settings' to set *default* container specific settings.json values on container create.
    // You can edit these settings after create using File > Preferences > Settings > Remote.
    "settings": {
        "terminal.integrated.shell.linux": "/bin/bash"
    },

    // Use 'appPort' to create a container with published ports. If the port isn't working, be sure
    // your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost.
    // "appPort": [],

    // Uncomment the next line to run commands after the container is created.
    // "postCreateCommand": "gcc -v",

    // Comment out the next line if you want to run as root instead
    "remoteUser": "vscode",

    // Add the IDs of extensions you want installed when the container is created in the array below.
    "extensions": [
        "alanz.vscode-hie-server"
    ]
}

Interactive command:

docker run -it --rm --mount type=bind,source=$(pwd),target=/home/test/ fenedor/vscode-hie-devcontainer-ase /bin/bash

Tag summary

Content type

Image

Digest

Size

1.7 GB

Last updated

over 6 years ago

docker pull fenedor/vscode-hie-devcontainer-ase