digitalmars.D.learn - DMD docker image
- Jan =?UTF-8?B?SMO2bmln?= (21/21) Jan 17 2020 I have created a docker image.
- Andre Pany (9/30) Jan 17 2020 If you really need small images, you could switch to Alpine, but
- Jan =?UTF-8?B?SMO2bmln?= (6/15) Jan 18 2020 I just wanted to know, whether i am doing something completely
- Andre Pany (5/23) Jan 18 2020 You might also use debian:slim as base image, which might reduce
- Mathias Lang (11/32) Jan 19 2020 If you want a small image, Alpine Linux is definitely the way to
I have created a docker image.
However the image size is not small (~500MB).
I wonder if others have a suitable dockerfile.
All i want is to install the current dmd release.
Does somebody have something similar?
Does somebody need something similar?
My dockerfile:
```
FROM ubuntu:latest
MAINTAINER Jan Hönig <jan.hoenig fau.de>
RUN apt-get update && apt-get install curl build-essential -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN latest=$(curl -sS http://downloads.dlang.org/releases/LATEST)
\
&& echo "DMD Release: $latest" \\
&& curl
"http://downloads.dlang.org/releases/2020/dmd_${latest}-0_amd64.deb" -o dmd.deb
\
&& dpkg -i "dmd.deb" \
&& rm "dmd.deb"
```
Jan 17 2020
On Friday, 17 January 2020 at 16:43:17 UTC, Jan Hönig wrote:
I have created a docker image.
However the image size is not small (~500MB).
I wonder if others have a suitable dockerfile.
All i want is to install the current dmd release.
Does somebody have something similar?
Does somebody need something similar?
My dockerfile:
```
FROM ubuntu:latest
MAINTAINER Jan Hönig <jan.hoenig fau.de>
RUN apt-get update && apt-get install curl build-essential -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN latest=$(curl -sS
http://downloads.dlang.org/releases/LATEST) \
&& echo "DMD Release: $latest" \\
&& curl
"http://downloads.dlang.org/releases/2020/dmd_${latest}-0_amd64.deb" -o
dmd.deb \
&& dpkg -i "dmd.deb" \
&& rm "dmd.deb"
```
If you really need small images, you could switch to Alpine, but
MUSL c could lead to headaches ;)
There are also the official docker images
https://hub.docker.com/u/dlang2
What is your goal? Do you want to compile s.th. in your docker
image? Then you can have a layered docker file to reduce the size.
Kind regards
Andre
Jan 17 2020
On Friday, 17 January 2020 at 17:31:29 UTC, Andre Pany wrote:If you really need small images, you could switch to Alpine, but MUSL c could lead to headaches ;) There are also the official docker images https://hub.docker.com/u/dlang2 What is your goal? Do you want to compile s.th. in your docker image? Then you can have a layered docker file to reduce the size. Kind regards AndreI just wanted to know, whether i am doing something completely wrong. Oh i haven't found these docker images. I did only search for "dlang" not "dlang2". Thanks a lot!
Jan 18 2020
On Saturday, 18 January 2020 at 13:58:01 UTC, Jan Hönig wrote:On Friday, 17 January 2020 at 17:31:29 UTC, Andre Pany wrote:You might also use debian:slim as base image, which might reduce the size. Kind regards AndreIf you really need small images, you could switch to Alpine, but MUSL c could lead to headaches ;) There are also the official docker images https://hub.docker.com/u/dlang2 What is your goal? Do you want to compile s.th. in your docker image? Then you can have a layered docker file to reduce the size. Kind regards AndreI just wanted to know, whether i am doing something completely wrong. Oh i haven't found these docker images. I did only search for "dlang" not "dlang2". Thanks a lot!
Jan 18 2020
On Friday, 17 January 2020 at 16:43:17 UTC, Jan Hönig wrote:
I have created a docker image.
However the image size is not small (~500MB).
I wonder if others have a suitable dockerfile.
All i want is to install the current dmd release.
Does somebody have something similar?
Does somebody need something similar?
My dockerfile:
```
FROM ubuntu:latest
MAINTAINER Jan Hönig <jan.hoenig fau.de>
RUN apt-get update && apt-get install curl build-essential -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN latest=$(curl -sS
http://downloads.dlang.org/releases/LATEST) \
&& echo "DMD Release: $latest" \\
&& curl
"http://downloads.dlang.org/releases/2020/dmd_${latest}-0_amd64.deb" -o
dmd.deb \
&& dpkg -i "dmd.deb" \
&& rm "dmd.deb"
```
If you want a small image, Alpine Linux is definitely the way to
go.
You can find `gcc-gdc` (however it's an old frontend, v2.076) in
Alpine Linux's main repository.
Additionally, if you can find the latest `ldc` in the `testing`
repository
(https://forum.dlang.org/thread/oznltcuropwzxaakptdy forum.dlang.org).
I intend to add DMD, just didn't have to get to it yet. If you
want to do it yourself, here's the APKBUILD:
https://gitlab.alpinelinux.org/alpine/aports/merge_requests/2880
Jan 19 2020









Andre Pany <andre s-e-a-p.de> 