Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 6e8fed7

Browse files
committed
Alpine dockerfile
1 parent ab1f039 commit 6e8fed7

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

.github/workflows/scheduled_jobs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ jobs:
1515
include:
1616
- ruby_version: "3.3"
1717
postgresql_version: 17
18+
variant: slim
1819
- ruby_version: "3.3"
1920
postgresql_version: 18
21+
variant: slim
22+
- ruby_version: "3.3"
23+
postgresql_version: 17
24+
variant: alpine
2025
outputs:
2126
image_tag: ${{ steps.meta.outputs.tags }}
2227
image_sha: ${{ steps.docker_build.outputs.digest }}
@@ -54,7 +59,7 @@ jobs:
5459
images: |
5560
ghcr.io/${{ github.repository_owner }}/ruby-pg
5661
tags: |
57-
type=raw,value=${{ matrix.ruby_version }}-pg${{ matrix.postgresql_version }}
62+
type=raw,value=${{ matrix.ruby_version }}-pg${{ matrix.postgresql_version }}${{ matrix.variant == 'alpine' && '-alpine' || '' }}
5863
5964
- name: Build and push Docker base image
6065
id: docker_build
@@ -65,6 +70,7 @@ jobs:
6570
push: ${{ github.ref == 'refs/heads/main' }} # Only push on main branch
6671
tags: ${{ steps.meta.outputs.tags }}
6772
labels: ${{ steps.meta.outputs.labels }}
73+
file: ${{ matrix.variant == 'alpine' && 'Dockerfile.alpine' || 'Dockerfile' }}
6874
build-args: |
6975
RUBY_VERSION=${{ matrix.ruby_version }}
7076
POSTGRESQL_VERSION=${{ matrix.postgresql_version }}

Dockerfile.alpine

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
ARG RUBY_VERSION=missing-build-arg
2+
FROM ruby:${RUBY_VERSION}-alpine
3+
4+
ENV TZ=Etc/UTC \
5+
LANG=C.UTF-8 \
6+
BUNDLE_FORCE_RUBY_PLATFORM=true
7+
8+
ARG POSTGRESQL_VERSION=missing-build-arg
9+
10+
RUN set -eux && \
11+
apk add --no-cache \
12+
tzdata ca-certificates \
13+
curl curl-dev \
14+
git \
15+
build-base \
16+
pkgconf \
17+
libxml2-dev zlib-dev \
18+
geos geos-dev \
19+
imagemagick \
20+
libwebp-tools \
21+
xz \
22+
jemalloc \
23+
gnupg \
24+
rust cargo \
25+
nodejs npm \
26+
postgresql${POSTGRESQL_VERSION} && \
27+
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
28+
29+
ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
30+
31+
RUN gem update --system 3.4.22
32+

0 commit comments

Comments
 (0)