Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninstall OpenSSL 3 and install 1.0.0 #30

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions 3.0/fedora/latest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM fedora:latest
# fedora:40 and later don't have openssl1.1 included, and ruby 3.0 requires openssl <3.0
FROM fedora:39

# skip installing gem documentation
RUN mkdir -p /usr/local/etc \
Expand All @@ -11,6 +12,9 @@ ENV RUBY_MAJOR 3.0
ENV RUBY_VERSION 3.0.3
ENV RUBY_DOWNLOAD_SHA256 88cc7f0f021f15c4cd62b1f922e3a401697f7943551fe45b1fdf4f2417a17a9c

# beyond fedora:35, openssl included is 3.x
RUN dnf remove -y openssl

# 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 -ex \
Expand All @@ -27,7 +31,8 @@ RUN set -ex \
libtool \
make \
net-tools \
openssl-devel \
openssl1.1-devel \
openssl1.1 \
patch \
readline-devel \
util-linux \
Expand Down
18 changes: 12 additions & 6 deletions 3.0/opensuse/15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ ENV RUBY_MAJOR 3.0
ENV RUBY_VERSION 3.0.3
ENV RUBY_DOWNLOAD_SHA256 88cc7f0f021f15c4cd62b1f922e3a401697f7943551fe45b1fdf4f2417a17a9c

RUN zypper install -y wget

RUN wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-${RUBY_VERSION}.tar.xz"
RUN echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum -c -

# need to downgrade openssl for ruby 3.0 default build
RUN zypper rm -y openssl-3

# 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 -ex \
Expand All @@ -26,22 +34,20 @@ RUN set -ex \
ncurses-devel \
readline-devel \
zlib-devel \
libopenssl-devel \
wget \
bison \
patch \
libtool \
automake \
curl \
xz \
which \
libopenssl-1_0_0-devel \
libopenssl1_0_0 \
openssl-1_0_0 \
hostname \
' \
&& zypper install -y $BaseDeps ruby \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-${RUBY_VERSION}.tar.xz" \
&& echo "$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz" | sha256sum -c - \
\
&& mkdir -p /usr/src/ruby \
&& tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1 \
&& rm ruby.tar.xz \
Expand All @@ -68,7 +74,7 @@ RUN set -ex \
&& cd / \
&& rm -r /usr/src/ruby \
# rough smoke test
&& ruby --version && gem --version && bundle --version
RUN ruby --version && gem --version && bundle --version

# install things globally, for great justice
# and don't create ".bundle" in all our apps
Expand Down
21 changes: 21 additions & 0 deletions 3.0/opensuse/15/test_the_dockers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
%w(15.3 15.4 15.5 15.6).each do |version|
puts version
dockerfile=File.read("Dockerfile").each_line.to_a
dockerfile[0]="FROM opensuse/leap:#{version}\n"
File.open("Dockerfile", "wt") do |f|
f.puts dockerfile.join
end

%x(
docker build . --platform linux/amd64 -t localsuse
printf "opensuse/leap version: %s " #{version} >> output.txt
docker run --platform linux/amd64 -it localsuse ruby -e 'require "openssl"'
if [ $? -eq 0 ]
then
echo "PASS" >> output.txt
else
echo "FAIL" >> output.txt
fi
)
end