containers-sdk-ruby/Dockerfile
f 4d254a0874
Some checks failed
ci/woodpecker/push/woodpecker/1 Pipeline failed
ci/woodpecker/push/woodpecker/2 Pipeline was successful
ci/woodpecker/push/woodpecker/3 Pipeline was successful
ci/woodpecker/push/woodpecker/4 Pipeline was successful
Merge branch 'antifascista' of ssh://gitea.nulo.in:420/Sutty/containers-skel into antifascista
2024-07-23 10:20:57 -03:00

28 lines
1 KiB
Docker

ARG ALPINE_VERSION=3.13.6
ARG BASE_IMAGE=gitea.nulo.in/sutty/containers-sdk
ARG EMAIL=monit@sutty.nl
FROM alpine:${ALPINE_VERSION} AS build
ARG RUBY_VERSION=2.7
ARG RUBY_PATCH=5
ENV EMAIL ${EMAIL:-monit@sutty.nl}
RUN apk add --no-cache ruby~${RUBY_VERSION}.${RUBY_PATCH} patch
# 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
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
ARG ALPINE_VERSION
LABEL org.opencontainers.image.authors="f@sutty.nl"
ARG RUBY_VERSION
ARG RUBY_PATCH
# Install ruby and extracted gems and copy patched rubygems
RUN apk add --no-cache tzdata ruby~${RUBY_VERSION}.${RUBY_PATCH} && rm /usr/lib/ruby/${RUBY_VERSION}.0/rubygems.rb
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/
RUN apk add --no-cache ruby-dev
ENTRYPOINT /bin/sh