diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index 57f9fee..bb64162 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -144,6 +144,31 @@ jobs: version: "9.4" libc: musl arch: ["x86_64", "aarch64"] + # centos + - engine: ruby + version: "2.7" + libc: centos + arch: ["x86_64", "aarch64"] + - engine: ruby + version: "3.0" + libc: centos + arch: ["x86_64", "aarch64"] + - engine: ruby + version: "3.1" + libc: centos + arch: ["x86_64", "aarch64"] + - engine: ruby + version: "3.2" + libc: centos + arch: ["x86_64", "aarch64"] + - engine: ruby + version: "3.3" + libc: centos + arch: ["x86_64", "aarch64"] + - engine: ruby + version: "3.4" + libc: centos + arch: ["x86_64", "aarch64"] runs-on: ubuntu-latest name: Build (${{ matrix.engine }} ${{ matrix.version }} ${{ matrix.libc }}) steps: @@ -229,7 +254,7 @@ jobs: docker run --platform linux/aarch64 --rm ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} bundle --version docker run --platform linux/aarch64 --rm -v "${PWD}":"${PWD}" -w "${PWD}" -e BUNDLE_GEMFILE=gemfiles/${{ matrix.engine }}-${{ matrix.version }}.gemfile ${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.TAG }} /bin/sh -c 'bundle install --with="test" --without="check ide" && bundle exec rake test' - # TODO: hardcoded musl, unify gnu instead + # TODO: hardcoded musl, unify gnu+centos instead # TODO: hardcoded tags, use proper tag building - name: Tag single-arch image (aarch64) if: ${{ contains(matrix.arch, 'aarch64') }} diff --git a/src/engines/ruby/2.7/Dockerfile.centos b/src/engines/ruby/2.7/Dockerfile.centos new file mode 100644 index 0000000..7ae38bb --- /dev/null +++ b/src/engines/ruby/2.7/Dockerfile.centos @@ -0,0 +1,137 @@ +# CentOS 7.9 has glibc 2.17 +FROM public.ecr.aws/docker/library/centos:centos7.9.2009 + +# Set yum vault +RUN < /etc/yum.repos.d/CentOS-Base.repo +[base] +name=CentOS-\$releasever - Base +baseurl=http://vault.centos.org/${repo_version}/os/\$basearch/ +gpgcheck=0 + +[updates] +name=CentOS-\$releasever - Updates +baseurl=http://vault.centos.org/${repo_version}/updates/\$basearch/ +gpgcheck=0 + +[extras] +name=CentOS-\$releasever - Extras +baseurl=http://vault.centos.org/${repo_version}/extras/\$basearch/ +gpgcheck=0 + +[centosplus] +name=CentOS-\$releasever - Plus +baseurl=http://vault.centos.org/${repo_version}/centosplus/\$basearch/ +gpgcheck=0 +enabled=0 +EOF +SHELL + +RUN yum update -y + +RUN yum install -y curl gcc make + +# Skip installing gem documentation +COPY < file.c.new +mv file.c.new file.c + +autoconf + +gnuArch="$(gcc -dumpmachine)" +./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --disable-shared +make -j "$(nproc)" +make install + +# find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ +# | awk '/=>/ { print $(NF-1) }' \ +# | sort -u \ +# | grep -vE '^/usr/local/lib/' \ +# | xargs -r dpkg-query --search \ +# | cut -d: -f1 \ +# | sort -u \ +# | xargs -r apt-mark manual \ +# +# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ +# +# find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ +# | awk '/=>/ { print $(NF-1) }' \ +# | grep -v '=>' \ +# | sort -u \ +# | grep -vE '^/usr/local/lib/' \ +# | xargs -r rpm -qf \ +# | sort -u \ +# | xargs -r yum ?mark-manual? +# +# yum autoremove -y +# yum remove --setopt=clean_requirements_on_remove=1 +# package-cleanup --leaves && yum autoremove # yum-utils +# sudo yum history list pdftk +# sudo yum history undo 88 + +cd / +rm -r /usr/src/ruby +if yum list installed ruby; then exit 1; fi + +# update gem version +gem update --system 3.3.27 + +# rough smoke test +ruby --version +gem --version +bundle --version + +SHELL + +# 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/src/engines/ruby/3.0/Dockerfile.centos b/src/engines/ruby/3.0/Dockerfile.centos new file mode 100644 index 0000000..b4628f5 --- /dev/null +++ b/src/engines/ruby/3.0/Dockerfile.centos @@ -0,0 +1,122 @@ +# CentOS 7.9 has glibc 2.17 +FROM public.ecr.aws/docker/library/centos:centos7.9.2009 + +# Set yum vault +RUN < /etc/yum.repos.d/CentOS-Base.repo +[base] +name=CentOS-\$releasever - Base +baseurl=http://vault.centos.org/${repo_version}/os/\$basearch/ +gpgcheck=0 + +[updates] +name=CentOS-\$releasever - Updates +baseurl=http://vault.centos.org/${repo_version}/updates/\$basearch/ +gpgcheck=0 + +[extras] +name=CentOS-\$releasever - Extras +baseurl=http://vault.centos.org/${repo_version}/extras/\$basearch/ +gpgcheck=0 + +[centosplus] +name=CentOS-\$releasever - Plus +baseurl=http://vault.centos.org/${repo_version}/centosplus/\$basearch/ +gpgcheck=0 +enabled=0 +EOF +SHELL + +RUN yum update -y + +RUN yum install -y curl gcc make + +# Skip installing gem documentation +COPY < file.c.new +mv file.c.new file.c + +autoconf + +gnuArch="$(gcc -dumpmachine)" +./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --disable-shared +make -j "$(nproc)" +make install + +# find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ +# | awk '/=>/ { print $(NF-1) }' \ +# | sort -u \ +# | grep -vE '^/usr/local/lib/' \ +# | xargs -r dpkg-query --search \ +# | cut -d: -f1 \ +# | sort -u \ +# | xargs -r apt-mark manual \ +# +# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + +cd / +rm -r /usr/src/ruby +if yum list installed ruby; then exit 1; fi + +# update gem version +gem update --system 3.3.27 + +# rough smoke test +ruby --version +gem --version +bundle --version + +SHELL + +# 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/src/engines/ruby/3.1/Dockerfile.centos b/src/engines/ruby/3.1/Dockerfile.centos new file mode 100644 index 0000000..ebc2909 --- /dev/null +++ b/src/engines/ruby/3.1/Dockerfile.centos @@ -0,0 +1,122 @@ +# CentOS 7.9 has glibc 2.17 +FROM public.ecr.aws/docker/library/centos:centos7.9.2009 + +# Set yum vault +RUN < /etc/yum.repos.d/CentOS-Base.repo +[base] +name=CentOS-\$releasever - Base +baseurl=http://vault.centos.org/${repo_version}/os/\$basearch/ +gpgcheck=0 + +[updates] +name=CentOS-\$releasever - Updates +baseurl=http://vault.centos.org/${repo_version}/updates/\$basearch/ +gpgcheck=0 + +[extras] +name=CentOS-\$releasever - Extras +baseurl=http://vault.centos.org/${repo_version}/extras/\$basearch/ +gpgcheck=0 + +[centosplus] +name=CentOS-\$releasever - Plus +baseurl=http://vault.centos.org/${repo_version}/centosplus/\$basearch/ +gpgcheck=0 +enabled=0 +EOF +SHELL + +RUN yum update -y + +RUN yum install -y curl gcc make + +# Skip installing gem documentation +COPY < file.c.new +mv file.c.new file.c + +autoconf + +gnuArch="$(gcc -dumpmachine)" +./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --disable-shared +make -j "$(nproc)" +make install + +# find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ +# | awk '/=>/ { print $(NF-1) }' \ +# | sort -u \ +# | grep -vE '^/usr/local/lib/' \ +# | xargs -r dpkg-query --search \ +# | cut -d: -f1 \ +# | sort -u \ +# | xargs -r apt-mark manual \ +# +# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + +cd / +rm -r /usr/src/ruby +if yum list installed ruby; then exit 1; fi + +# update gem version +gem update --system 3.3.27 + +# rough smoke test +ruby --version +gem --version +bundle --version + +SHELL + +# 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/src/engines/ruby/3.2/Dockerfile.centos b/src/engines/ruby/3.2/Dockerfile.centos new file mode 100644 index 0000000..ab56699 --- /dev/null +++ b/src/engines/ruby/3.2/Dockerfile.centos @@ -0,0 +1,153 @@ +# CentOS 7.9 has glibc 2.17 +FROM public.ecr.aws/docker/library/centos:centos7.9.2009 + +# Set yum vault +RUN < /etc/yum.repos.d/CentOS-Base.repo +[base] +name=CentOS-\$releasever - Base +baseurl=http://vault.centos.org/${repo_version}/os/\$basearch/ +gpgcheck=0 + +[updates] +name=CentOS-\$releasever - Updates +baseurl=http://vault.centos.org/${repo_version}/updates/\$basearch/ +gpgcheck=0 + +[extras] +name=CentOS-\$releasever - Extras +baseurl=http://vault.centos.org/${repo_version}/extras/\$basearch/ +gpgcheck=0 + +[centosplus] +name=CentOS-\$releasever - Plus +baseurl=http://vault.centos.org/${repo_version}/centosplus/\$basearch/ +gpgcheck=0 +enabled=0 +EOF +SHELL + +RUN yum update -y + +RUN yum install -y curl gcc make + +# Skip installing gem documentation +COPY < file.c.new +mv file.c.new file.c + +autoconf + +gnuArch="$(gcc -dumpmachine)" +./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --disable-shared \ + ${rustArch:+--enable-yjit} +make -j "$(nproc)" +make install + +rm -rf /tmp/rust + +# find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ +# | awk '/=>/ { print $(NF-1) }' \ +# | sort -u \ +# | grep -vE '^/usr/local/lib/' \ +# | xargs -r dpkg-query --search \ +# | cut -d: -f1 \ +# | sort -u \ +# | xargs -r apt-mark manual \ +# +# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + +cd / +rm -r /usr/src/ruby +if yum list installed ruby; then exit 1; fi + +# update gem version +gem update --system 3.3.27 + +# rough smoke test +ruby --version +gem --version +bundle --version + +SHELL + +# 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/src/engines/ruby/3.3/Dockerfile.centos b/src/engines/ruby/3.3/Dockerfile.centos new file mode 100644 index 0000000..5fd1e88 --- /dev/null +++ b/src/engines/ruby/3.3/Dockerfile.centos @@ -0,0 +1,154 @@ +# CentOS 7.9 has glibc 2.17 +FROM public.ecr.aws/docker/library/centos:centos7.9.2009 + +# Set yum vault +RUN < /etc/yum.repos.d/CentOS-Base.repo +[base] +name=CentOS-\$releasever - Base +baseurl=http://vault.centos.org/${repo_version}/os/\$basearch/ +gpgcheck=0 + +[updates] +name=CentOS-\$releasever - Updates +baseurl=http://vault.centos.org/${repo_version}/updates/\$basearch/ +gpgcheck=0 + +[extras] +name=CentOS-\$releasever - Extras +baseurl=http://vault.centos.org/${repo_version}/extras/\$basearch/ +gpgcheck=0 + +[centosplus] +name=CentOS-\$releasever - Plus +baseurl=http://vault.centos.org/${repo_version}/centosplus/\$basearch/ +gpgcheck=0 +enabled=0 +EOF +SHELL + +RUN yum update -y + +RUN yum install -y curl gcc make + +# Skip installing gem documentation +COPY < file.c.new +mv file.c.new file.c + +autoconf + +gnuArch="$(gcc -dumpmachine)" +./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --disable-shared \ + ${rustArch:+--enable-yjit} +make -j "$(nproc)" +make install + +rm -rf /tmp/rust + +# find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ +# | awk '/=>/ { print $(NF-1) }' \ +# | sort -u \ +# | grep -vE '^/usr/local/lib/' \ +# | xargs -r dpkg-query --search \ +# | cut -d: -f1 \ +# | sort -u \ +# | xargs -r apt-mark manual \ +# +# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + +cd / +rm -r /usr/src/ruby +if yum list installed ruby; then exit 1; fi + +# update gem version +gem update --system 3.3.27 + +# rough smoke test +ruby --version +gem --version +bundle --version + +SHELL + +# 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/src/engines/ruby/3.4/Dockerfile.centos b/src/engines/ruby/3.4/Dockerfile.centos new file mode 100644 index 0000000..51ac375 --- /dev/null +++ b/src/engines/ruby/3.4/Dockerfile.centos @@ -0,0 +1,154 @@ +# CentOS 7.9 has glibc 2.17 +FROM public.ecr.aws/docker/library/centos:centos7.9.2009 + +# Set yum vault +RUN < /etc/yum.repos.d/CentOS-Base.repo +[base] +name=CentOS-\$releasever - Base +baseurl=http://vault.centos.org/${repo_version}/os/\$basearch/ +gpgcheck=0 + +[updates] +name=CentOS-\$releasever - Updates +baseurl=http://vault.centos.org/${repo_version}/updates/\$basearch/ +gpgcheck=0 + +[extras] +name=CentOS-\$releasever - Extras +baseurl=http://vault.centos.org/${repo_version}/extras/\$basearch/ +gpgcheck=0 + +[centosplus] +name=CentOS-\$releasever - Plus +baseurl=http://vault.centos.org/${repo_version}/centosplus/\$basearch/ +gpgcheck=0 +enabled=0 +EOF +SHELL + +RUN yum update -y + +RUN yum install -y curl gcc make + +# Skip installing gem documentation +COPY < file.c.new +mv file.c.new file.c + +autoconf + +gnuArch="$(gcc -dumpmachine)" +./configure \ + --build="$gnuArch" \ + --disable-install-doc \ + --disable-shared \ + ${rustArch:+--enable-yjit} +make -j "$(nproc)" +make install + +rm -rf /tmp/rust + +# find /usr/local -type f -executable -not \( -name '*tkinter*' \) -exec ldd '{}' ';' \ +# | awk '/=>/ { print $(NF-1) }' \ +# | sort -u \ +# | grep -vE '^/usr/local/lib/' \ +# | xargs -r dpkg-query --search \ +# | cut -d: -f1 \ +# | sort -u \ +# | xargs -r apt-mark manual \ +# +# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + +cd / +rm -r /usr/src/ruby +if yum list installed ruby; then exit 1; fi + +# update gem version +gem update --system 3.3.27 + +# rough smoke test +ruby --version +gem --version +bundle --version + +SHELL + +# 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" ] +