From 01a166f13eb43d2a09898ae27afd1d82ada73c1a Mon Sep 17 00:00:00 2001 From: jmal Date: Fri, 3 May 2024 12:39:29 +0800 Subject: [PATCH] =?UTF-8?q?chron:=20=E4=BC=98=E5=8C=96=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_jdk17_ffmpeg_nvidia.yml | 15 +++++++++++++++ .github/workflows/build_jdk_ffmpeg.yml | 15 +++++++++++++++ Dockerfile | 6 ------ docker/Dockerfile | 9 +++++++++ docker/jmalcloud-nvidia/Dockerfile | 6 ------ docker/nvidia/Dockerfile | 9 +++++++++ 6 files changed, 48 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_jdk17_ffmpeg_nvidia.yml b/.github/workflows/build_jdk17_ffmpeg_nvidia.yml index 1f8f4fb1..6dd1e104 100644 --- a/.github/workflows/build_jdk17_ffmpeg_nvidia.yml +++ b/.github/workflows/build_jdk17_ffmpeg_nvidia.yml @@ -11,6 +11,21 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Set up JDK 17 and Maven 3.8.4 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + maven-version: '3.8.4' + + - name: Build with Maven + run: mvn clean package -DskipTests + + - name: Extract project version from pom.xml + run: | + VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) + echo "PROJECT_VERSION=$VERSION" >> $GITHUB_ENV + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 diff --git a/.github/workflows/build_jdk_ffmpeg.yml b/.github/workflows/build_jdk_ffmpeg.yml index ec1846b9..2a5535e1 100644 --- a/.github/workflows/build_jdk_ffmpeg.yml +++ b/.github/workflows/build_jdk_ffmpeg.yml @@ -11,6 +11,21 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Set up JDK 17 and Maven 3.8.4 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + maven-version: '3.8.4' + + - name: Build with Maven + run: mvn clean package -DskipTests + + - name: Extract project version from pom.xml + run: | + VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) + echo "PROJECT_VERSION=$VERSION" >> $GITHUB_ENV + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 diff --git a/Dockerfile b/Dockerfile index a5c4c1f9..06264804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,12 +5,6 @@ ENV RUN_ENVIRONMENT=prod ARG VERSION -RUN mkdir -p /jmalcloud/files - -ADD docker/ip2region.xdb /jmalcloud/ - -ADD target/lib /usr/local/clouddisk-lib - ADD target/clouddisk-${VERSION}.jar /usr/local/ VOLUME /jmalcloud/ diff --git a/docker/Dockerfile b/docker/Dockerfile index 0b98973e..5cc948be 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,3 +3,12 @@ FROM eclipse-temurin:17-jre # 安装 ffmpeg RUN apt-get update && \ apt-get install -y ffmpeg libavcodec-extra + +# 设置时区 +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +RUN mkdir -p /jmalcloud/files + +ADD docker/ip2region.xdb /jmalcloud/ + +ADD target/lib /usr/local/clouddisk-lib diff --git a/docker/jmalcloud-nvidia/Dockerfile b/docker/jmalcloud-nvidia/Dockerfile index 5b6ab90a..0d13ede5 100644 --- a/docker/jmalcloud-nvidia/Dockerfile +++ b/docker/jmalcloud-nvidia/Dockerfile @@ -5,12 +5,6 @@ ENV RUN_ENVIRONMENT=prod ARG VERSION -RUN mkdir -p /jmalcloud/files - -ADD docker/ip2region.xdb /jmalcloud/ - -ADD target/lib /usr/local/clouddisk-lib - ADD target/clouddisk-${VERSION}.jar /usr/local/ VOLUME /jmalcloud/ diff --git a/docker/nvidia/Dockerfile b/docker/nvidia/Dockerfile index dd04fbec..04b2eebb 100644 --- a/docker/nvidia/Dockerfile +++ b/docker/nvidia/Dockerfile @@ -23,6 +23,15 @@ FROM eclipse-temurin:17-jre AS java-base FROM base AS final COPY --from=java-base /opt/java/openjdk /opt/java/openjdk +# 设置时区 +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +RUN mkdir -p /jmalcloud/files + +ADD docker/ip2region.xdb /jmalcloud/ + +ADD target/lib /usr/local/clouddisk-lib + # 更新 PATH 和 LD_LIBRARY_PATH ENV PATH="/opt/java/openjdk/bin:${PATH}"