Skip to content

Commit

Permalink
optimize:Use the openjdk image of eclipse-temurin as the base image (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
xingfudeshi authored Oct 14, 2024
1 parent 66bd3a4 commit 980ba23
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 29 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 8, 17 ]
java: [ 8, 17, 21 ]
steps:
# step 1
- name: "Checkout"
Expand All @@ -39,10 +39,9 @@ jobs:
REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
if [ "${{ github.ref_name }}" == "develop" ] || [ "${{ github.ref_name }}" == "snapshot" || [ "${{ github.ref_name }}" == "2.x" ]; then
./mvnw -T 4C clean package -Dimage.name=openjdk:8u342 -Pimage -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean package -Dimage.name=eclipse-temurin:8u422-b05-jdk -Pimage -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
else
./mvnw -T 4C clean package -Dimage.name=openjdk:8u342 -Pimage,release-image-based-on-java8 -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean package -Dimage.name=openjdk:8u342-slim -Pimage,release-image-based-on-java8-slim -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean package -Dimage.name=eclipse-temurin:8u422-b05-jdk -Pimage,release-image-based-on-java8 -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
fi
# step 4 based on java17
- name: "Publish images to DockerHub based on java17"
Expand All @@ -51,5 +50,12 @@ jobs:
REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_USER }}
REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
./mvnw -T 4C clean package -Dimage.name=openjdk:17.0.2 -Pimage,release-image-based-on-java17 -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean package -Dimage.name=openjdk:17.0.2-slim -Pimage,release-image-based-on-java17-slim -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
./mvnw -T 4C clean package -Dimage.name=eclipse-temurin:17.0.12_7-jdk -Pimage,release-image-based-on-java17 -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
# step 5 based on java21
- name: "Publish images to DockerHub based on java21"
if: ${{ matrix.java == 21 && github.ref_name != 'develop' && github.ref_name != 'snapshot' && github.ref_name != '2.x' }}
env:
REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_USER }}
REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
./mvnw -T 4C clean package -Dimage.name=eclipse-temurin:21.0.4_7-jdk -Pimage,release-image-based-on-java21 -DskipTests -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn;
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ language: java
sudo: false # faster builds

jdk:
- openjdk11
- openjdk8
- openjdk17
- openjdk21

cache:
directories:
Expand All @@ -28,10 +29,13 @@ install: true

before_script:
- if [ "$TRAVIS_JDK_VERSION" == "openjdk8" ]; then
export IMAGE_NAME="openjdk:8-jre-slim";
export IMAGE_NAME="eclipse-temurin:8u422-b05-jre";
fi
- if [ "$TRAVIS_JDK_VERSION" == "openjdk11" ]; then
export IMAGE_NAME="openjdk:11-jre-stretch";
- if [ "$TRAVIS_JDK_VERSION" == "openjdk17" ]; then
export IMAGE_NAME="eclipse-temurin:17.0.12_7-jre";
fi
- if [ "$TRAVIS_JDK_VERSION" == "openjdk21" ]; then
export IMAGE_NAME="eclipse-temurin:21.0.4_7-jre";
fi

