Containerized D language compiler
10K+

Docker image for the LDC Compiler, the LLVM-based D Programming Language Compiler.
Maintained by:
Where to get help:
the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow
Where to file issues:
https://gitlab.com/starxen/ldc-docker-image/-/issues
Supported architectures: (more info)
amd64 arm64 arm32v6 arm32v7 ppc64le riscv64 loong64 windows-amd64
Build Process Source Codes:
You can find the source code for the build process at:
GitLab Repository
Published Image Artifact Details:
D is a systems programming language that combines the power and high-performance of languages like C and C++ with the productivity and ease of use of modern languages like Python or JavaScript. LDC is LLVM-based compiler that implements the D language.
Which base OS images are built for which architecture. ✓ = available; — = not applicable (that OS doesn't target that architecture); ✗ = currently blocked.
| OS | amd64 | arm64 | arm32v7 | arm32v6 | ppc64le | riscv64 | loong64 |
|---|---|---|---|---|---|---|---|
| Debian 13 Trixie | ✓ | ✓ | ✓ | — | ✗ | ✓ | — |
| Ubuntu 26.04 Resolute | ✓ | ✓ | ✓ | — | ✓ | ✓ | — |
| Fedora 44 | ✓ | ✓ | — | — | ✓ | — | — |
| Raspberry Pi OS 13 Trixie | — | ✓ | — | ✓ | — | — | — |
| Alpine 3.24 | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✓ |
| Windows Server LTSC2025 | ✓ | ✗ | — | — | — | — | — |
starxen/ldc:lateststarxen/ldc:1.x.xstarxen/ldc:1.x.x-xstarxen/ldc:debianstarxen/ldc:debian-trixiestarxen/ldc:1.x.x-debianstarxen/ldc:1.x.x-x-debianstarxen/ldc:1.x.x-debian-trixiestarxen/ldc:1.x.x-x-debian-trixiestarxen/ldc:ubuntustarxen/ldc:ubuntu-resolutestarxen/ldc:1.x.x-ubuntustarxen/ldc:1.x.x-x-ubuntustarxen/ldc:1.x.x-ubuntu-resolutestarxen/ldc:1.x.x-x-ubuntu-resolutestarxen/ldc:fedorastarxen/ldc:fedora-44starxen/ldc:1.x.x-fedorastarxen/ldc:1.x.x-x-fedorastarxen/ldc:1.x.x-fedora-44starxen/ldc:1.x.x-x-fedora-44starxen/ldc:raspiosstarxen/ldc:raspios-trixiestarxen/ldc:1.x.x-raspiosstarxen/ldc:1.x.x-x-raspiosstarxen/ldc:1.x.x-raspios-trixiestarxen/ldc:1.x.x-x-raspios-trixiestarxen/ldc:alpinestarxen/ldc:alpine-3-24starxen/ldc:1.x.x-alpinestarxen/ldc:1.x.x-x-alpinestarxen/ldc:1.x.x-alpine-3-24starxen/ldc:1.x.x-x-alpine-3-24starxen/ldc:windowsstarxen/ldc:windows-ltsc2025starxen/ldc:1.x.x-windowsstarxen/ldc:1.x.x-windows-ltsc2025starxen/ldc:1.x.x-x-windowsstarxen/ldc:1.x.x-x-windows-ltsc2025Docker image tags follow the format 1.x.x-x. The LDC version refers to the application version and remains unchanged, while the iteration indicates updates or fixes in the Docker build process. When a new image is released, the tag with the LDC version (1.x.x) will be updated to point to the latest build, while all iterated tags (1.x.x-x) will remain available for reference.
During the build process, .deb packages [amd64 arm64 riscv64 arm32v6 arm32v7 ppc64le], .rpm packages [amd64 arm64 ppc64le] and .apk packages [amd64 arm64 loong64] for Alpine Linux (musl libc) are also generated and made available for download. They are available on the release page on GitLab. Install .apk packages with apk add --allow-untrusted <package>.apk.
docker run --rm starxen/ldc ldc2 --version
This command will pull the LDC image and print the installed version.
Create a hello.d file with the following content:
import std.stdio;
void main() {
writeln("Hello, World!");
}
Compile your program inside the container:
docker run --rm -v ./:/src starxen/ldc ldc2 hello.d
After compilation, a file named hello will be created. It can be executed:
./hello
Or use the built-in command to compile and run your program:
docker run --rm -v ./:/src starxen/ldc rdmd hello.d
To keep a persistent environment with your project files:
docker run --rm -it -v ./:/src starxen/ldc bash
You can now run ldc commands interactively within the container.
If you want to use a Windows-based image, below are the Windows equivalents of the above commands.
docker run --rm -v .\:C:\src starxen/ldc:windows ldc2 hello.d
.\test.exe
docker run --rm -v .\:C:\src starxen/ldc:windows rdmd hello.d
docker run --rm -it -v .\:C:\src starxen/ldc:windows powershell
The image provides the following environment variables:
LDC_VERSION: Installed version of LDC.LDC_ITERATION: LDC image iteration.IMAGE_ARCH: Image architecture, such as AMD64, ARM64, ARM32V6, ARM32V7, PPC64LE, RISCV64 or LOONG64.IMAGE_BASE_DISTRO: Specifies the base operating system distribution for the Docker image, such as DEBIAN, UBUNTU, FEDORA, RASPIOS, ALPINE or WINDOWS.IMAGE_BASE_VERSION: Specifies the base operating system version for the Docker image, such as 13, 26.04, 44, 3.24 or LTSC2025.IMAGE_BASE_VERSION_NAME: Specifies the base operating system version name for the Docker image, such as TRIXIE, RESOLUTE, 44, 3.24 or SERVERCORE.DOTNET_FRAMEWORK_VERSION: Installed version of .NET Framework.LDC is released under the "three-clause BSD" LDC license. For more details, see the LDC License.
Content type
Image
Digest
sha256:d699860b7…
Size
301 MB
Last updated
6 days ago
docker pull starxen/ldc