Skip to content

Commit

Permalink
chron: 优化镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed May 3, 2024
1 parent bfe43bb commit 01a166f
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 12 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build_jdk17_ffmpeg_nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/build_jdk_ffmpeg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
9 changes: 9 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions docker/jmalcloud-nvidia/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
9 changes: 9 additions & 0 deletions docker/nvidia/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit 01a166f

Please sign in to comment.