Skip to content

Commit 3a7bf17

Browse files
committed
Constrain Ubuntu Noble builds
1 parent ec86782 commit 3a7bf17

File tree

3 files changed

+32
-17
lines changed

3 files changed

+32
-17
lines changed

lib/bob/job/docker_checker.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ defmodule Bob.Job.DockerChecker do
129129
defp build_erlang_ref?("ubuntu", "jammy-" <> _, "OTP-" <> version),
130130
do: build_openssl_3?(version)
131131

132+
defp build_erlang_ref?("ubuntu", "noble-" <> _, "OTP-" <> version),
133+
do: build_openssl_3?(version)
134+
132135
defp build_erlang_ref?(_os, _os_version, _ref), do: true
133136

134137
defp build_erlang_ref?("arm64", "ubuntu", "trusty-" <> _, "OTP-17" <> _), do: false

priv/scripts/docker/erlang-ubuntu-bionic.dockerfile renamed to priv/scripts/docker/erlang-ubuntu-noble.dockerfile

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ ARG OS_VERSION
22

33
FROM ubuntu:${OS_VERSION} AS build
44

5-
ARG ERLANG
6-
75
RUN apt-get update
86
RUN 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+
2222
RUN mkdir -p /OTP/subdir
2323
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
2424
WORKDIR /OTP/subdir
2525
RUN ./otp_build autoconf
2626
RUN ./configure --with-ssl --enable-dirty-schedulers
2727
RUN make -j$(getconf _NPROCESSORS_ONLN)
2828
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
3131
RUN find /usr/local -regex '/usr/local/lib/erlang/\(lib/\|erts-\).*/\(man\|obj\|c_src\|emacs\|info\|examples\)' | xargs rm -rf
3232
RUN find /usr/local -name src | xargs -r find | grep -v '\.hrl$' | xargs rm -v || true
3333
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
3636

3737
FROM 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
5162
ENV LANG=C.UTF-8

priv/scripts/docker/erlang.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fi
4040
docker build \
4141
--ulimit nofile=1024:1024 \
4242
-t hexpm/erlang-${arch}:${tag} \
43+
--build-arg ARCH=${arch} \
4344
--build-arg ERLANG=${erlang} \
4445
--build-arg OS_VERSION=${os_version} \
4546
--build-arg PIE_CFLAGS=${pie_cflags} \

0 commit comments

Comments
 (0)