script:
Expand Down
3 changes: 3 additions & 0 deletions changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#6905](https://github.com/apache/incubator-seata/pull/6905)] remove incompatible licenses at build time
- [[#6906](https://github.com/apache/incubator-seata/pull/6906)] h2 dependency adds test scope
- [[#6911](https://github.com/apache/incubator-seata/pull/6911)] fix some typos in project
- [[#6918](https://github.com/apache/incubator-seata/pull/6918)] Use the openjdk image of eclipse-temurin as the base image



### refactor:
Expand All @@ -49,6 +51,7 @@ Thanks to these contributors for their code commits. Please report an unintended
- [PleaseGiveMeTheCoke](https://github.com/PleaseGiveMeTheCoke)
- [dsomehan](https://github.com/dsomehan)
- [psxjoy](https://github.com/psxjoy)
- [xingfudeshi](https://github.com/xingfudeshi)



Expand Down
4 changes: 3 additions & 1 deletion changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
- [[#6905](https://github.com/apache/incubator-seata/pull/6905)] 移除构建期不兼容的 license
- [[#6906](https://github.com/apache/incubator-seata/pull/6906)] h2依赖添加test scope
- [[#6911](https://github.com/apache/incubator-seata/pull/6911)] 修正项目中的部分拼写错误

- [[#6918](https://github.com/apache/incubator-seata/pull/6918)] 使用eclipse-temurin的openjdk镜像作为基础镜像
-

### refactor:

Expand All @@ -52,6 +53,7 @@
- [PleaseGiveMeTheCoke](https://github.com/PleaseGiveMeTheCoke)
- [dsomehan](https://github.com/dsomehan)
- [psxjoy](https://github.com/psxjoy)
- [xingfudeshi](https://github.com/xingfudeshi)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

6 changes: 3 additions & 3 deletions distribution/docker/namingserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# 1. docker run --name=seata-namingserver -d seata-namingserver:2.2.0-dev
#
# https://hub.docker.com/r/apache/seata-namingserver
FROM openjdk:8u342
FROM eclipse-temurin:8u422-b05-jdk

# set label
LABEL maintainer="Seata <seata.apache.org>"
Expand All @@ -37,8 +37,8 @@ ADD bin/ /seata-namingserver/bin
ADD lib/ /seata-namingserver/lib
ADD conf/ /seata-namingserver/conf
ADD target /seata-namingserver/target
ADD ../LICENSE ./LICENSE
ADD ../NOTICE ./LICENSE
ADD LICENSE /LICENSE
ADD NOTICE /NOTICE

# set extra environment
ENV LOADER_PATH="/seata-namingserver/lib"
Expand Down
6 changes: 3 additions & 3 deletions distribution/docker/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# 1. docker run --name=seata-server -d seata-server:2.2.0-dev
#
# https://hub.docker.com/r/apache/seata-server
FROM openjdk:8u342
FROM eclipse-temurin:8u422-b05-jdk

# set label
LABEL maintainer="Seata <seata.apache.org>"
Expand All @@ -38,8 +38,8 @@ ADD ext/ /seata-server/ext
ADD lib/ /seata-server/lib
ADD conf/ /seata-server/conf
ADD target /seata-server/target
ADD ../LICENSE ./LICENSE
ADD ../NOTICE ./LICENSE
ADD LICENSE /LICENSE
ADD NOTICE /NOTICE

# set extra environment
ENV LOADER_PATH="/seata-server/lib"
Expand Down
14 changes: 14 additions & 0 deletions distribution/release-seata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
<file>
<source>LICENSE</source>
<destName>LICENSE</destName>
<outputDirectory>seata-server/</outputDirectory>
</file>

<file>
<source>LICENSE</source>
<destName>LICENSE</destName>
<outputDirectory>seata-namingserver/</outputDirectory>
</file>

<file>
Expand All @@ -115,6 +122,13 @@
<file>
<source>NOTICE</source>
<destName>NOTICE</destName>
<outputDirectory>seata-server/</outputDirectory>
</file>

<file>
<source>NOTICE</source>
<destName>NOTICE</destName>
<outputDirectory>seata-namingserver/</outputDirectory>
</file>

<file>
Expand Down
17 changes: 5 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,30 +194,23 @@
<maven.git-commit-id.skip>false</maven.git-commit-id.skip>
</properties>
</profile>
<!-- profile: release-image-based-on-java8-slim -->
<profile>
<id>release-image-based-on-java8-slim</id>
<properties>
<image.tags>${project.version}-slim</image.tags>
<maven.git-commit-id.skip>false</maven.git-commit-id.skip>
</properties>
</profile>
<!-- profile: release-image-based-on-java17 -->
<profile>
<id>release-image-based-on-java17</id>
<properties>
<image.tags>${project.version}.jre17</image.tags>
<image.tags>${project.version}.jdk17</image.tags>
<maven.git-commit-id.skip>false</maven.git-commit-id.skip>
</properties>
</profile>
<!-- profile: release-image-based-on-java17-slim -->
<!-- profile: release-image-based-on-java21 -->
<profile>
<id>release-image-based-on-java17-slim</id>
<id>release-image-based-on-java21</id>
<properties>
<image.tags>${project.version}.jre17-slim</image.tags>
<image.tags>${project.version}.jdk21</image.tags>
<maven.git-commit-id.skip>false</maven.git-commit-id.skip>
</properties>
</profile>

<!-- profile: checkstyle -->
<profile>
<id>checkstyle</id>
Expand Down

0 comments on commit 980ba23

Please sign in to comment.