Skip to content

Commit 5856911

Browse files
committed
otimize graalvm fix bugs 19 - switch image to ubuntu arm, revert to work with ARG BUILDPLATFORM, remove cache
add same runner: ubuntu-latest switch to mvnw improve profile default add -Pnative no enable build native march again, and runner arm enable cache and SPRING_ACTIVE_PROFILE=cicd try to fix docker add wget add make to install musl enable static with fix make install and try to fix docker manifest try new way to install musl an link it add labs-openjdk arm and amd
1 parent 26f5735 commit 5856911

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,25 @@ RUN wget -q https://musl.libc.org/releases/musl-1.2.5.tar.gz \
3535
RUN ln -sf /usr/local/bin/musl-gcc /usr/local/bin/x86_64-linux-musl-gcc && \
3636
ln -sf /usr/local/bin/musl-gcc /usr/local/bin/aarch64-linux-musl-gcc
3737

38-
39-
# Download the correct JDK static libs for each arch
38+
# Download the proper JDK static-lib bundle
4039
ARG JDK_TAG=26+3-jvmci-b01
4140
RUN set -eux; \
4241
if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
4342
ASSET="labsjdk-ce-${JDK_TAG}-linux-aarch64.tar.gz"; \
44-
STATIC_DIR="lib/static/linux-aarch64/musl"; \
43+
STATIC_SUBPATH="linux-aarch64"; \
4544
else \
4645
ASSET="labsjdk-ce-${JDK_TAG}-linux-amd64.tar.gz"; \
47-
STATIC_DIR="lib/static/linux-amd64/musl"; \
46+
STATIC_SUBPATH="linux-amd64"; \
4847
fi; \
4948
wget -q "https://github.com/graalvm/labs-openjdk/releases/download/${JDK_TAG}/${ASSET}" \
5049
-O "/tmp/${ASSET}"; \
51-
mkdir -p "/usr/lib64/graalvm/graalvm-community-java23/${STATIC_DIR}"; \
50+
# Create destination dir
51+
mkdir -p "/usr/lib64/graalvm/graalvm-community-java23/lib/static/${STATIC_SUBPATH}/musl"; \
52+
# Extract only the musl static libs
5253
tar -xzf "/tmp/${ASSET}" \
53-
--strip-components=1 \
54-
-C "/usr/lib64/graalvm/graalvm-community-java23/${STATIC_DIR}" \
55-
"labsjdk-ce-${JDK_TAG}/${STATIC_DIR}"; \
54+
--strip-components=2 \
55+
-C "/usr/lib64/graalvm/graalvm-community-java23/lib/static/${STATIC_SUBPATH}/musl" \
56+
"labsjdk-ce-${JDK_TAG}-linux-${STATIC_SUBPATH}/lib/static/${STATIC_SUBPATH}/musl"; \
5657
rm "/tmp/${ASSET}"
5758

5859
# copy only what's needed for mvnw bootstrap
@@ -97,8 +98,8 @@ RUN set -eux; \
9798

9899
# ===================================================================
99100
# Runtime stage: minimal static binary
100-
# =================================================================== # gcr.io/distroless/static:nonroot
101-
FROM gcr.io/distroless/base-nossl:nonroot
101+
# =================================================================== # gcr.io/distroless/base-nossl:nonroot #(for --static-nolibc )
102+
FROM gcr.io/distroless/static:nonroot
102103

103104
ARG TARGETPLATFORM
104105
LABEL platform=${TARGETPLATFORM}

0 commit comments

Comments
 (0)