-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
70 lines (56 loc) · 1.87 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Base image providing the basic dependencies
# extended by the builder and final image
FROM ubuntu:16.04 as base
MAINTAINER "Sebastian Wilzbach <seb@wilzba.ch>"
RUN apt-get update && apt-get install --no-install-recommends -y \
aria2 \
ca-certificates \
curl \
gcc \
libc-dev
# Temporary environment to build the tools
FROM base as builder
RUN apt-get install --no-install-recommends -y \
gnupg \
libxml2 \
make \
patch \
xz-utils \
&& curl -L -O https://dlang.org/install.sh \
&& bash install.sh -p /work install ldc-1.26.0
COPY ae /work/build/ae
COPY misc /work/build/misc
COPY Makefile *.patch /work/build/
RUN . /work/ldc*/activate \
&& make -C /work/build \
&& mkdir -p /dlang \
&& cp /work/build/bin/dver /dlang/dver \
&& cp /work/build/bin/dreg /dlang/dreg \
# If required by further steps
# && mv /work/ldc* /ldc \
# && chmod a=+rx /ldc \
&& rm -rf /work
# Final image providing the collection of different compiler versions
FROM base as final
# ENV PATH=/ldc/bin:${PATH}
COPY --from=builder /dlang /dlang
COPY VERSIONS.txt ./
RUN while read -r ver ; do \
/dlang/dver -d $ver echo downloaded $ver ; \
done < VERSIONS.txt \
&& find /dlang -name "*.zip" | xargs rm -rf \
&& find /dlang \( -type d -and \! -type l -and -path "*/bin32" -or -path "*/lib32" -or -path "*/html" \) | xargs rm -rf \
&& find /dlang -name "dustmite" | xargs rm -rf \
&& find /dlang -name "obj2asm" | xargs rm -rf \
&& find /dlang -name "dub" | xargs rm -rf \
&& find /dlang -name "dman" | xargs rm -rf \
&& find /dlang -name "rdmd" | xargs rm -rf \
&& find /dlang -name "ddemangle" | xargs rm -rf \
&& find /dlang -name "dumpobj" | xargs rm -rf \
&& apt-get auto-remove -y curl ca-certificates aria2
ENV PATH=/dlang:${PATH}
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN mkdir /sandbox && chown nobody:nogroup /sandbox
USER nobody
ENTRYPOINT [ "/entrypoint.sh" ]