Containerized D language compiler
7.7K

Docker image for the DMD Compiler, the reference compiler for the D Programming Language.
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/dmd-docker-image/-/issues
Supported architectures: (more info)
amd64 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. DMD is the official compiler that implements the D language.
starxen/dmd:lateststarxen/dmd:2.x.xstarxen/dmd:debianstarxen/dmd:debian-trixiestarxen/dmd:debian-bookwormstarxen/dmd:debian-bullseyestarxen/dmd:2.x.x-debianstarxen/dmd:2.x.x-debian-trixiestarxen/dmd:2.x.x-debian-bookwormstarxen/dmd:2.x.x-debian-bullseyestarxen/dmd:ubuntustarxen/dmd:ubuntu-noblestarxen/dmd:ubuntu-jammystarxen/dmd:ubuntu-focalstarxen/dmd:2.x.x-ubuntustarxen/dmd:2.x.x-ubuntu-noblestarxen/dmd:2.x.x-ubuntu-jammystarxen/dmd:2.x.x-ubuntu-focalstarxen/dmd:fedorastarxen/dmd:fedora-43starxen/dmd:fedora-42starxen/dmd:fedora-41starxen/dmd:2.x.x-fedorastarxen/dmd:2.x.x-fedora-43starxen/dmd:2.x.x-fedora-42starxen/dmd:2.x.x-fedora-41starxen/dmd:opensusestarxen/dmd:opensuse-leapstarxen/dmd:2.x.x-opensusestarxen/dmd:2.x.x-opensuse-leapstarxen/dmd:windowsstarxen/dmd:windows-ltsc2025starxen/dmd:windows-ltsc2022starxen/dmd:2.x.x-windowsstarxen/dmd:2.x.x-windows-ltsc2025starxen/dmd:2.x.x-windows-ltsc2022Docker image tags follow the format 2.x.x-x. The DMD 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 DMD version (2.x.x) will be updated to point to the latest build, while all iterated tags (2.x.x-x) will remain available for reference.
docker run --rm starxen/dmd dmd --version
This command will pull the DMD 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/dmd dmd 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/dmd rdmd hello.d
To keep a persistent environment with your project files:
docker run --rm -it -v ./:/src starxen/dmd bash
You can now run dmd 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/dmd:windows dmd test.d
.\test.exe
docker run --rm -v .\:C:\src starxen/dmd:windows rdmd test.d
docker run --rm -it -v .\:C:\src starxen/dmd:windows powershell
The image provides the following environment variables:
DMD_VERSION: Installed version of DMD.DMD_ITERATION: DMD image iteration.IMAGE_BASE_DISTRO: Specifies the base operating system distribution for the Docker image, such as DEBIAN, UBUNTU, FEDORA, OPENSUSE or WINDOWS.IMAGE_BASE_VERSION: Specifies the base operating system version for the Docker image, such as 13, 24.04, 43, 15 or LTSC2025.IMAGE_BASE_VERSION_NAME: Specifies the base operating system version name for the Docker image, such as TRIXIE, NOBLE, 41, LEAP or SERVERCORE.DMD is licensed under the Boost Software License 1.0. For more details, see the DMD License.
Content type
Image
Digest
sha256:e85f2d7de…
Size
1.7 GB
Last updated
6 months ago
docker pull starxen/dmd:windows-ltsc2022