Multi-arch Docker images for Idris 2, primarily aimed for devcontainers.
Architectures: amd64
, arm64
Idris Versions: v0.5.1
, v0.6.0
, v0.7.0
, latest
(Up to date with Idris2/main - recompiled daily)
The most common way of installing Idris2 on your computer is by building it from source, which is pretty time consuming. This projects aims to make that easier by leveraging pre-built Docker images with devcontainers.
- idris-2-docker/base - Base image with Idris2 installed from source (debian-based)
- idris-2-docker/devcontainer - Uses pack to install Idris and Idris-lsp. Also includes rlwrap.
An example Hello World project taken from the Getting Started Guide can be found in example. It uses Idris 0.7.0. To start, clone this repo and open the example folder (not the root!) in VSCode.
git clone [email protected]:joshuanianji/idris-2-docker.git
cd idris-2-docker/example
code .
Add devcontainers to your own project by copying the following contents to Dockerfile
in the root of your project:
FROM ghcr.io/joshuanianji/idris-2-docker/devcontainer:v0.7.0
Then, using Microsoft's Remote SSH tools, click "Reopen in container" and choose that Dockerfile.
You can also run the image directly from the command line.
docker run -it --rm ghcr.io/joshuanianji/idris-2-docker/ubuntu:v0.7.0 idris2 --version
Idris 2, version 0.5.1
docker run -it --rm --entrypoint /bin/bash ghcr.io/joshuanianji/idris-2-docker/debian:v0.7.0
$ idris2 --version
You can also use one of the images as a base image for your own Dockerfile.
FROM ghcr.io/joshuanianji/idris-2-docker/debian:v0.7.0
# ...
To run the images locally, I recommend opening the workspace in the Devcontainer to provide a fully-featured development environment. I made a scripts/build-image.py
which can build an image from from an idris version. You can also build the base image from an arbitrary SHA commit from the Idris2 repo.
This is the default behaviour when running the script.
# this is the only module we need, so i chose not to create a requirements.txt file
pip install -U requests
# builds base from latest commit on the Idris repo. Tag is base-latest
python scripts/build-image.py --image base
python scripts/build-image.py --image ubuntu
python scripts/build-image.py --image devcontainer --tag devcontainer-latest
python scripts/build-image.py --image base --version v0.7.0
python scripts/build-image.py --image base --sha 58e5d156621cfdd4c54df26abf7ac9620cfebdd8
python scripts/build-image.py --image devcontainer --version v0.7.0
We have some tests to ensure the docker images are working as expected, using bats. The bats CLI tool should already be installed in the devcontainer.
You'll need to install the bats-support
and bats-assert
libraries. I found the easiest way to do this was to clone via git:
git clone https://github.com/bats-core/bats-support test/test_helper/bats-support
git clone https://github.com/bats-core/bats-assert test/test_helper/bats-assert
To run a test on a specific image, set the required variables, and run the bats command. The following is an example for the base image
export LIB_PATH=$(pwd)/tests/test_helper
export DOCKER_IMAGE=
export IDRIS_VERSION=latest
bats tests/base.bats
- dgellow/idris-docker-image for giving me a starting point
- YBogomolov's Gist for Devcontainer pointers