Skip to content

Commit

Permalink
Add minimal output image
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan971 committed Nov 6, 2024
1 parent ab86cb7 commit b8bacb2
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
push:
branches: [ "*" ]
tags: [ "*" ]
schedule:
- cron: "0 10 * * 1"

env:
REGISTRY: "ghcr.io"
IMAGE_NAME: "${{ github.repository }}"

jobs:
build-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

strategy:
matrix:
jdk_version: [ "21", "22", "23" ]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,event=push,enable=true,prefix=branch-{{ branch }}-${{ matrix.jdk_version }}-minimal-git-,format=short
type=raw,event=push,enable={{ is_default_branch }},value={{ branch }}-${{ matrix.jdk_version }}-minimal
type=raw,event=push,enable={{ is_default_branch }},value=${{ matrix.jdk_version }}-minimal
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: minimal
build-args: |
JDK_VERSION=${{ matrix.jdk_version }}
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/mangadex-pub/containers-base/rockylinux:9 as base
FROM ghcr.io/mangadex-pub/containers-base/rockylinux:9 AS minimal

ARG JDK_VERSION="22"
ENV JDK_VERSION=${JDK_VERSION}
Expand Down Expand Up @@ -28,7 +28,7 @@ USER mangadex
RUN java -version
RUN mkdir "$HOME/.m2" && mvn -v

FROM base as mozjpeg
FROM minimal AS mozjpeg

USER root
WORKDIR /tmp
Expand All @@ -52,7 +52,7 @@ RUN mkdir build && \
./jpegtran-static -version && \
ldd ./jpegtran-static

FROM base as magick
FROM minimal AS magick

USER root
RUN dnf install -y \
Expand Down Expand Up @@ -96,7 +96,7 @@ RUN jpegtran -version
RUN oxipng --version
RUN fc-cache -rf

FROM base as playwright
FROM minimal AS playwright

ARG PLAYWRIGHT_VERSION="1.44"
ENV PLAYWRIGHT_VERSION="${PLAYWRIGHT_VERSION}"
Expand Down

0 comments on commit b8bacb2

Please sign in to comment.