Skip to content

Commit

Permalink
Merge pull request #1 from sensu/feature/ruby-3.2.0
Browse files Browse the repository at this point in the history
Build Ruby 3.2.0 runtime assets
  • Loading branch information
portertech authored Jan 4, 2023
2 parents 7fc8223 + 243ec40 commit 1e371f2
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 333 deletions.
30 changes: 5 additions & 25 deletions .bonsai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: "#{repo}"
builds:
- platform: "alpine"
arch: "amd64"
asset_filename: "#{repo}_#{version}_ruby-2.4.4_alpine_linux_amd64.tar.gz"
asset_filename: "#{repo}_#{version}_ruby-3.2.0_alpine_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
Expand All @@ -12,35 +12,15 @@ builds:
- "entity.system.platform_version.split('.')[0] == '3'"
- platform: "debian"
arch: "amd64"
asset_filename: "#{repo}_#{version}_ruby-2.4.4_debian_linux_amd64.tar.gz"
asset_filename: "#{repo}_#{version}_ruby-3.2.0_debian_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform_family == 'debian'"
- platform: "centos6"
arch: "amd64"
asset_filename: "#{repo}_#{version}_ruby-2.4.4_centos6_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform != 'amazon'"
- "entity.system.platform_family == 'rhel'"
- "parseInt(entity.system.platform_version.split('.')[0]) == 6"
- platform: "centos7"
arch: "amd64"
asset_filename: "#{repo}_#{version}_ruby-2.4.4_centos7_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
- "entity.system.arch == 'amd64'"
- "entity.system.platform != 'amazon'"
- "entity.system.platform_family == 'rhel'"
- "parseInt(entity.system.platform_version.split('.')[0]) == 7"
- platform: "centos8"
arch: "amd64"
asset_filename: "#{repo}_#{version}_ruby-2.4.4_centos8_linux_amd64.tar.gz"
asset_filename: "#{repo}_#{version}_ruby-3.2.0_centos8_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
Expand All @@ -50,7 +30,7 @@ builds:
- "parseInt(entity.system.platform_version.split('.')[0]) == 8"
- platform: "amzn1"
arch: "amd64"
asset_filename: "#{repo}_#{version}_ruby-2.4.4_amzn1_linux_amd64.tar.gz"
asset_filename: "#{repo}_#{version}_ruby-3.2.0_amzn1_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
Expand All @@ -59,7 +39,7 @@ builds:
- "entity.system.platform_version.split('.')[0] == '2018'"
- platform: "amzn2"
arch: "amd64"
asset_filename: "#{repo}_#{version}_ruby-2.4.4_amzn2_linux_amd64.tar.gz"
asset_filename: "#{repo}_#{version}_ruby-3.2.0_amzn2_linux_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'linux'"
Expand Down
27 changes: 14 additions & 13 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
FROM alpine:3.14.1

ARG RUBY_VERSION=2.4.4
ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build

RUN apk --no-cache add build-base gmp-dev zlib-dev gdbm-dev db-dev readline-dev libffi-dev coreutils yaml-dev linux-headers autoconf
RUN apk --no-cache add openssh-client openssl-dev libc6-compat
RUN apk --no-cache add wget git sudo bash bash-doc bash-completion


