更新 CI 文件
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# 该镜像需要依赖的基础镜像
|
||||
FROM eclipse-temurin:17.0.5_8-jre-jammy
|
||||
# 设置环境变量
|
||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m -Dfile.encoding=utf-8" SPRING_CONFIG="--spring.profiles.active=mysql"
|
||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m -Dfile.encoding=utf-8" SPRING_CONFIG="--spring.application.name=diyfile" SPRING_PROFILE="sqlite"
|
||||
# 设置时区
|
||||
RUN set -eux; \
|
||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \
|
||||
@@ -9,6 +9,6 @@ RUN set -eux; \
|
||||
# 拷贝jar包,并重命名
|
||||
COPY ./diyfile-system/target/diyfile-system.jar /diyfile-system.jar
|
||||
# 指定docker容器启动时运行jar包
|
||||
ENTRYPOINT exec java ${JAVA_OPTS} -jar /diyfile-system.jar ${SPRING_CONFIG}
|
||||
ENTRYPOINT exec java ${JAVA_OPTS} -jar /diyfile-system.jar ${SPRING_CONFIG} --spring.profiles.active=${SPRING_PROFILE}
|
||||
# 指定维护者的名字
|
||||
MAINTAINER besscroft
|
||||
14
.github/docker/sqlite/Dockerfile
vendored
14
.github/docker/sqlite/Dockerfile
vendored
@@ -1,14 +0,0 @@
|
||||
# 该镜像需要依赖的基础镜像
|
||||
FROM eclipse-temurin:17.0.5_8-jre-jammy
|
||||
# 设置环境变量
|
||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m -Dfile.encoding=utf-8" SPRING_CONFIG="--spring.profiles.active=sqlite"
|
||||
# 设置时区
|
||||
RUN set -eux; \
|
||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime; \
|
||||
echo $TZ > /etc/timezone
|
||||
# 拷贝jar包,并重命名
|
||||
COPY ./diyfile-system/target/diyfile-system.jar /diyfile-system.jar
|
||||
# 指定docker容器启动时运行jar包
|
||||
ENTRYPOINT exec java ${JAVA_OPTS} -jar /diyfile-system.jar ${SPRING_CONFIG}
|
||||
# 指定维护者的名字
|
||||
MAINTAINER besscroft
|
||||
43
.github/workflows/docker-buildx-mysql.yml
vendored
43
.github/workflows/docker-buildx-mysql.yml
vendored
@@ -1,43 +0,0 @@
|
||||
name: "Java CI with MySql Multi-arch Docker Image"
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Running Compile Java Multi-arch Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Get Version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
- name: Build with Maven
|
||||
run: mvn -B package -Dmaven.test.skip=true --file pom.xml
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Build and push diyfile-mysql version
|
||||
id: docker_build_diyfile_version
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./
|
||||
file: ./.github/docker/mysql/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/diyfile:${{ steps.get_version.outputs.VERSION }}-mysql
|
||||
13
.github/workflows/docker-buildx-test.yml
vendored
13
.github/workflows/docker-buildx-test.yml
vendored
@@ -37,16 +37,7 @@ jobs:
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./
|
||||
file: ./.github/docker/sqlite/Dockerfile
|
||||
file: ./.github/docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/diyfile:test-sqlite
|
||||
- name: Build and push diyfile mysql test
|
||||
id: docker_build_diyfile_mysql_test
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./
|
||||
file: ./.github/docker/mysql/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/diyfile:test-mysql
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/diyfile:test
|
||||
|
||||
6
.github/workflows/docker-buildx.yml
vendored
6
.github/workflows/docker-buildx.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: "Java CI with Sqlite Multi-arch Docker Image"
|
||||
name: "Java CI with Multi-arch Docker Image"
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./
|
||||
file: ./.github/docker/sqlite/Dockerfile
|
||||
file: ./.github/docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/diyfile:${{ steps.get_version.outputs.VERSION }}
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./
|
||||
file: ./.github/docker/sqlite/Dockerfile
|
||||
file: ./.github/docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/diyfile:latest
|
||||
|
||||
Reference in New Issue
Block a user