A container refers to an isolated area of memory where application software and some drivers execute. A Development Container (or Dev Container for short) allows a container to be used as a full‑featured development environment.
Stack provides the following Dev Containers:
- a default Dev Container, intended for use with Stack's project‑level
- alternative Dev Containers, intended for use with Stack's experimental project‑level configurations (in anticipation of building Stack with more recent versions of GHC).
Stack's Dev Containers provide the following tools:
The tools in the Haskell Toolchain are installed at
/usr/local/bin. HLS is
provided in the default Dev Container only.
The PATH is
Consequently, executables installed with Cabal (the tool) (at
$HOME/.cabal/bin) or Stack or Pip (at
$HOME/.local/bin) take precedence
over the same executable installed at
VS Code is used as IDE, with the following extensions pre‑installed:
- Haskell (Default Dev Container only)
- GitHub Pull Requests and Issues
- GitLens — Git supercharged
- Pinned to version 11.7.0 due to unsolicited AI content in recent versions
- Git Graph
- Resource Monitor
Stack's Dev Containers are derived from Docker images that are used to build the statically linked Linux/x86_64 and Linux/AArch64 binary distributions of Stack.
The images contain unofficial binary distributions of GHC 9.4.7 and 9.6.2 (that is, ones not released by the GHC developers). That is because:
- the official GHC 9.6.2 binary distributions for Alpine Linux/x86_64 have known bugs; and
- there are no official binary distributions for Alpine Linux/AArch64.
Stack's global configuration (
install-ghc: false. That ensures that only the GHC available in the Dev
Containers is used.
You can run Dev Containers locally/remotely with VS Code, or create a GitHub Codespace for a branch in a repository to develop online.
Data in the following locations is persisted:
- The user's home directory (
/home/vscodeor, for the root user,
/root). Use with Docker/Podman in rootless mode.
- The Dev Container's workspace (
This is accomplished via either a volume or bind mount (or loop device on Codespaces) and is preconfigured.
The VS Code Command Palette command 'Codespaces: Full Rebuild Container' resets the home directory. This is never necessary unless you want exactly that.
Stack can be built with Stack (which is recommended) or with Cabal (the tool).
stack executable that can run on any Linux machine of the same
Default Dev Container only.
executable that can run on any Linux machine of the same architecture.
Haskell Language Server (HLS)¶
The Haskell Language Server and the Haskell extension are only available in the default Dev Container. In order to use the Haskell extension, you must first configure the project for the build tool of your choice.
See the documentation at
Contributing: Haskell Language Server
for cradles (
hie.yaml files) that should suffice to configure the HLS
./Setup.hs and each of the buildable components in Stack's
Manually via PATH when asked the following question: