Skip to content

Commit

Permalink
Constrain Ubuntu Noble builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj committed Apr 1, 2024
1 parent ec86782 commit bc0c95a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
3 changes: 3 additions & 0 deletions lib/bob/job/docker_checker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -13,21 +11,23 @@ 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
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
Expand All @@ -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
1 change: 1 addition & 0 deletions priv/scripts/docker/erlang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down

0 comments on commit bc0c95a

Please sign in to comment.