This repository forked out of https://github.com/ctrecordings/docker-ldc and https://github.com/lindt/docker-ldc repos.
Relevant contributors listed at:
- https://github.com/lindt/docker-ldc/graphs/contributors
- https://github.com/ctrecordings/docker-ldc/graphs/contributors
- https://github.com/vreitech/docker-ldc/graphs/contributors
Docker image for LLVM-based D compiler (also known as LDC2 or LDC).
Installation of a compiler sometimes is cumbersome. This Docker image should take this pain and allow you to easily switch between a versions of the compiler.
In case a native installation is required, curl -fsS https://dlang.org/install.sh | bash -s ldc could be used. You may also visit LLVM-based compiler Releases page on GitHub.
Docker image allows to use LDC compiler and dub package manager without installation.
- Debian 12 (bookworm) environment
- ldc2 compiler v1.40.0
- ld.gold linker
- ld.bfd linker
- dub package manager
- libxml2 library
- libz (zlib)
- libssl library
Epoch 1 images naming starts with v prefix. It's kind of "legacy" images which based on master branch at the moment of LDC2 verions release, and keeps unchanged (except for bugfixes).
Epoch 2 images naming starts with 2-v prefix. Epoch 2 images based on master branch from 19.05.2024, and contains all changes did in master branch till the date, including using setpriv instead of gosu, and aarch64 architecture support in addition to x86_64 (except for 2-v1.33.0 image).
Place a test.d (for example with the contents of import std.stdio; void main() { writeln("It works!"); }) in your current directory.
Then execute
docker run --rm -it -v "$(pwd):/src" docker.io/vreitech/docker-ldc:latest ldc2 test.d
or
docker run --rm -it -v "$(pwd):/src" ghcr.io/vreitech/docker-ldc:latest ldc2 test.d