diff --git a/lib/bob/job/docker_checker.ex b/lib/bob/job/docker_checker.ex index ff2225f..9766e6f 100644 --- a/lib/bob/job/docker_checker.ex +++ b/lib/bob/job/docker_checker.ex @@ -129,6 +129,9 @@ defmodule Bob.Job.DockerChecker do defp build_erlang_ref?("ubuntu", "jammy-" <> _, "OTP-" <> version), do: build_openssl_3?(version) + defp build_erlang_ref?("ubuntu", "noble-" <> _, "OTP-" <> version), + do: build_openssl_3?(version) + defp build_erlang_ref?(_os, _os_version, _ref), do: true defp build_erlang_ref?("arm64", "ubuntu", "trusty-" <> _, "OTP-17" <> _), do: false diff --git a/priv/scripts/docker/erlang-ubuntu-bionic.dockerfile b/priv/scripts/docker/erlang-ubuntu-noble.dockerfile similarity index 63% rename from priv/scripts/docker/erlang-ubuntu-bionic.dockerfile rename to priv/scripts/docker/erlang-ubuntu-noble.dockerfile index 323f44b..f2d94d7 100644 --- a/priv/scripts/docker/erlang-ubuntu-bionic.dockerfile +++ b/priv/scripts/docker/erlang-ubuntu-noble.dockerfile @@ -2,8 +2,6 @@ ARG OS_VERSION FROM ubuntu:${OS_VERSION} AS build -ARG ERLANG - RUN apt-get update RUN apt-get -y --no-install-recommends install \ autoconf \ @@ -13,12 +11,14 @@ RUN apt-get -y --no-install-recommends install \ make \ libncurses-dev \ unixodbc-dev \ - $(bash -c 'if [ "${ERLANG:0:1}" = "1" ]; then echo "libssl1.0-dev"; else echo "libssl-dev"; fi') \ + libssl-dev \ libsctp-dev \ wget \ ca-certificates \ pax-utils +ARG ERLANG + RUN mkdir -p /OTP/subdir 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 WORKDIR /OTP/subdir @@ -26,8 +26,8 @@ RUN ./otp_build autoconf RUN ./configure --with-ssl --enable-dirty-schedulers RUN make -j$(getconf _NPROCESSORS_ONLN) RUN make -j$(getconf _NPROCESSORS_ONLN) install -RUN bash -c 'if [ "${ERLANG:0:2}" -ge "23" ]; then make -j$(getconf _NPROCESSORS_ONLN) docs DOC_TARGETS=chunks; else true; fi' -RUN bash -c 'if [ "${ERLANG:0:2}" -ge "23" ]; then make -j$(getconf _NPROCESSORS_ONLN) install-docs DOC_TARGETS=chunks; else true; fi' +RUN make -j$(getconf _NPROCESSORS_ONLN) docs DOC_TARGETS=chunks +RUN make -j$(getconf _NPROCESSORS_ONLN) install-docs DOC_TARGETS=chunks RUN find /usr/local -regex '/usr/local/lib/erlang/\(lib/\|erts-\).*/\(man\|obj\|c_src\|emacs\|info\|examples\)' | xargs rm -rf RUN find /usr/local -name src | xargs -r find | grep -v '\.hrl$' | xargs rm -v || true 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 FROM ubuntu:${OS_VERSION} AS final -ARG ERLANG - -RUN apt-get update && \ - apt-get -y --no-install-recommends install \ - ca-certificates \ - libodbc1 \ - $(bash -c 'if [ "${ERLANG:0:1}" = "1" ]; then echo "libssl1.0.0"; else echo "libssl1.1"; fi') \ - libsctp1 && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* +ARG ARCH + +RUN if [ "${ARCH}" = "amd64" ]; then \ + apt-get update; \ + apt-get -y --no-install-recommends install \ + ca-certificates \ + libodbc2 \ + libssl3t \ + libsctp1; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/*; \ + elif [ "${ARCH}" = "arm64" ]; then \ + apt-get update; \ + apt-get -y --no-install-recommends install \ + ca-certificates \ + libodbc2 \ + libssl3t64 \ + libsctp1; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/*; \ + fi COPY --from=build /usr/local /usr/local ENV LANG=C.UTF-8 diff --git a/priv/scripts/docker/erlang.sh b/priv/scripts/docker/erlang.sh index 305ad73..9f5d750 100755 --- a/priv/scripts/docker/erlang.sh +++ b/priv/scripts/docker/erlang.sh @@ -40,6 +40,7 @@ fi docker build \ --ulimit nofile=1024:1024 \ -t hexpm/erlang-${arch}:${tag} \ + --build-arg ARCH=${arch} \ --build-arg ERLANG=${erlang} \ --build-arg OS_VERSION=${os_version} \ --build-arg PIE_CFLAGS=${pie_cflags} \