diff --git a/2.6/alpine3.13/Dockerfile b/2.6/alpine3.13/Dockerfile index 11f9f1d733..1c1feafe1b 100644 --- a/2.6/alpine3.13/Dockerfile +++ b/2.6/alpine3.13/Dockerfile @@ -51,7 +51,6 @@ RUN set -eux; \ libffi-dev \ libxml2-dev \ libxslt-dev \ - libucontext-dev \ linux-headers \ make \ ncurses-dev \ diff --git a/2.6/alpine3.14/Dockerfile b/2.6/alpine3.14/Dockerfile index a882629e16..5a86b56098 100644 --- a/2.6/alpine3.14/Dockerfile +++ b/2.6/alpine3.14/Dockerfile @@ -51,7 +51,6 @@ RUN set -eux; \ libffi-dev \ libxml2-dev \ libxslt-dev \ - libucontext-dev \ linux-headers \ make \ ncurses-dev \ diff --git a/2.7/alpine3.13/Dockerfile b/2.7/alpine3.13/Dockerfile index 6a9bba4000..f80d05b4aa 100644 --- a/2.7/alpine3.13/Dockerfile +++ b/2.7/alpine3.13/Dockerfile @@ -51,7 +51,6 @@ RUN set -eux; \ libffi-dev \ libxml2-dev \ libxslt-dev \ - libucontext-dev \ linux-headers \ make \ ncurses-dev \ @@ -97,8 +96,16 @@ RUN set -eux; \ mv file.c.new file.c; \ \ autoconf; \ + # fix builds on arm32v6/7 and s390x: https://github.com/docker-library/ruby/issues/308 + # and don't break the other arches: https://github.com/docker-library/ruby/issues/365 + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + s390x | armhf | armv7) \ + apk add --no-cache libucontext-dev; \ + export LIBS='-lucontext'; \ + ;; \ + esac; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - export LIBS='-lucontext'; \ ./configure \ --build="$gnuArch" \ --disable-install-doc \ diff --git a/2.7/alpine3.14/Dockerfile b/2.7/alpine3.14/Dockerfile index 9c0b3c6d96..ebf7c2985a 100644 --- a/2.7/alpine3.14/Dockerfile +++ b/2.7/alpine3.14/Dockerfile @@ -51,7 +51,6 @@ RUN set -eux; \ libffi-dev \ libxml2-dev \ libxslt-dev \ - libucontext-dev \ linux-headers \ make \ ncurses-dev \ @@ -97,8 +96,16 @@ RUN set -eux; \ mv file.c.new file.c; \ \ autoconf; \ + # fix builds on arm32v6/7 and s390x: https://github.com/docker-library/ruby/issues/308 + # and don't break the other arches: https://github.com/docker-library/ruby/issues/365 + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + s390x | armhf | armv7) \ + apk add --no-cache libucontext-dev; \ + export LIBS='-lucontext'; \ + ;; \ + esac; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - export LIBS='-lucontext'; \ ./configure \ --build="$gnuArch" \ --disable-install-doc \ diff --git a/3.0/alpine3.13/Dockerfile b/3.0/alpine3.13/Dockerfile index 0edbbe0d20..d5fd52e058 100644 --- a/3.0/alpine3.13/Dockerfile +++ b/3.0/alpine3.13/Dockerfile @@ -51,7 +51,6 @@ RUN set -eux; \ libffi-dev \ libxml2-dev \ libxslt-dev \ - libucontext-dev \ linux-headers \ make \ ncurses-dev \ @@ -97,6 +96,15 @@ RUN set -eux; \ mv file.c.new file.c; \ \ autoconf; \ + # fix builds on arm32v6/7 and s390x: https://github.com/docker-library/ruby/issues/308 + # and don't break the other arches: https://github.com/docker-library/ruby/issues/365 + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + s390x | armhf | armv7) \ + apk add --no-cache libucontext-dev; \ + export LIBS='-lucontext'; \ + ;; \ + esac; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/3.0/alpine3.14/Dockerfile b/3.0/alpine3.14/Dockerfile index bb1a25d501..749d8b72e2 100644 --- a/3.0/alpine3.14/Dockerfile +++ b/3.0/alpine3.14/Dockerfile @@ -51,7 +51,6 @@ RUN set -eux; \ libffi-dev \ libxml2-dev \ libxslt-dev \ - libucontext-dev \ linux-headers \ make \ ncurses-dev \ @@ -97,6 +96,15 @@ RUN set -eux; \ mv file.c.new file.c; \ \ autoconf; \ + # fix builds on arm32v6/7 and s390x: https://github.com/docker-library/ruby/issues/308 + # and don't break the other arches: https://github.com/docker-library/ruby/issues/365 + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + s390x | armhf | armv7) \ + apk add --no-cache libucontext-dev; \ + export LIBS='-lucontext'; \ + ;; \ + esac; \ gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ diff --git a/Dockerfile.template b/Dockerfile.template index edd463b720..e4e735838f 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -76,7 +76,6 @@ RUN set -eux; \ libffi-dev \ libxml2-dev \ libxslt-dev \ - libucontext-dev \ linux-headers \ make \ ncurses-dev \ @@ -165,10 +164,18 @@ RUN set -eux; \ mv file.c.new file.c; \ \ autoconf; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ -{{ if is_alpine and env.version == "2.7" then ( -}} - export LIBS='-lucontext'; \ +{{ if is_alpine and ( [ "2.7", "3.0" ] | index(env.version) ) then ( -}} + # fix builds on arm32v6/7 and s390x: https://github.com/docker-library/ruby/issues/308 + # and don't break the other arches: https://github.com/docker-library/ruby/issues/365 + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + s390x | armhf | armv7) \ + apk add --no-cache libucontext-dev; \ + export LIBS='-lucontext'; \ + ;; \ + esac; \ {{ ) else "" end -}} + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ ./configure \ --build="$gnuArch" \ --disable-install-doc \