From 35f24b089717d5eafdbd5af56975336bf0a6eea5 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 18 Sep 2019 13:43:54 -0300 Subject: [PATCH] musl --- Dockerfile | 7 ++++++- rubygems-platform-musl.patch | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 rubygems-platform-musl.patch diff --git a/Dockerfile b/Dockerfile index ed1a0ee..dd5d96c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,16 @@ ENV VERSION 2.5.5 RUN apk add --no-cache git nodejs nodejs-npm yarn tzdata libxslt-dev libxml2-dev RUN apk add --no-cache ruby-dev ruby-bundler ruby-json ruby-bigdecimal ruby-rake ruby-etc RUN apk add --no-cache postgresql-dev sqlite-dev mariadb-dev -RUN apk add --no-cache linux-headers cmake +RUN apk add --no-cache linux-headers RUN test "$VERSION" = `ruby -e 'puts RUBY_VERSION'` RUN addgroup -g 82 -S www-data RUN adduser -s /bin/sh -G www-data -h /home/app -D app RUN install -dm 2750 -o app -g www-data /home/app/sutty +# https://github.com/rubygems/rubygems/issues/2918 +# https://gitlab.alpinelinux.org/alpine/aports/issues/10808 +COPY ./rubygems-platform-musl.patch /tmp/ +RUN patch -d /usr/lib/ruby/2.5.0 -Np 0 -i /tmp/rubygems-platform-musl.patch + ENTRYPOINT /bin/sh diff --git a/rubygems-platform-musl.patch b/rubygems-platform-musl.patch new file mode 100644 index 0000000..4034704 --- /dev/null +++ b/rubygems-platform-musl.patch @@ -0,0 +1,25 @@ +--- rubygems/platform.rb.orig ++++ rubygems/platform.rb +@@ -89,7 +89,7 @@ + when /^dalvik(\d+)?$/ then [ 'dalvik', $1 ] + when /^dotnet$/ then [ 'dotnet', nil ] + when /^dotnet([\d.]*)/ then [ 'dotnet', $1 ] +- when /linux/ then [ 'linux', $1 ] ++ when /linux-?(\w+)?/ then [ 'linux', $1 ] + when /mingw32/ then [ 'mingw32', nil ] + when /(mswin\d+)(\_(\d+))?/ then + os, version = $1, $3 +--- rubygems.rb.orig ++++ rubygems.rb +@@ -764,10 +764,7 @@ + def self.platforms + @platforms ||= [] + if @platforms.empty? +- # XXX: Patched to avoid installing platform-specific gems with binaries +- # linked against glibc. +- @platforms = [Gem::Platform::RUBY] +- #@platforms = [Gem::Platform::RUBY, Gem::Platform.local] ++ @platforms = [Gem::Platform::RUBY, Gem::Platform.local] + end + @platforms + end