2023-08-22 18:43:53 +00:00
|
|
|
ARG ALPINE_VERSION=3.18.3
|
|
|
|
ARG BASE_IMAGE=gitea.nulo.in/sutty/sutty
|
2024-06-21 15:34:36 +00:00
|
|
|
FROM ${BASE_IMAGE}:${ALPINE_VERSION} AS build
|
2022-02-15 18:44:31 +00:00
|
|
|
ARG RUBY_VERSION=2.7
|
|
|
|
ARG RUBY_PATCH=5
|
2021-03-27 13:47:17 +00:00
|
|
|
|
2022-02-15 18:44:31 +00:00
|
|
|
RUN apk add --no-cache ruby~${RUBY_VERSION}.${RUBY_PATCH} patch
|
2019-12-20 21:22:00 +00:00
|
|
|
|
2022-02-15 18:23:19 +00:00
|
|
|
# Patch rubygems to install x86_64-linux-musl gems
|
|
|
|
COPY ./rubygems-platform-musl.patch /tmp/
|
|
|
|
RUN cd /usr/lib/ruby/${RUBY_VERSION}.0 && patch -Np 0 -i /tmp/rubygems-platform-musl.patch || true
|
2019-09-10 23:24:35 +00:00
|
|
|
|
2021-10-03 23:19:00 +00:00
|
|
|
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
2024-06-21 15:21:51 +00:00
|
|
|
LABEL org.opencontainers.image.authors="f@sutty.nl"
|
2022-02-15 18:23:19 +00:00
|
|
|
ARG RUBY_VERSION
|
|
|
|
ARG RUBY_PATCH
|
2021-03-27 13:47:25 +00:00
|
|
|
|
2022-02-15 18:23:19 +00:00
|
|
|
# Install ruby and extracted gems and copy patched rubygems
|
2022-02-15 18:44:31 +00:00
|
|
|
RUN apk add --no-cache tzdata ruby~${RUBY_VERSION}.${RUBY_PATCH} && rm /usr/lib/ruby/${RUBY_VERSION}.0/rubygems.rb
|
2022-02-15 18:23:19 +00:00
|
|
|
RUN apk add --no-cache ruby-json ruby-bigdecimal ruby-rake ruby-bundler ruby-irb ruby-io-console ruby-etc
|
|
|
|
COPY --from=build /usr/lib/ruby/${RUBY_VERSION}.0/rubygems.rb /usr/lib/ruby/${RUBY_VERSION}.0/
|