Skip to content

Commit c572ad3

Browse files
authored
Add Erlang/OTP 28 (currently 28.0-rc2) (#499)
1 parent 95d5cdc commit c572ad3

File tree

5 files changed

+202
-1
lines changed

5 files changed

+202
-1
lines changed

.github/workflows/erlang.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
otp: ['DIR=master', 'DIR=master VARIANT=alpine',
11+
'DIR=28', 'DIR=28 VARIANT=slim', 'DIR=28 VARIANT=alpine',
1112
'DIR=27', 'DIR=27 VARIANT=slim', 'DIR=27 VARIANT=alpine',
1213
'DIR=26', 'DIR=26 VARIANT=slim', 'DIR=26 VARIANT=alpine',
1314
'DIR=25', 'DIR=25 VARIANT=slim', 'DIR=25 VARIANT=alpine',

28/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM buildpack-deps:bookworm
2+
3+
ENV OTP_VERSION="28.0-rc2" \
4+
REBAR3_VERSION="3.24.0"
5+
6+
LABEL org.opencontainers.image.version=$OTP_VERSION
7+
8+
# We'll install the build dependencies for erlang-odbc along with the erlang
9+
# build process:
10+
RUN set -xe \
11+
&& OTP_DOWNLOAD_URL="https://github.com/erlang/otp/releases/download/OTP-${OTP_VERSION}/otp_src_${OTP_VERSION}.tar.gz" \
12+
&& OTP_DOWNLOAD_SHA256="1933a7811aacecb528e3d05f8e552e15439d733934064c821639fb22735c928d" \
13+
&& runtimeDeps='libodbc1 \
14+
libsctp1 \
15+
libwxgtk3.2 \
16+
libwxgtk-webview3.2-dev ' \
17+
&& buildDeps='unixodbc-dev \
18+
libsctp-dev ' \
19+
&& apt-get update \
20+
&& apt-get install -y --no-install-recommends $runtimeDeps \
21+
&& apt-get install -y --no-install-recommends $buildDeps \
22+
&& curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
23+
&& echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \
24+
&& export ERL_TOP="/usr/src/otp_src_${OTP_VERSION%%@*}" \
25+
&& mkdir -vp $ERL_TOP \
26+
&& tar -xzf otp-src.tar.gz -C $ERL_TOP --strip-components=1 \
27+
&& rm otp-src.tar.gz \
28+
&& ( cd $ERL_TOP \
29+
&& ./otp_build autoconf \
30+
&& gnuArch="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)" \
31+
&& ./configure --build="$gnuArch" \
32+
&& make -j$(nproc) \
33+
&& make -j$(nproc) docs DOC_TARGETS=chunks \
34+
&& make install install-docs DOC_TARGETS=chunks ) \
35+
&& find /usr/local -name examples | xargs rm -rf \
36+
&& apt-get purge -y --auto-remove $buildDeps \
37+
&& rm -rf $ERL_TOP /var/lib/apt/lists/*
38+
39+
CMD ["erl"]
40+
41+
# extra useful tools here: rebar & rebar3
42+
43+
ENV REBAR_VERSION="2.6.4"
44+
45+
RUN set -xe \
46+
&& REBAR_DOWNLOAD_URL="https://github.com/rebar/rebar/archive/${REBAR_VERSION}.tar.gz" \
47+
&& REBAR_DOWNLOAD_SHA256="577246bafa2eb2b2c3f1d0c157408650446884555bf87901508ce71d5cc0bd07" \
48+
&& mkdir -p /usr/src/rebar-src \
49+
&& curl -fSL -o rebar-src.tar.gz "$REBAR_DOWNLOAD_URL" \
50+
&& echo "$REBAR_DOWNLOAD_SHA256 rebar-src.tar.gz" | sha256sum -c - \
51+
&& tar -xzf rebar-src.tar.gz -C /usr/src/rebar-src --strip-components=1 \
52+
&& rm rebar-src.tar.gz \
53+
&& cd /usr/src/rebar-src \
54+
&& ./bootstrap \
55+
&& install -v ./rebar /usr/local/bin/ \
56+
&& rm -rf /usr/src/rebar-src
57+
58+
RUN set -xe \
59+
&& REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \
60+
&& REBAR3_DOWNLOAD_SHA256="391b0eaa2825bb427fef1e55a0d166493059175f57a33b00346b84a20398216c" \
61+
&& mkdir -p /usr/src/rebar3-src \
62+
&& curl -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \
63+
&& echo "$REBAR3_DOWNLOAD_SHA256 rebar3-src.tar.gz" | sha256sum -c - \
64+
&& tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
65+
&& rm rebar3-src.tar.gz \
66+
&& cd /usr/src/rebar3-src \
67+
&& HOME=$PWD ./bootstrap \
68+
&& install -v ./rebar3 /usr/local/bin/ \
69+
&& rm -rf /usr/src/rebar3-src

28/alpine/Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM alpine:3.21
2+
3+
ENV OTP_VERSION="28.0-rc2" \
4+
REBAR3_VERSION="3.24.0"
5+
6+
LABEL org.opencontainers.image.version=$OTP_VERSION
7+
8+
RUN set -xe \
9+
&& OTP_DOWNLOAD_URL="https://github.com/erlang/otp/releases/download/OTP-${OTP_VERSION}/otp_src_${OTP_VERSION}.tar.gz" \
10+
&& OTP_DOWNLOAD_SHA256="1933a7811aacecb528e3d05f8e552e15439d733934064c821639fb22735c928d" \
11+
&& REBAR3_DOWNLOAD_SHA256="391b0eaa2825bb427fef1e55a0d166493059175f57a33b00346b84a20398216c" \
12+
&& apk add --no-cache --virtual .fetch-deps \
13+
curl \
14+
ca-certificates \
15+
&& curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
16+
&& echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \
17+
&& apk add --no-cache --virtual .build-deps \
18+
dpkg-dev dpkg \
19+
gcc \
20+
g++ \
21+
libc-dev \
22+
linux-headers \
23+
make \
24+
autoconf \
25+
ncurses-dev \
26+
openssl-dev \
27+
unixodbc-dev \
28+
lksctp-tools-dev \
29+
tar \
30+
&& export ERL_TOP="/usr/src/otp_src_${OTP_VERSION%%@*}" \
31+
&& mkdir -vp $ERL_TOP \
32+
&& tar -xzf otp-src.tar.gz -C $ERL_TOP --strip-components=1 \
33+
&& rm otp-src.tar.gz \
34+
&& ( cd $ERL_TOP \
35+
&& ./otp_build autoconf \
36+
&& gnuArch="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)" \
37+
&& ./configure --build="$gnuArch" \
38+
&& make -j$(getconf _NPROCESSORS_ONLN) \
39+
&& make install ) \
40+
&& rm -rf $ERL_TOP \
41+
&& find /usr/local -regex '/usr/local/lib/erlang/\(lib/\|erts-\).*/\(man\|doc\|obj\|c_src\|emacs\|info\|examples\)' | xargs rm -rf \
42+
&& find /usr/local -name src | xargs -r find | grep -v '\.hrl$' | xargs rm -v || true \
43+
&& find /usr/local -name src | xargs -r find | xargs rmdir -vp || true \
44+
&& scanelf --nobanner -E ET_EXEC -BF '%F' --recursive /usr/local | xargs -r strip --strip-all \
45+
&& scanelf --nobanner -E ET_DYN -BF '%F' --recursive /usr/local | xargs -r strip --strip-unneeded \
46+
&& runDeps="$( \
47+
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
48+
| tr ',' '\n' \
49+
| sort -u \
50+
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
51+
)" \
52+
&& REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \
53+
&& curl -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \
54+
&& echo "${REBAR3_DOWNLOAD_SHA256} rebar3-src.tar.gz" | sha256sum -c - \
55+
&& mkdir -p /usr/src/rebar3-src \
56+
&& tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
57+
&& rm rebar3-src.tar.gz \
58+
&& cd /usr/src/rebar3-src \
59+
&& HOME=$PWD ./bootstrap \
60+
&& install -v ./rebar3 /usr/local/bin/ \
61+
&& rm -rf /usr/src/rebar3-src \
62+
&& apk add --virtual .erlang-rundeps \
63+
$runDeps \
64+
lksctp-tools \
65+
ca-certificates \
66+
&& apk del .fetch-deps .build-deps
67+
68+
CMD ["erl"]

28/slim/Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FROM debian:bookworm
2+
3+
ENV OTP_VERSION="28.0-rc2" \
4+
REBAR3_VERSION="3.24.0"
5+
6+
LABEL org.opencontainers.image.version=$OTP_VERSION
7+
8+
# We'll install the build dependencies, and purge them on the last step to make
9+
# sure our final image contains only what we've just built:
10+
RUN set -xe \
11+
&& OTP_DOWNLOAD_URL="https://github.com/erlang/otp/releases/download/OTP-${OTP_VERSION}/otp_src_${OTP_VERSION}.tar.gz" \
12+
&& OTP_DOWNLOAD_SHA256="1933a7811aacecb528e3d05f8e552e15439d733934064c821639fb22735c928d" \
13+
&& fetchDeps=' \
14+
curl \
15+
ca-certificates' \
16+
&& apt-get update \
17+
&& apt-get install -y --no-install-recommends $fetchDeps \
18+
&& curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \
19+
&& echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \
20+
&& runtimeDeps=' \
21+
libodbc1 \
22+
libssl3 \
23+
libsctp1 \
24+
' \
25+
&& buildDeps=' \
26+
autoconf \
27+
dpkg-dev \
28+
gcc \
29+
g++ \
30+
make \
31+
libncurses-dev \
32+
unixodbc-dev \
33+
libssl-dev \
34+
libsctp-dev \
35+
' \
36+
&& apt-get install -y --no-install-recommends $runtimeDeps \
37+
&& apt-get install -y --no-install-recommends $buildDeps \
38+
&& export ERL_TOP="/usr/src/otp_src_${OTP_VERSION%%@*}" \
39+
&& mkdir -vp $ERL_TOP \
40+
&& tar -xzf otp-src.tar.gz -C $ERL_TOP --strip-components=1 \
41+
&& rm otp-src.tar.gz \
42+
&& ( cd $ERL_TOP \
43+
&& ./otp_build autoconf \
44+
&& gnuArch="$(dpkg-architecture --query DEB_HOST_GNU_TYPE)" \
45+
&& ./configure --build="$gnuArch" \
46+
&& make -j$(nproc) \
47+
&& make install ) \
48+
&& find /usr/local -name examples | xargs rm -rf \
49+
&& REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \
50+
&& REBAR3_DOWNLOAD_SHA256="391b0eaa2825bb427fef1e55a0d166493059175f57a33b00346b84a20398216c" \
51+
&& mkdir -p /usr/src/rebar3-src \
52+
&& curl -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \
53+
&& echo "$REBAR3_DOWNLOAD_SHA256 rebar3-src.tar.gz" | sha256sum -c - \
54+
&& tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
55+
&& rm rebar3-src.tar.gz \
56+
&& cd /usr/src/rebar3-src \
57+
&& HOME=$PWD ./bootstrap \
58+
&& install -v ./rebar3 /usr/local/bin/ \
59+
&& rm -rf /usr/src/rebar3-src \
60+
&& apt-get purge -y --auto-remove $buildDeps $fetchDeps \
61+
&& rm -rf $ERL_TOP /var/lib/apt/lists/*
62+
63+
CMD ["erl"]

generate-stackbrew-library.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eu
33

4-
declare -a -r versions=(27 26 25 24)
4+
declare -a -r versions=(28 27 26 25 24)
55
declare -A -r aliases=(
66
[27]='latest'
77
)

0 commit comments

Comments
 (0)