Compare commits

..

No commits in common. "antifascista" and "63fcab0d4bb85b36a726c6befa4b1a745e5e2090" have entirely different histories.

2 changed files with 34 additions and 54 deletions

View file

@ -1,34 +1,22 @@
steps:
pipeline:
publish:
image: "docker.io/woodpeckerci/plugin-docker-buildx"
settings:
registry: "https://gitea.nulo.in"
username: "sutty"
repo: "gitea.nulo.in/sutty/sdk-ruby"
tags:
- "${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}"
- "latest"
build_args:
- "RUBY_VERSION=${RUBY_VERSION}"
- "RUBY_PATCH=${RUBY_PATCH}"
- "ALPINE_VERSION=${ALPINE_VERSION}"
- "BASE_IMAGE=gitea.nulo.in/sutty/sdk"
password:
from_secret: "DOCKER_PASSWORD"
image: plugins/docker
registry: registry.nulo.in
repo: registry.nulo.in/sutty/containers-sdk-ruby
tags:
- ${ALPINE_VERSION}
- latest
build_args:
- ALPINE_VERSION=${ALPINE_VERSION}
- BASE_IMAGE=registry.nulo.in/sutty/containers-sdk
username: sutty
secrets:
- docker_password
when:
branch: "antifascista"
event: "push"
branch: antifascista
event: push
matrix:
include:
- ALPINE_VERSION: "3.20.3"
RUBY_VERSION: "3.3"
RUBY_PATCH: "3"
- ALPINE_VERSION: "3.19.4"
RUBY_VERSION: "3.2"
RUBY_PATCH: "4"
- ALPINE_VERSION: "3.18.9"
RUBY_VERSION: "3.2"
RUBY_PATCH: "4"
- ALPINE_VERSION: "3.17.10"
RUBY_VERSION: "3.1"
RUBY_PATCH: "5"
ALPINE_VERSION:
- 3.13.6
- 3.14.2

View file

@ -1,28 +1,20 @@
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
ARG BASE_IMAGE=sutty/sdk-ruby
ARG ALPINE_VERSION=3.13.6
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
ARG ALPINE_VERSION
LABEL org.opencontainers.image.authors="f@sutty.nl"
ARG RUBY_VERSION
ARG RUBY_PATCH
MAINTAINER "f <f@sutty.nl>"
# 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 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
RUN apk add --no-cache ruby-dev
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.7.0 -Np 0 -i /tmp/rubygems-platform-musl.patch
ENTRYPOINT /bin/sh