Skip to content

Commit b7d328e

Browse files
committed
fix: docker build
1 parent a0c141a commit b7d328e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazoncorretto:17-alpine as corretto-jdk
1+
FROM amazoncorretto:21-alpine as corretto-jdk
22

33
# required for strip-debug to work
44
RUN apk add --no-cache binutils
@@ -9,10 +9,12 @@ RUN jlink \
99
--strip-debug \
1010
--no-man-pages \
1111
--no-header-files \
12-
--compress=2 \
12+
--compress=zip-6 \
1313
--output /jre
1414

1515
FROM alpine:latest
16+
RUN apk upgrade --no-cache
17+
1618
ENV JAVA_HOME=/jre
1719
ENV PATH="${JAVA_HOME}/bin:${PATH}"
1820

@@ -31,7 +33,7 @@ RUN chown spring:spring /opt/app
3133
USER spring
3234

3335
ADD target/${JAR_FILE} /opt/app/api.jar
34-
ENTRYPOINT ["java", "-Djava.awt.headless=true", "-XX:MaxRAMPercentage=75", "-XX:+UseSerialGC", "-Xlog:gc", "-XshowSettings:vm", "-Dfile.encoding=UTF-8", "-Dspring.profiles.active=docker", "-jar", "/opt/app/api.jar"]
36+
ENTRYPOINT ["java", "-Djava.awt.headless=true", "-Xlog:gc", "-XshowSettings:vm", "-Dfile.encoding=UTF-8", "-Dspring.profiles.active=docker", "-jar", "/opt/app/api.jar"]
3537

3638
EXPOSE 8888/tcp
3739
HEALTHCHECK --interval=60s --retries=5 --start-period=5s --timeout=10s CMD wget --no-verbose --tries=1 --spider localhost:8888/starter-test/actuator/health || exit 1

contributed/buildDocker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ if [[ $p -eq 1 ]]; then
3434
fi
3535
echo -e " ${color_light_cyan}+ for platform ${PLATFORM}${color_restore}"
3636
DOCKER_BUILDKIT=1 docker build --build-arg JAR_FILE="${JAR_FILE}" --build-arg SPRING_BOOT_VERSION="${SPRING_BOOT_VERSION}" \
37-
--platform=${PLATFORM} --no-cache --pull --rm -f Dockerfile -t "${GROUPID}/${ARTIFACTID}:${VERSION}" .
37+
--platform=${PLATFORM} --no-cache --pull --load --rm -f Dockerfile -t "${GROUPID}/${ARTIFACTID}:${VERSION}" .

0 commit comments

Comments
 (0)