From ba2c3f3cce27b87d7798e83f2df998b60432ad4c Mon Sep 17 00:00:00 2001 From: Andreas Schultz Date: Wed, 3 Jul 2024 11:55:39 +0200 Subject: [PATCH] make SCTP in images work older Linux kernels Linux SCTP ioctls argument length checking is not forward compatible with newer kernel headers. The length of the SCTP ioctl argument is based on the size of some SCTP structs. If code compiled with newer kernel headers, where the SCTP structs are larger, is running on an older kernel and tries to pass the a SCTP struct that is larger than what the running kernel supports, then the ioctl results in an error. Erlangs SCTP code does excatly that. That means that SCTP in a Erlang VM that has been compiled with recent kernel headers will not work on older kernels. This change pulls in Linux 5.4.5 kernel headers (and only the kernel headers) from Alpine 3.12. The resulting images will have working SCTP support when running on Linux 5.4.5 and newer. --- 24/alpine/Dockerfile | 3 ++- 25/alpine/Dockerfile | 3 ++- 26/alpine/Dockerfile | 3 ++- 27/alpine/Dockerfile | 3 ++- master/alpine/Dockerfile | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/24/alpine/Dockerfile b/24/alpine/Dockerfile index ccd5ef1c..870d5bc0 100644 --- a/24/alpine/Dockerfile +++ b/24/alpine/Dockerfile @@ -15,11 +15,12 @@ RUN set -xe \ && curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \ && echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \ && apk add --no-cache --virtual .build-deps \ + --repository=http://dl-cdn.alpinelinux.org/alpine/v3.12/main \ dpkg-dev dpkg \ gcc \ g++ \ libc-dev \ - linux-headers \ + linux-headers=5.4.5-r1 \ make \ autoconf \ ncurses-dev \ diff --git a/25/alpine/Dockerfile b/25/alpine/Dockerfile index 546d475a..a8a9de96 100644 --- a/25/alpine/Dockerfile +++ b/25/alpine/Dockerfile @@ -15,11 +15,12 @@ RUN set -xe \ && curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \ && echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \ && apk add --no-cache --virtual .build-deps \ + --repository=http://dl-cdn.alpinelinux.org/alpine/v3.12/main \ dpkg-dev dpkg \ gcc \ g++ \ libc-dev \ - linux-headers \ + linux-headers=5.4.5-r1 \ make \ autoconf \ ncurses-dev \ diff --git a/26/alpine/Dockerfile b/26/alpine/Dockerfile index 1a6f56a4..b4206227 100644 --- a/26/alpine/Dockerfile +++ b/26/alpine/Dockerfile @@ -15,11 +15,12 @@ RUN set -xe \ && curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \ && echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \ && apk add --no-cache --virtual .build-deps \ + --repository=http://dl-cdn.alpinelinux.org/alpine/v3.12/main \ dpkg-dev dpkg \ gcc \ g++ \ libc-dev \ - linux-headers \ + linux-headers=5.4.5-r1 \ make \ autoconf \ ncurses-dev \ diff --git a/27/alpine/Dockerfile b/27/alpine/Dockerfile index 8b3185d2..2204886b 100644 --- a/27/alpine/Dockerfile +++ b/27/alpine/Dockerfile @@ -15,11 +15,12 @@ RUN set -xe \ && curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \ && echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \ && apk add --no-cache --virtual .build-deps \ + --repository=http://dl-cdn.alpinelinux.org/alpine/v3.12/main \ dpkg-dev dpkg \ gcc \ g++ \ libc-dev \ - linux-headers \ + linux-headers=5.4.5-r1 \ make \ autoconf \ ncurses-dev \ diff --git a/master/alpine/Dockerfile b/master/alpine/Dockerfile index 2e1debf8..5755154f 100644 --- a/master/alpine/Dockerfile +++ b/master/alpine/Dockerfile @@ -15,11 +15,12 @@ RUN set -xe \ && curl -fSL -o otp-src.tar.gz "$OTP_DOWNLOAD_URL" \ && echo "$OTP_DOWNLOAD_SHA256 otp-src.tar.gz" | sha256sum -c - \ && apk add --no-cache --virtual .build-deps \ + --repository=http://dl-cdn.alpinelinux.org/alpine/v3.12/main \ dpkg-dev dpkg \ gcc \ g++ \ libc-dev \ - linux-headers \ + linux-headers=5.4.5-r1 \ make \ autoconf \ ncurses-dev \