RUN wget -O ruby-install-0.7.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz
RUN tar -xzvf ruby-install-0.7.0.tar.gz
RUN cd ruby-install-0.7.0/ && ac_cv_func_isnan=yes ac_cv_func_isinf=yes make install
RUN ac_cv_func_isnan=yes ac_cv_func_isinf=yes ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc unf_ext
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc sys-filesystem
RUN wget -O ruby-install-0.8.5.tar.gz https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz
RUN tar -xzvf ruby-install-0.8.5.tar.gz
RUN cd ruby-install-0.8.5/ && ac_cv_func_isnan=yes ac_cv_func_isinf=yes make install
RUN ac_cv_func_isnan=yes ac_cv_func_isinf=yes ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install unf_ext
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install sys-filesystem

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN LIBS=$(apk info -L libc6-compat 2>/dev/null | grep "^lib/lib" | sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: /$f" && cp /$f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: /$f" && cp /$f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/

RUN mkdir /assets/ && \
export SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_alpine_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \
RUN export SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_alpine_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \
touch $SENSU_ASSET && \
tar -czf $SENSU_ASSET -C /opt/rubies/ruby-${RUBY_VERSION}/ .

ENV PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin
25 changes: 13 additions & 12 deletions Dockerfile.alpine3.8
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
FROM alpine:3.8

ARG RUBY_VERSION=2.4.4
ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build

RUN apk --no-cache add build-base gmp-dev zlib-dev gdbm-dev db-dev readline-dev libffi-dev coreutils yaml-dev linux-headers autoconf
RUN apk --no-cache add openssh-client openssl-dev libc6-compat
RUN apk --no-cache add wget git sudo bash bash-doc bash-completion


RUN wget -O ruby-install-0.7.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz
RUN tar -xzvf ruby-install-0.7.0.tar.gz
RUN cd ruby-install-0.7.0/ && ac_cv_func_isnan=yes ac_cv_func_isinf=yes make install
RUN ac_cv_func_isnan=yes ac_cv_func_isinf=yes ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc unf_ext
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc sys-filesystem
RUN wget -O ruby-install-0.8.5.tar.gz https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz
RUN tar -xzvf ruby-install-0.8.5.tar.gz
RUN cd ruby-install-0.8.5/ && ac_cv_func_isnan=yes ac_cv_func_isinf=yes make install
RUN ac_cv_func_isnan=yes ac_cv_func_isinf=yes ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install unf_ext
RUN PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install sys-filesystem

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -exec ldd {} 2>/dev/null \;| grep "=>" | grep -v "vdso.so.1" | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN LIBS=$(apk info -L libc6-compat 2>/dev/null | grep "^lib/lib" | sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: /$f" && cp /$f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done

RUN mkdir /assets/ && \
export SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_alpine3.8_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \
RUN mkdir /assets/

RUN export SENSU_ASSET="/assets/sensu-ruby-runtime_${ASSET_VERSION}_ruby-${RUBY_VERSION}_alpine3.8_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64.tar.gz" && \
touch $SENSU_ASSET && \
tar -czf $SENSU_ASSET -C /opt/rubies/ruby-${RUBY_VERSION}/ .

ENV PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin
13 changes: 7 additions & 6 deletions Dockerfile.amzn1
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM amazonlinux:1

ARG RUBY_VERSION=2.4.4
ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN yum update -y && yum groupinstall -y "Development Tools" && yum install -y curl
RUN yum update -y && yum groupinstall -y "Development Tools"
RUN yum install -y curl openssl-devel libffi-devel readline-devel psych psych-devel libyaml-devel

RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o ruby-install-0.7.0.tar.gz && \
tar -xzvf ruby-install-0.7.0.tar.gz && \
cd ruby-install-0.7.0/ && \
RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz -o ruby-install-0.8.5.tar.gz && \
tar -xzvf ruby-install-0.8.5.tar.gz && \
cd ruby-install-0.8.5/ && \
make install && \
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi sys-filesystem
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi sys-filesystem

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile.amzn2
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM amazonlinux:2

ARG RUBY_VERSION=2.4.4
ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN yum update -y && yum groupinstall -y "Development Tools" && yum install -y curl
RUN yum update -y && yum groupinstall -y "Development Tools"
RUN yum install -y curl openssl-devel libffi-devel readline-devel psych psych-devel libyaml-devel

RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o ruby-install-0.7.0.tar.gz && \
tar -xzvf ruby-install-0.7.0.tar.gz && \
cd ruby-install-0.7.0/ && \
RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz -o ruby-install-0.8.5.tar.gz && \
tar -xzvf ruby-install-0.8.5.tar.gz && \
cd ruby-install-0.8.5/ && \
make install && \
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi sys-filesystem
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi sys-filesystem

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done
Expand Down
24 changes: 0 additions & 24 deletions Dockerfile.centos

This file was deleted.

24 changes: 0 additions & 24 deletions Dockerfile.centos6

This file was deleted.

24 changes: 0 additions & 24 deletions Dockerfile.centos7

This file was deleted.

12 changes: 7 additions & 5 deletions Dockerfile.centos8
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
FROM centos:8

ARG RUBY_VERSION=2.4.4
ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

RUN dnf update -y && dnf groupinstall -y "Development Tools" && dnf install -y curl
RUN dnf install dnf-plugins-core
RUN dnf repolist --all
RUN dnf config-manager --set-enabled powertools

RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o ruby-install-0.7.0.tar.gz && \
tar -xzvf ruby-install-0.7.0.tar.gz && \
cd ruby-install-0.7.0/ && \
RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz -o ruby-install-0.8.5.tar.gz && \
tar -xzvf ruby-install-0.8.5.tar.gz && \
cd ruby-install-0.8.5/ && \
make install && \
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi sys-filesystem
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi sys-filesystem

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM debian:9

ARG RUBY_VERSION=2.4.4
ARG RUBY_VERSION=3.2.0
ARG ASSET_VERSION=local_build
ARG GREP_EXCLUDE='(ld.so|ld-linux-x86-64.so|libBrokenLocale.so|libSegFault.so|libanl.so|libc.so|libdl.so|libm.so|libmvec.so|libnss_compat.so|libnss_dns.so|libnss_files.so|libpthread.so|libresolv.so|librt.so|libthread_db.so|libutil.so|vdso.so)'

RUN apt-get update && apt-get install -y build-essential curl

RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz -o ruby-install-0.7.0.tar.gz && \
tar -xzvf ruby-install-0.7.0.tar.gz && \
cd ruby-install-0.7.0/ && \
RUN curl -L https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz -o ruby-install-0.8.5.tar.gz && \
tar -xzvf ruby-install-0.8.5.tar.gz && \
cd ruby-install-0.8.5/ && \
make install && \
ruby-install ruby ${RUBY_VERSION} -- --enable-load-relative --disable-install-doc && \
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install --no-ri --no-rdoc ffi sys-filesystem
PATH=$PATH:/opt/rubies/ruby-${RUBY_VERSION}/bin/ && gem install ffi sys-filesystem

RUN LIBS=$(find /opt/rubies/ruby-${RUBY_VERSION} -type f -executable -exec ldd {} 2>/dev/null \;| grep "=>" | egrep -v ${GREP_EXCLUDE} | awk '{print $3}'| sort -u ) && \
for f in $LIBS; do if [ -e $f ]; then echo "Copying Library: $f" && cp $f /opt/rubies/ruby-${RUBY_VERSION}/lib/; fi; done
Expand Down
Loading

0 comments on commit 1e371f2

Please sign in to comment.