/
Dockerfile
48 lines (45 loc) · 1.39 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
FROM debian:jessie
ENV OTP_VERSION="19.3.6.4"
# We'll install the build dependencies, and purge them on the last step to make
# sure our final image contains only what we've just built:
RUN set -xe \
&& OTP_DOWNLOAD_URL="https://github.com/erlang/otp/archive/OTP-${OTP_VERSION}.tar.gz" \
&& OTP_DOWNLOAD_SHA256="640940d6fb7661ee4ec355ed68cccb52388517f4819c883b9837885f31aeaaeb" \
&& runtimeDeps=' \
libodbc1 \
libssl1.0.0 \
libsctp1 \
libwxgtk3.0 \
' \
&& buildDeps=' \
curl \
ca-certificates \
autoconf \
dpkg-dev \
gcc \
make \
libncurses-dev \
unixodbc-dev \
libssl-dev \
libsctp-dev \
libwxgtk3.0-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $runtimeDeps \
&& apt-get install -y --no-install-recommends $buildDeps \
&& curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
&& echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \
&& mkdir -p /usr/src/otp-src \
&& tar -xzf otp-src.tar.gz -C /usr/src/otp-src --strip-components=1 \
&& rm otp-src.tar.gz \
&& cd /usr/src/otp-src \
&& ./otp_build autoconf \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure --build="$gnuArch" \
--enable-dirty-schedulers \
&& make -j$(nproc) \
&& make install \
&& find /usr/local -name examples | xargs rm -rf \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /usr/src/otp-src /var/lib/apt/lists/*
CMD ["erl"]