starxen/ldc

By starxen

Updated 4 months ago

Containerized D language compiler

Image
Languages & frameworks
Developer tools
0

4.8K

starxen/ldc repository overview

Logo

LDC (LLVM-based D Compiler)

Docker image for the LDC Compiler, the LLVM-based D Programming Language Compiler.

Quick reference

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 riscv64 windows-amd64

Build Process Source Codes:
You can find the source code for the build process at:
GitLab Repository

Published Image Artifact Details:

What is D?

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.

Debian-based tags:
Ubuntu-based tags:
Windows-based tags:

Iteration tag policy

Docker 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.

Deb packages

During the build process, .deb packages [x86 arm risc-v] are also generated and made available for download. They are available on the release page on GitLab.

How to use this image

Check LDC version
docker run --rm starxen/ldc ldc2 --version

This command will pull the LDC image and print the installed version.

Running a simple D program

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
Persistent compilation environment

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.

Using a Windows image

If you want to use a Windows-based image, below are the Windows equivalents of the above commands.

Compile
docker run --rm -v .\:C:\src starxen/ldc:windows ldc2 hello.d
Run
.\test.exe
Built-in command to compile and run
docker run --rm -v .\:C:\src starxen/ldc:windows rdmd hello.d
Persistent compilation environment
docker run --rm -it -v .\:C:\src starxen/ldc:windows powershell
Environment Variables

The image provides the following environment variables:

  • LDC_VERSION: Installed version of LDC.
  • LDC_ITERATION: LDC image iteration.
  • IMAGE_ARCH: Image architecture, such as X86, ARM or RISC-V.
  • IMAGE_BASE_DISTRO: Specifies the base operating system distribution for the Docker image, such as DEBIAN, UBUNTU or WINDOWS.
  • IMAGE_BASE_VERSION: Specifies the base operating system version for the Docker image, such as 13, 24.04 or LTSC2025.
  • IMAGE_BASE_VERSION_NAME: Specifies the base operating system version name for the Docker image, such as TRIXIE, NOBLE or SERVERCORE.
Windows Only
  • DOTNET_FRAMEWORK_VERSION: Installed version of .NET Framework.
License

LDC is released under the "three-clause BSD" LDC license. For more details, see the LDC License.

More Information

Backers

  • laserovsky.net for hosting GitLab Runners used for building and publishing Docker images.

Tag summary

Content type

Image

Digest

sha256:0f39cbb3f

Size

3.9 GB

Last updated

4 months ago

docker pull starxen/ldc:windows