Skip to content

Commit

Permalink
分离 Docker 基础包,添加 s390x 架构支持
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Jan 7, 2025
1 parent 120c40e commit f718803
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 32 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/jvm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,29 @@ jobs:
type=raw,ci-jvm-universal
type=raw,ci
type=sha
- name: Build and push Docker image
- name: Build and push Docker image (Primary)
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
file: ./Dockerfile-Primary
push: true
platforms: |
linux/amd64
linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}-jvm-universal
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push Docker image (Secondary)
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile-Secondary
push: true
platforms: |
linux/riscv64
linux/ppc64le
linux/s390x
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}-jvm-universal
cache-from: type=gha
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/jvm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,31 +158,47 @@ jobs:
type=raw,latest-jvm-universal
type=raw,latest
type=sha
- name: Build and push Docker image
- name: Build and push Docker image (Primary - Popular architecture)
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile
file: ./Dockerfile-Primary
push: true
platforms: |
linux/amd64
linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}-jvm-universal
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GIT_HASH=${{ github.sha }}
- name: Build and push Docker image (Secondary - Non popular architecture)
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile-Secondary
push: true
platforms: |
linux/riscv64
linux/ppc64le
linux/s390x
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}-jvm-universal
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GIT_HASH=${{ github.sha }}

# ---------------- ALIYUN ACR --------------------
- name: Log in to Aliyun ACR
uses: docker/login-action@v3
with:
registry: "registry.cn-hangzhou.aliyuncs.com"
username: ${{ secrets.ALIYUN_ACR_USERNAME }}
password: ${{ secrets.ALIYUN_ACR_PASSWORD }}
- name: Extract metadata (tags, labels) for Aliyun ACR
- name: Extract metadata (tags, labels) for Aliyun ACR (Primary - Popular architecture)
id: meta-acr
uses: docker/[email protected]
with:
Expand All @@ -196,17 +212,29 @@ jobs:
type=raw,latest-jvm-universal
type=raw,latest
type=sha
- name: Build and push Aliyun ACR
- name: Build and push Aliyun ACR (Primary)
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile-Release
file: ./Dockerfile-Primary
push: true
platforms: |
linux/amd64
linux/arm64/v8
tags: ${{ steps.meta-acr.outputs.tags }}
labels: ${{ steps.meta-acr.outputs.labels }}-jvm-universal
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push Aliyun ACR (Secondary - Non popular architecture)
uses: docker/[email protected]
with:
context: .
file: ./Dockerfile-Secondary
push: true
platforms: |
linux/riscv64
linux/ppc64le
linux/s390x
tags: ${{ steps.meta-acr.outputs.tags }}
labels: ${{ steps.meta-acr.outputs.labels }}-jvm-universal
cache-from: type=gha
Expand Down
25 changes: 0 additions & 25 deletions Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile-Release → Dockerfile-Primary
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 主 Dockerfile,构建主流架构平台的镜像 (amd64, aarch64),使用 Musl 版本的 Liberica JRE 23,压缩体积
FROM docker.io/bellsoft/liberica-runtime-container:jre-23-slim-musl
LABEL maintainer="https://github.com/PBH-BTN/PeerBanHelper"
COPY target/libraries /app/libraries
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile-Secondary
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 主 Dockerfile,构建其它架构平台的镜像 (risc-v, s390x 等),使用 Alpine 版本的 Temurin JRE 23,压缩体积
FROM docker.io/eclipse-temurin:23.0.1_11-jre-alpine
LABEL maintainer="https://github.com/PBH-BTN/PeerBanHelper"
COPY target/libraries /app/libraries
COPY target/PeerBanHelper.jar /app/PeerBanHelper.jar
USER 0
EXPOSE 9898
ENV TZ=UTC
ENV JAVA_OPTS="-Dpbh.release=docker -Djava.awt.headless=true -Xmx512M -Xms16M -Xss512k -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+ShrinkHeapInSteps"
WORKDIR /app
VOLUME /tmp
ENTRYPOINT ${JAVA_HOME}/bin/java ${JAVA_OPTS} -jar PeerBanHelper.jar

0 comments on commit f718803

Please sign in to comment.