-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (46 loc) · 1.9 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
FROM ubuntu:16.04
MAINTAINER Stefan Rohe <[email protected]>
ENV \
COMPILER=gdc \
COMPILER_VERSION=4.8.5
RUN apt-get update && apt-get install -y curl build-essential \
&& curl -fsS -o /tmp/install.sh https://dlang.org/install.sh \
&& bash /tmp/install.sh -p /dlang install "${COMPILER}-${COMPILER_VERSION}" \
&& rm /tmp/install.sh \
&& apt-get auto-remove -y curl build-essential \
&& apt-get install -y gcc \
&& rm -rf /var/cache/apt \
&& rm -rf /dlang/${COMPILER}-*/linux/bin32 \
&& rm -rf /dlang/${COMPILER}-*/linux/lib32 \
&& rm -rf /dlang/${COMPILER}-*/html \
&& rm -rf /dlang/dub-1.0.0/dub.tar.gz
ENV \
PATH=/dlang/${COMPILER}-${COMPILER_VERSION}/bin:${PATH} \
LD_LIBRARY_PATH=/dlang/${COMPILER}-${COMPILER_VERSION}/lib \
LIBRARY_PATH=/dlang/${COMPILER}-${COMPILER_VERSION}/lib \
PS1="(${COMPILER}-${COMPILER_VERSION}) \\u@\\h:\\w\$"
RUN cd /tmp \
&& echo 'void main() {import std.stdio; stdout.writeln("it works"); }' > test.d \
&& gdc -o test test.d \
&& ./test && rm test*
WORKDIR /src
ENV GOSU_VERSION 1.9
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates wget \
&& wget -O /usr/local/bin/gosu \
"https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture)" \
&& wget -O /usr/local/bin/gosu.asc \
"https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "${GNUPGHOME}" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true \
&& apt-get auto-remove -y wget \
&& rm -rf /var/lib/apt/lists/* \
&& chmod 755 -R /dlang
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["${COMPILER}"]