@@ -2,8 +2,6 @@ ARG OS_VERSION
22
33FROM ubuntu:${OS_VERSION} AS build
44
5- ARG ERLANG
6-
75RUN apt-get update
86RUN apt-get -y --no-install-recommends install \
97 autoconf \
@@ -13,21 +11,23 @@ RUN apt-get -y --no-install-recommends install \
1311 make \
1412 libncurses-dev \
1513 unixodbc-dev \
16- $(bash -c 'if [ "${ERLANG:0:1}" = "1" ]; then echo "libssl1.0-dev"; else echo " libssl-dev"; fi' ) \
14+ libssl-dev \
1715 libsctp-dev \
1816 wget \
1917 ca-certificates \
2018 pax-utils
2119
20+ ARG ERLANG
21+
2222RUN mkdir -p /OTP/subdir
2323RUN wget -nv "https://github.com/erlang/otp/archive/OTP-${ERLANG}.tar.gz" && tar -zxf "OTP-${ERLANG}.tar.gz" -C /OTP/subdir --strip-components=1
2424WORKDIR /OTP/subdir
2525RUN ./otp_build autoconf
2626RUN ./configure --with-ssl --enable-dirty-schedulers
2727RUN make -j$(getconf _NPROCESSORS_ONLN)
2828RUN 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
3131RUN find /usr/local -regex '/usr/local/lib/erlang/\( lib/\| erts-\) .*/\( man\| obj\| c_src\| emacs\| info\| examples\) ' | xargs rm -rf
3232RUN find /usr/local -name src | xargs -r find | grep -v '\. hrl$' | xargs rm -v || true
3333RUN 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
3636
3737FROM ubuntu:${OS_VERSION} AS final
3838
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
5162ENV LANG=C.UTF-8
0 commit comments