Sign inSign up

bjing/haskell-dev-container

By bjing

•Updated 3 months ago

A container with common Haskell dev tools readily available

Image
1

1.6K

bjing/haskell-dev-container repository overview

⁠Introduction

This provides a Docker container image that includes common Haskell build tools so that you can start developing and building your Haskell app right away without setting up a local dev environment.

Tools included in containser:

  • GHC (depending on the image tag you select)
  • cabal (ghcup recommended version)
  • stack (ghcup recommended version)
  • haskell language server (ghcup recommended version)
  • git and scm_breeze
  • Vim (see section Setup Haskell IDE in VIM)

⁠How to Use it

⁠VSCode

Install extension DevContainers⁠.

Copy directory .devcontainer/⁠ to your Haskell project's root directory. Change the docker image tag in .devcontainer⁠ as you see fit.

Bring up Command palette, and run Dev Containers: Open Folder in Container.

Now you can build the project in VSCode's terminal using either cabal or stack.

⁠Command line

Go to the Haskell project you're working on in the terminal:

cd my-haskell-project

Then start the dev container and mount the project into it: code is a pre-created user in the container:

docker run -d --rm --name haskell-dev-container -v .:/home/code/app bjing/haskell-dev-container:latest

Get into the container by running:

docker exec -it haskell-dev-container bash

Now you're inside the container with the project directory mounted. You can use either cabal or stack depending on what you're using to build your project. For example:

stack build

⁠How to add tools that I need?

If you need tools that are not provided by the container, simply installed it through Debian's apt package manager, e.g.

sudo apt install <package_name>

Since the container user code has sudo privilege, you can install any tools you want.

⁠Extras

⁠Setup Haskell IDE in VIM

The container image provides setup script for VIM Haskell IDE.

Simply run the setup script in /home/code/install:

cd ~/install
./setup_vim.sh
⁠Source repo

https://github.com/bjing/haskell-dev-container⁠

Tag summary

Content type

Image

Digest

sha256:10a1e0027…

Size

1.7 GB

Last updated

3 months ago

docker pull bjing/haskell-dev-container