Last active
February 5, 2019 16:32
-
-
Save mdjnewman/59fb5d37b76c07041463 to your computer and use it in GitHub Desktop.
Start ghci in a docker container with workspace mounted
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Ensure that docker is available and correctly configured if using boot2docker | |
docker ps > /dev/null | |
WORKSPACE_HOST_PATH=$(pwd) | |
WORKSPACE_CONTAINER_PATH=/workspace | |
mkdir -p $WORKSPACE_HOST_PATH | |
docker run -it --rm \ | |
-v $WORKSPACE_HOST_PATH:$WORKSPACE_CONTAINER_PATH \ | |
-w $WORKSPACE_CONTAINER_PATH \ | |
haskell:7.10 \ | |
ghci \ | |
"$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this script like so:
mkdir haskell-workspace cd haskell-workspace wget https://gist.githubusercontent.com/mdjnewman/59fb5d37b76c07041463/raw/ghci-docker.sh chmod u+x ghci-docker.sh ./ghci-docker.sh
If you see something that starts with 'GHCi, version 7.10.2', then you're good to go. Hit Ctrl-D or type :q to exit.