From 3ac53a7fe039d4299aca9b49ad53e1cc85cc6498 Mon Sep 17 00:00:00 2001 From: Matthew Newell <18470637+wheatevo@users.noreply.github.com> Date: Tue, 9 May 2023 21:55:51 -0500 Subject: [PATCH 1/2] Add Alpine 3.18 Alpine 3.18 release post: https://alpinelinux.org/posts/Alpine-3.18.0-released.html --- 3.1/alpine3.18/Dockerfile | 141 ++++++++++++++++++++++++++++++++ 3.2/alpine3.18/Dockerfile | 165 ++++++++++++++++++++++++++++++++++++++ versions.json | 2 + versions.sh | 3 +- 4 files changed, 310 insertions(+), 1 deletion(-) create mode 100644 3.1/alpine3.18/Dockerfile create mode 100644 3.2/alpine3.18/Dockerfile diff --git a/3.1/alpine3.18/Dockerfile b/3.1/alpine3.18/Dockerfile new file mode 100644 index 0000000000..679171a895 --- /dev/null +++ b/3.1/alpine3.18/Dockerfile @@ -0,0 +1,141 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.18 + +RUN set -eux; \ + apk add --no-cache \ + bzip2 \ + ca-certificates \ + gmp-dev \ + libffi-dev \ + procps \ + yaml-dev \ + zlib-dev \ + ; + +# skip installing gem documentation +RUN set -eux; \ + mkdir -p /usr/local/etc; \ + { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + +ENV LANG C.UTF-8 +ENV RUBY_MAJOR 3.1 +ENV RUBY_VERSION 3.1.4 +ENV RUBY_DOWNLOAD_SHA256 1b6d6010e76036c937b9671f4752f065aeca800a6c664f71f6c9a699453af94f + +# some of ruby's build scripts are written in ruby +# we purge system ruby later to make sure our final image uses what we just built +RUN set -eux; \ + \ +# readline-dev vs libedit-dev: https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75 + apk add --no-cache --virtual .ruby-builddeps \ + autoconf \ + bison \ + bzip2 \ + bzip2-dev \ + ca-certificates \ + coreutils \ + dpkg-dev dpkg \ + g++ \ + gcc \ + gdbm-dev \ + glib-dev \ + libc-dev \ + libffi-dev \ + libxml2-dev \ + libxslt-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl \ + openssl-dev \ + patch \ + procps \ + readline-dev \ + ruby \ + tar \ + xz \ + yaml-dev \ + zlib-dev \ + ; \ + \ + wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz"; \ + echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum --check --strict; \ + \ + mkdir -p /usr/src/ruby; \ + tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1; \ + rm ruby.tar.xz; \ + \ + cd /usr/src/ruby; \ + \ +# https://github.com/docker-library/ruby/issues/196 +# https://bugs.ruby-lang.org/issues/14387#note-13 (patch source) +# https://bugs.ruby-lang.org/issues/14387#note-16 ("Therefore ncopa's patch looks good for me in general." -- only breaks glibc which doesn't matter here) + wget -O 'thread-stack-fix.patch' 'https://bugs.ruby-lang.org/attachments/download/7081/0001-thread_pthread.c-make-get_main_stack-portable-on-lin.patch'; \ + echo '3ab628a51d92fdf0d2b5835e93564857aea73e0c1de00313864a94a6255cb645 *thread-stack-fix.patch' | sha256sum --check --strict; \ + patch -p1 -i thread-stack-fix.patch; \ + rm thread-stack-fix.patch; \ + \ +# the configure script does not detect isnan/isinf as macros + export ac_cv_func_isnan=yes ac_cv_func_isinf=yes; \ + \ +# hack in "ENABLE_PATH_CHECK" disabling to suppress: +# warning: Insecure world writable dir + { \ + echo '#define ENABLE_PATH_CHECK 0'; \ + echo; \ + cat file.c; \ + } > file.c.new; \ + mv file.c.new file.c; \ + \ + autoconf; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + ./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --enable-shared \ + ; \ + make -j "$(nproc)"; \ + make install; \ + \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .ruby-rundeps $runDeps; \ + apk del --no-network .ruby-builddeps; \ + \ + cd /; \ + rm -r /usr/src/ruby; \ +# verify we have no "ruby" packages installed + if \ + apk --no-network list --installed \ + | grep -v '^[.]ruby-rundeps' \ + | grep -i ruby \ + ; then \ + exit 1; \ + fi; \ + [ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \ +# rough smoke test + ruby --version; \ + gem --version; \ + bundle --version + +# don't create ".bundle" in all our apps +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $GEM_HOME/bin:$PATH +# adjust permissions of a few directories for running "gem install" as an arbitrary user +RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME" + +CMD [ "irb" ] diff --git a/3.2/alpine3.18/Dockerfile b/3.2/alpine3.18/Dockerfile new file mode 100644 index 0000000000..17449c0a15 --- /dev/null +++ b/3.2/alpine3.18/Dockerfile @@ -0,0 +1,165 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.18 + +RUN set -eux; \ + apk add --no-cache \ + bzip2 \ + ca-certificates \ + gmp-dev \ + libffi-dev \ + procps \ + yaml-dev \ + zlib-dev \ + ; + +# skip installing gem documentation +RUN set -eux; \ + mkdir -p /usr/local/etc; \ + { \ + echo 'install: --no-document'; \ + echo 'update: --no-document'; \ + } >> /usr/local/etc/gemrc + +ENV LANG C.UTF-8 +ENV RUBY_MAJOR 3.2 +ENV RUBY_VERSION 3.2.2 +ENV RUBY_DOWNLOAD_SHA256 4b352d0f7ec384e332e3e44cdbfdcd5ff2d594af3c8296b5636c710975149e23 + +# some of ruby's build scripts are written in ruby +# we purge system ruby later to make sure our final image uses what we just built +RUN set -eux; \ + \ +# readline-dev vs libedit-dev: https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75 + apk add --no-cache --virtual .ruby-builddeps \ + autoconf \ + bison \ + bzip2 \ + bzip2-dev \ + ca-certificates \ + coreutils \ + dpkg-dev dpkg \ + g++ \ + gcc \ + gdbm-dev \ + glib-dev \ + libc-dev \ + libffi-dev \ + libxml2-dev \ + libxslt-dev \ + linux-headers \ + make \ + ncurses-dev \ + openssl \ + openssl-dev \ + patch \ + procps \ + readline-dev \ + ruby \ + tar \ + xz \ + yaml-dev \ + zlib-dev \ + ; \ + \ + rustArch=; \ + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + 'x86_64') rustArch='x86_64-unknown-linux-musl'; rustupUrl='https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-musl/rustup-init'; rustupSha256='95427cb0592e32ed39c8bd522fe2a40a746ba07afb8149f91e936cddb4d6eeac' ;; \ + 'aarch64') rustArch='aarch64-unknown-linux-musl'; rustupUrl='https://static.rust-lang.org/rustup/archive/1.25.1/aarch64-unknown-linux-musl/rustup-init'; rustupSha256='7855404cdc50c20040c743800c947b6f452490d47f8590a4a83bc6f75d1d8eda' ;; \ + esac; \ + \ + if [ -n "$rustArch" ]; then \ + mkdir -p /tmp/rust; \ + \ + wget -O /tmp/rust/rustup-init "$rustupUrl"; \ + echo "$rustupSha256 */tmp/rust/rustup-init" | sha256sum --check --strict; \ + chmod +x /tmp/rust/rustup-init; \ + \ + export RUSTUP_HOME='/tmp/rust/rustup' CARGO_HOME='/tmp/rust/cargo'; \ + export PATH="$CARGO_HOME/bin:$PATH"; \ + /tmp/rust/rustup-init -y --no-modify-path --profile minimal --default-toolchain '1.66.0' --default-host "$rustArch"; \ + \ + rustc --version; \ + cargo --version; \ + fi; \ + \ + wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz"; \ + echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum --check --strict; \ + \ + mkdir -p /usr/src/ruby; \ + tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1; \ + rm ruby.tar.xz; \ + \ + cd /usr/src/ruby; \ + \ +# https://github.com/docker-library/ruby/issues/196 +# https://bugs.ruby-lang.org/issues/14387#note-13 (patch source) +# https://bugs.ruby-lang.org/issues/14387#note-16 ("Therefore ncopa's patch looks good for me in general." -- only breaks glibc which doesn't matter here) + wget -O 'thread-stack-fix.patch' 'https://bugs.ruby-lang.org/attachments/download/7081/0001-thread_pthread.c-make-get_main_stack-portable-on-lin.patch'; \ + echo '3ab628a51d92fdf0d2b5835e93564857aea73e0c1de00313864a94a6255cb645 *thread-stack-fix.patch' | sha256sum --check --strict; \ + patch -p1 -i thread-stack-fix.patch; \ + rm thread-stack-fix.patch; \ + \ +# the configure script does not detect isnan/isinf as macros + export ac_cv_func_isnan=yes ac_cv_func_isinf=yes; \ + \ +# hack in "ENABLE_PATH_CHECK" disabling to suppress: +# warning: Insecure world writable dir + { \ + echo '#define ENABLE_PATH_CHECK 0'; \ + echo; \ + cat file.c; \ + } > file.c.new; \ + mv file.c.new file.c; \ + \ + autoconf; \ + gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ + ./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --enable-shared \ + ${rustArch:+--enable-yjit} \ + ; \ + make -j "$(nproc)"; \ + make install; \ + \ + rm -rf /tmp/rust; \ + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; \ + apk add --no-network --virtual .ruby-rundeps $runDeps; \ + apk del --no-network .ruby-builddeps; \ + \ + cd /; \ + rm -r /usr/src/ruby; \ +# verify we have no "ruby" packages installed + if \ + apk --no-network list --installed \ + | grep -v '^[.]ruby-rundeps' \ + | grep -i ruby \ + ; then \ + exit 1; \ + fi; \ + [ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \ +# rough smoke test + ruby --version; \ + gem --version; \ + bundle --version + +# don't create ".bundle" in all our apps +ENV GEM_HOME /usr/local/bundle +ENV BUNDLE_SILENCE_ROOT_WARNING=1 \ + BUNDLE_APP_CONFIG="$GEM_HOME" +ENV PATH $GEM_HOME/bin:$PATH +# adjust permissions of a few directories for running "gem install" as an arbitrary user +RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME" + +CMD [ "irb" ] diff --git a/versions.json b/versions.json index 4c85019d79..d4aecf2446 100644 --- a/versions.json +++ b/versions.json @@ -28,6 +28,7 @@ "slim-bullseye", "buster", "slim-buster", + "alpine3.18", "alpine3.17", "alpine3.16" ], @@ -72,6 +73,7 @@ "slim-bullseye", "buster", "slim-buster", + "alpine3.18", "alpine3.17", "alpine3.16" ], diff --git a/versions.sh b/versions.sh index 297c9f9aa0..c27a96ad98 100755 --- a/versions.sh +++ b/versions.sh @@ -75,11 +75,12 @@ for version in "${versions[@]}"; do empty # trailing comma hack | ., "slim-" + .), # https://github.com/docker-library/ruby/pull/142#issuecomment-320012893 ( - # Alpine 3.17 defaults to OpenSSL 3 which is not supported (yet?) by Ruby 2.7 or 3.0 + # Alpine 3.17+ defaults to OpenSSL 3 which is not supported (yet?) by Ruby 2.7 or 3.0 # https://bugs.ruby-lang.org/issues/18658 # https://github.com/docker-library/ruby/pull/392#issuecomment-1329896174 if [ "2.7", "3.0" ] | index(env.version) then empty else "3.17", + "3.18", empty # trailing comma hack end, "3.16", From 10e743ee7f6444f683d184c8b5d3fbd23a15acae Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 10 May 2023 15:08:13 -0700 Subject: [PATCH 2/2] Remove Alpine 3.16 from most versions (max 2 supported Alpine versions at a time), fix ordering --- 3.1/alpine3.16/Dockerfile | 141 -------------------------------- 3.2/alpine3.16/Dockerfile | 165 -------------------------------------- versions.json | 6 +- versions.sh | 8 +- 4 files changed, 5 insertions(+), 315 deletions(-) delete mode 100644 3.1/alpine3.16/Dockerfile delete mode 100644 3.2/alpine3.16/Dockerfile diff --git a/3.1/alpine3.16/Dockerfile b/3.1/alpine3.16/Dockerfile deleted file mode 100644 index 007b802002..0000000000 --- a/3.1/alpine3.16/Dockerfile +++ /dev/null @@ -1,141 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.16 - -RUN set -eux; \ - apk add --no-cache \ - bzip2 \ - ca-certificates \ - gmp-dev \ - libffi-dev \ - procps \ - yaml-dev \ - zlib-dev \ - ; - -# skip installing gem documentation -RUN set -eux; \ - mkdir -p /usr/local/etc; \ - { \ - echo 'install: --no-document'; \ - echo 'update: --no-document'; \ - } >> /usr/local/etc/gemrc - -ENV LANG C.UTF-8 -ENV RUBY_MAJOR 3.1 -ENV RUBY_VERSION 3.1.4 -ENV RUBY_DOWNLOAD_SHA256 1b6d6010e76036c937b9671f4752f065aeca800a6c664f71f6c9a699453af94f - -# some of ruby's build scripts are written in ruby -# we purge system ruby later to make sure our final image uses what we just built -RUN set -eux; \ - \ -# readline-dev vs libedit-dev: https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75 - apk add --no-cache --virtual .ruby-builddeps \ - autoconf \ - bison \ - bzip2 \ - bzip2-dev \ - ca-certificates \ - coreutils \ - dpkg-dev dpkg \ - g++ \ - gcc \ - gdbm-dev \ - glib-dev \ - libc-dev \ - libffi-dev \ - libxml2-dev \ - libxslt-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - patch \ - procps \ - readline-dev \ - ruby \ - tar \ - xz \ - yaml-dev \ - zlib-dev \ - ; \ - \ - wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz"; \ - echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum --check --strict; \ - \ - mkdir -p /usr/src/ruby; \ - tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1; \ - rm ruby.tar.xz; \ - \ - cd /usr/src/ruby; \ - \ -# https://github.com/docker-library/ruby/issues/196 -# https://bugs.ruby-lang.org/issues/14387#note-13 (patch source) -# https://bugs.ruby-lang.org/issues/14387#note-16 ("Therefore ncopa's patch looks good for me in general." -- only breaks glibc which doesn't matter here) - wget -O 'thread-stack-fix.patch' 'https://bugs.ruby-lang.org/attachments/download/7081/0001-thread_pthread.c-make-get_main_stack-portable-on-lin.patch'; \ - echo '3ab628a51d92fdf0d2b5835e93564857aea73e0c1de00313864a94a6255cb645 *thread-stack-fix.patch' | sha256sum --check --strict; \ - patch -p1 -i thread-stack-fix.patch; \ - rm thread-stack-fix.patch; \ - \ -# the configure script does not detect isnan/isinf as macros - export ac_cv_func_isnan=yes ac_cv_func_isinf=yes; \ - \ -# hack in "ENABLE_PATH_CHECK" disabling to suppress: -# warning: Insecure world writable dir - { \ - echo '#define ENABLE_PATH_CHECK 0'; \ - echo; \ - cat file.c; \ - } > file.c.new; \ - mv file.c.new file.c; \ - \ - autoconf; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --disable-install-doc \ - --enable-shared \ - ; \ - make -j "$(nproc)"; \ - make install; \ - \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-network --virtual .ruby-rundeps $runDeps; \ - apk del --no-network .ruby-builddeps; \ - \ - cd /; \ - rm -r /usr/src/ruby; \ -# verify we have no "ruby" packages installed - if \ - apk --no-network list --installed \ - | grep -v '^[.]ruby-rundeps' \ - | grep -i ruby \ - ; then \ - exit 1; \ - fi; \ - [ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \ -# rough smoke test - ruby --version; \ - gem --version; \ - bundle --version - -# don't create ".bundle" in all our apps -ENV GEM_HOME /usr/local/bundle -ENV BUNDLE_SILENCE_ROOT_WARNING=1 \ - BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH -# adjust permissions of a few directories for running "gem install" as an arbitrary user -RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME" - -CMD [ "irb" ] diff --git a/3.2/alpine3.16/Dockerfile b/3.2/alpine3.16/Dockerfile deleted file mode 100644 index a813244cd3..0000000000 --- a/3.2/alpine3.16/Dockerfile +++ /dev/null @@ -1,165 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.16 - -RUN set -eux; \ - apk add --no-cache \ - bzip2 \ - ca-certificates \ - gmp-dev \ - libffi-dev \ - procps \ - yaml-dev \ - zlib-dev \ - ; - -# skip installing gem documentation -RUN set -eux; \ - mkdir -p /usr/local/etc; \ - { \ - echo 'install: --no-document'; \ - echo 'update: --no-document'; \ - } >> /usr/local/etc/gemrc - -ENV LANG C.UTF-8 -ENV RUBY_MAJOR 3.2 -ENV RUBY_VERSION 3.2.2 -ENV RUBY_DOWNLOAD_SHA256 4b352d0f7ec384e332e3e44cdbfdcd5ff2d594af3c8296b5636c710975149e23 - -# some of ruby's build scripts are written in ruby -# we purge system ruby later to make sure our final image uses what we just built -RUN set -eux; \ - \ -# readline-dev vs libedit-dev: https://bugs.ruby-lang.org/issues/11869 and https://github.com/docker-library/ruby/issues/75 - apk add --no-cache --virtual .ruby-builddeps \ - autoconf \ - bison \ - bzip2 \ - bzip2-dev \ - ca-certificates \ - coreutils \ - dpkg-dev dpkg \ - g++ \ - gcc \ - gdbm-dev \ - glib-dev \ - libc-dev \ - libffi-dev \ - libxml2-dev \ - libxslt-dev \ - linux-headers \ - make \ - ncurses-dev \ - openssl \ - openssl-dev \ - patch \ - procps \ - readline-dev \ - ruby \ - tar \ - xz \ - yaml-dev \ - zlib-dev \ - ; \ - \ - rustArch=; \ - apkArch="$(apk --print-arch)"; \ - case "$apkArch" in \ - 'x86_64') rustArch='x86_64-unknown-linux-musl'; rustupUrl='https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-musl/rustup-init'; rustupSha256='95427cb0592e32ed39c8bd522fe2a40a746ba07afb8149f91e936cddb4d6eeac' ;; \ - 'aarch64') rustArch='aarch64-unknown-linux-musl'; rustupUrl='https://static.rust-lang.org/rustup/archive/1.25.1/aarch64-unknown-linux-musl/rustup-init'; rustupSha256='7855404cdc50c20040c743800c947b6f452490d47f8590a4a83bc6f75d1d8eda' ;; \ - esac; \ - \ - if [ -n "$rustArch" ]; then \ - mkdir -p /tmp/rust; \ - \ - wget -O /tmp/rust/rustup-init "$rustupUrl"; \ - echo "$rustupSha256 */tmp/rust/rustup-init" | sha256sum --check --strict; \ - chmod +x /tmp/rust/rustup-init; \ - \ - export RUSTUP_HOME='/tmp/rust/rustup' CARGO_HOME='/tmp/rust/cargo'; \ - export PATH="$CARGO_HOME/bin:$PATH"; \ - /tmp/rust/rustup-init -y --no-modify-path --profile minimal --default-toolchain '1.66.0' --default-host "$rustArch"; \ - \ - rustc --version; \ - cargo --version; \ - fi; \ - \ - wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz"; \ - echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum --check --strict; \ - \ - mkdir -p /usr/src/ruby; \ - tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1; \ - rm ruby.tar.xz; \ - \ - cd /usr/src/ruby; \ - \ -# https://github.com/docker-library/ruby/issues/196 -# https://bugs.ruby-lang.org/issues/14387#note-13 (patch source) -# https://bugs.ruby-lang.org/issues/14387#note-16 ("Therefore ncopa's patch looks good for me in general." -- only breaks glibc which doesn't matter here) - wget -O 'thread-stack-fix.patch' 'https://bugs.ruby-lang.org/attachments/download/7081/0001-thread_pthread.c-make-get_main_stack-portable-on-lin.patch'; \ - echo '3ab628a51d92fdf0d2b5835e93564857aea73e0c1de00313864a94a6255cb645 *thread-stack-fix.patch' | sha256sum --check --strict; \ - patch -p1 -i thread-stack-fix.patch; \ - rm thread-stack-fix.patch; \ - \ -# the configure script does not detect isnan/isinf as macros - export ac_cv_func_isnan=yes ac_cv_func_isinf=yes; \ - \ -# hack in "ENABLE_PATH_CHECK" disabling to suppress: -# warning: Insecure world writable dir - { \ - echo '#define ENABLE_PATH_CHECK 0'; \ - echo; \ - cat file.c; \ - } > file.c.new; \ - mv file.c.new file.c; \ - \ - autoconf; \ - gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \ - ./configure \ - --build="$gnuArch" \ - --disable-install-doc \ - --enable-shared \ - ${rustArch:+--enable-yjit} \ - ; \ - make -j "$(nproc)"; \ - make install; \ - \ - rm -rf /tmp/rust; \ - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; \ - apk add --no-network --virtual .ruby-rundeps $runDeps; \ - apk del --no-network .ruby-builddeps; \ - \ - cd /; \ - rm -r /usr/src/ruby; \ -# verify we have no "ruby" packages installed - if \ - apk --no-network list --installed \ - | grep -v '^[.]ruby-rundeps' \ - | grep -i ruby \ - ; then \ - exit 1; \ - fi; \ - [ "$(command -v ruby)" = '/usr/local/bin/ruby' ]; \ -# rough smoke test - ruby --version; \ - gem --version; \ - bundle --version - -# don't create ".bundle" in all our apps -ENV GEM_HOME /usr/local/bundle -ENV BUNDLE_SILENCE_ROOT_WARNING=1 \ - BUNDLE_APP_CONFIG="$GEM_HOME" -ENV PATH $GEM_HOME/bin:$PATH -# adjust permissions of a few directories for running "gem install" as an arbitrary user -RUN mkdir -p "$GEM_HOME" && chmod 1777 "$GEM_HOME" - -CMD [ "irb" ] diff --git a/versions.json b/versions.json index d4aecf2446..0d8a13b66d 100644 --- a/versions.json +++ b/versions.json @@ -29,8 +29,7 @@ "buster", "slim-buster", "alpine3.18", - "alpine3.17", - "alpine3.16" + "alpine3.17" ], "version": "3.1.4" }, @@ -74,8 +73,7 @@ "buster", "slim-buster", "alpine3.18", - "alpine3.17", - "alpine3.16" + "alpine3.17" ], "version": "3.2.2" } diff --git a/versions.sh b/versions.sh index c27a96ad98..e9dde46d12 100755 --- a/versions.sh +++ b/versions.sh @@ -78,13 +78,11 @@ for version in "${versions[@]}"; do # Alpine 3.17+ defaults to OpenSSL 3 which is not supported (yet?) by Ruby 2.7 or 3.0 # https://bugs.ruby-lang.org/issues/18658 # https://github.com/docker-library/ruby/pull/392#issuecomment-1329896174 - if [ "2.7", "3.0" ] | index(env.version) then empty else - "3.17", + if [ "2.7", "3.0" ] | index(env.version) then "3.16" else "3.18", + "3.17", empty # trailing comma hack - end, - "3.16", - empty # trailing comma hack + end | "alpine" + .) ], }