@@ -2,8 +2,6 @@ ARG OS_VERSION
2
2
3
3
FROM ubuntu:${OS_VERSION} AS build
4
4
5
- ARG ERLANG
6
-
7
5
RUN apt-get update
8
6
RUN apt-get -y --no-install-recommends install \
9
7
autoconf \
@@ -13,21 +11,23 @@ RUN apt-get -y --no-install-recommends install \
13
11
make \
14
12
libncurses-dev \
15
13
unixodbc-dev \
16
- $(bash -c 'if [ "${ERLANG:0:1}" = "1" ]; then echo "libssl1.0-dev"; else echo " libssl-dev"; fi' ) \
14
+ libssl-dev \
17
15
libsctp-dev \
18
16
wget \
19
17
ca-certificates \
20
18
pax-utils
21
19
20
+ ARG ERLANG
21
+
22
22
RUN mkdir -p /OTP/subdir
23
23
RUN wget -nv "https://github.com/erlang/otp/archive/OTP-${ERLANG}.tar.gz" && tar -zxf "OTP-${ERLANG}.tar.gz" -C /OTP/subdir --strip-components=1
24
24
WORKDIR /OTP/subdir
25
25
RUN ./otp_build autoconf
26
26
RUN ./configure --with-ssl --enable-dirty-schedulers
27
27
RUN make -j$(getconf _NPROCESSORS_ONLN)
28
28
RUN make -j$(getconf _NPROCESSORS_ONLN) install
29
- RUN bash -c 'if [ "${ERLANG:0:2}" -ge "23" ]; then make -j$(getconf _NPROCESSORS_ONLN) docs DOC_TARGETS=chunks; else true; fi'
30
- RUN bash -c 'if [ "${ERLANG:0:2}" -ge "23" ]; then make -j$(getconf _NPROCESSORS_ONLN) install-docs DOC_TARGETS=chunks; else true; fi'
29
+ RUN make -j$(getconf _NPROCESSORS_ONLN) docs DOC_TARGETS=chunks
30
+ RUN make -j$(getconf _NPROCESSORS_ONLN) install-docs DOC_TARGETS=chunks
31
31
RUN find /usr/local -regex '/usr/local/lib/erlang/\( lib/\| erts-\) .*/\( man\| obj\| c_src\| emacs\| info\| examples\) ' | xargs rm -rf
32
32
RUN find /usr/local -name src | xargs -r find | grep -v '\. hrl$' | xargs rm -v || true
33
33
RUN find /usr/local -name src | xargs -r find | xargs rmdir -vp || true
@@ -36,16 +36,27 @@ RUN scanelf --nobanner -E ET_DYN -BF '%F' --recursive /usr/local | xargs -r stri
36
36
37
37
FROM ubuntu:${OS_VERSION} AS final
38
38
39
- ARG ERLANG
40
-
41
- RUN apt-get update && \
42
- apt-get -y --no-install-recommends install \
43
- ca-certificates \
44
- libodbc1 \
45
- $(bash -c 'if [ "${ERLANG:0:1}" = "1" ]; then echo "libssl1.0.0"; else echo "libssl1.1"; fi' ) \
46
- libsctp1 && \
47
- apt-get clean && \
48
- rm -rf /var/lib/apt/lists/*
49
-
50
- COPY --from=build /usr/local /usr/local
39
+ ARG ARCH
40
+
41
+ RUN if [ "${ARCH}" = "amd64" ]; then \
42
+ apt-get update; \
43
+ apt-get -y --no-install-recommends install \
44
+ ca-certificates \
45
+ libodbc2 \
46
+ libssl3t \
47
+ libsctp1; \
48
+ apt-get clean; \
49
+ rm -rf /var/lib/apt/lists/*; \
50
+ elif [ "${ARCH}" = "arm64" ]; then \
51
+ apt-get update; \
52
+ apt-get -y --no-install-recommends install \
53
+ ca-certificates \
54
+ libodbc2 \
55
+ libssl3t64 \
56
+ libsctp1; \
57
+ apt-get clean; \
58
+ rm -rf /var/lib/apt/lists/*; \
59
+ fi
60
+
61
+ # COPY --from=build /usr/local /usr/local
51
62
ENV LANG=C.UTF-8
0 commit comments