Skip to content

Commit b249897

Browse files
committed
chore: 更新Dockerfile以优化Java版本的嵌入和依赖项安装
1 parent 2b397ee commit b249897

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

dockerfile/daemon.dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ARG BUILDPLATFORM=linux/amd64
2+
ARG EMBEDDED_JAVA_VERSION=21
23

34
FROM --platform=${BUILDPLATFORM} node:lts-alpine AS builder
45

@@ -13,16 +14,15 @@ RUN apk add --no-cache wget &&\
1314
wget --input-file=lib-urls.txt --directory-prefix=production-code/daemon/lib/ &&\
1415
chmod a+x production-code/daemon/lib/*
1516

17+
FROM eclipse-temurin:${EMBEDDED_JAVA_VERSION}-alpine AS temurin-stage
18+
1619
FROM ghcr.io/linuxserver/baseimage-alpine:edge
1720

18-
ARG EMBEDDED_JAVA_VERSION=21
21+
ENV JAVA_HOME=/opt/java/openjdk
22+
COPY --from=temurin-stage $JAVA_HOME $JAVA_HOME
23+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
1924

20-
RUN apk add --no-cache wget && \
21-
wget -O /etc/apk/keys/adoptium.rsa.pub https://packages.adoptium.net/artifactory/api/security/keypair/public/repositories/apk && \
22-
echo 'https://packages.adoptium.net/artifactory/apk/alpine/main' | tee -a /etc/apk/repositories && \
23-
apk update && \
24-
apk add --no-cache \
25-
temurin-${EMBEDDED_JAVA_VERSION}-jdk \
25+
RUN apk add --no-cache \
2626
nodejs \
2727
npm
2828

0 commit comments

Comments
 (0)