Dockerfile linksDockerfile links4.7-v2.0634.8-v2.065, 4.9-v2.0654.8-v2.066, 4.9-v2.066The most straightforward way to use this image is to use a gdc container as both the build and runtime environment. In your Dockerfile, writing something along the lines of the following will compile and run your project:
FROM ibuclaw/gdc:4.9
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN gdc -o myapp main.d
CMD ["./myapp"]
Then, build and run the Docker image:
docker build -t my-gdc-app .
docker run -it --rm --name my-running-app my-gdc-app
There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp ibuclaw/gdc:4.9 \
gdc -o myapp myapp.d
This will add your current directory, as a volume, to the container, set the working directory to the volume, and run the command gdc -o myapp myapp.d. This tells gdc to compile the code in myapp.d and output the executable to myapp. Alternatively, if you have a Makefile, you can instead run the make command inside your container:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp ibuclaw/gdc:4.9 make
Content type
Image
Digest
sha256:4669b3207…
Size
267.2 MB
Last updated
almost 11 years ago
docker pull ibuclaw/gdc