https://github.com/lindt/docker-dmd
Docker Image for DMD
https://github.com/lindt/docker-dmd
compiler dlang dmd docker
Last synced: about 1 month ago
JSON representation
Docker Image for DMD
- Host: GitHub
- URL: https://github.com/lindt/docker-dmd
- Owner: lindt
- License: mit
- Created: 2016-10-29T10:39:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T10:56:20.000Z (almost 7 years ago)
- Last Synced: 2025-03-18T17:05:49.708Z (about 1 month ago)
- Topics: compiler, dlang, dmd, docker
- Language: Shell
- Homepage: https://hub.docker.com/r/dlanguage/dmd/
- Size: 52.7 KB
- Stars: 22
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://hub.docker.com/r/dlanguage/dmd/)
[](https://hub.docker.com/r/dlanguage/dmd/)
[](https://hub.docker.com/r/dlanguage/dmd/)# docker-dmd
Docker Image for DMD the Digital Mars [D](http://dlang.org) Compiler.
## Motivation
Installation of a compiler sometimes is cumbersome. This Docker image should take this pain and allow you to easily switch between Versions of the same compiler and even different compilers.
In case a native installation is required, `curl -fsS https://dlang.org/install.sh | bash -s dmd` could be used.
## Other Compilers
Allows to use all major D Compilers without installation.
| Compiler | Latest Tag |
| -------- | ---------- |
| DMD | [](https://hub.docker.com/r/dlanguage/dmd/) |
| LDC | [](https://hub.docker.com/r/dlanguage/ldc/) |
| GDC | [](https://hub.docker.com/r/dlanguage/gdc/) |## Usage
Place a `test.d` in your current directory.
```
import std.stdio;void main() {
writeln("Hello, World!");
}
```Then execute
```sh
docker run --rm -ti -v $(pwd):/src dlanguage/dmd dmd -run test.d
```This should plot:
```
Hello, World!
```If you are too lazy to create a file, you can compile directly from stdin:
```sh
echo 'void main(){import std.stdio; writeln("Hello World");}' | docker run --rm -i -v $(pwd):/src dlanguage/dmd dmd -run -
```