Skip to content

Commit a83c5ac

Browse files
committed
Consolidate native image toolchains
1 parent 551ff6c commit a83c5ac

8 files changed

Lines changed: 35 additions & 77 deletions

File tree

‎.github/release-automation/docker/native-image-java23/dockerfile‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎.github/release-automation/docker/native-image-musl-java23/dockerfile‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎.github/release-automation/docker/native-image-musl-java23/install-musl.sh‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

‎.github/scripts/temporal-release/build-native-binary.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ case "$RELEASE_PLATFORM" in
5454
linux-amd64-musl)
5555
image_id_file=$(mktemp)
5656
docker build --iidfile "$image_id_file" \
57-
"$trusted_root/.github/release-automation/docker/native-image-musl-java23" 1>&2
57+
"$trusted_root/docker/native-image-musl" 1>&2
5858
docker run --rm -w /github/workspace -v "$PWD:/github/workspace" \
5959
"$(<"$image_id_file")" \
6060
./gradlew "-PreleaseVersion=$release_version" -PnativeBuild -PnativeBuildMusl \
@@ -63,7 +63,7 @@ case "$RELEASE_PLATFORM" in
6363
linux-amd64 | linux-arm64)
6464
image_id_file=$(mktemp)
6565
docker build --iidfile "$image_id_file" \
66-
"$trusted_root/.github/release-automation/docker/native-image-java23" 1>&2
66+
"$trusted_root/docker/native-image" 1>&2
6767
docker run --rm -w /github/workspace -v "$PWD:/github/workspace" \
6868
"$(<"$image_id_file")" \
6969
./gradlew "-PreleaseVersion=$release_version" -PnativeBuild \

‎.github/workflows/temporal-release-automation-ci.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- ".github/scripts/temporal-release/**"
88
- ".github/workflows/temporal-release-*.yml"
99
- ".github/workflows/build-native-image.yml"
10+
- "docker/native-image/**"
11+
- "docker/native-image-musl/**"
1012
- "gradle/publishing.gradle"
1113
- "gradle/versioning.gradle"
1214
push:
@@ -17,6 +19,8 @@ on:
1719
- ".github/scripts/temporal-release/**"
1820
- ".github/workflows/temporal-release-*.yml"
1921
- ".github/workflows/build-native-image.yml"
22+
- "docker/native-image/**"
23+
- "docker/native-image-musl/**"
2024
- "gradle/publishing.gradle"
2125
- "gradle/versioning.gradle"
2226

@@ -35,7 +39,7 @@ jobs:
3539
- name: Check shell syntax
3640
run: |
3741
for script in .github/scripts/temporal-release/*.sh \
38-
.github/release-automation/docker/native-image-musl-java23/install-musl.sh; do
42+
docker/native-image-musl/install-musl.sh; do
3943
bash -n "$script"
4044
done
4145
- name: Test exact GitHub artifact handling
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# This Dockerfile builds a GraalVM Native Image Test Server with musl support.
2-
FROM ubuntu:24.04
2+
FROM ghcr.io/graalvm/native-image-community:23@sha256:5a28da013d97ac66033b6c836015c7ee7f5d3e07c705d51f1e6c26a04fd17b8e AS graalvm
3+
FROM ubuntu:24.04@sha256:561618e2c15bf2397621dd04f96926663a3b5616c189cf7e38db7e82f5c538ea
34
ENV JAVA_HOME=/usr/lib64/graalvm/graalvm-community-java23
4-
COPY --from=ghcr.io/graalvm/native-image-community:23 $JAVA_HOME $JAVA_HOME
55
ENV PATH="${JAVA_HOME}/bin:${PATH}"
6-
RUN apt-get -y update --allow-releaseinfo-change && apt-get install -y -V git build-essential curl ca-certificates binutils
6+
COPY --from=graalvm ${JAVA_HOME} ${JAVA_HOME}
7+
RUN apt-get update && \
8+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9+
git build-essential curl ca-certificates binutils make tar gzip && \
10+
rm -rf /var/lib/apt/lists/*
711
COPY install-musl.sh /opt/install-musl.sh
812
RUN chmod +x /opt/install-musl.sh
913
WORKDIR /opt
@@ -14,5 +18,5 @@ ENV MUSL_HOME=/opt/musl-toolchain
1418
ENV PATH="$MUSL_HOME/bin:$PATH"
1519
# Verify installation.
1620
RUN x86_64-linux-musl-gcc --version
17-
# Avoid errors like: "fatal: detected dubious ownership in repository".
21+
# Avoid errors like "fatal: detected dubious ownership in repository."
1822
RUN git config --global --add safe.directory '*'

‎docker/native-image/dockerfile‎

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
# This Dockerfile builds a GraalVM Native Image Test Server with glibc support.
2-
# Use an old version of Ubuntu to build the test server to maintain compatibility with
3-
# older versions of glibc, specifically glib 2.17.
4-
FROM ubuntu:18.04
2+
FROM ghcr.io/graalvm/native-image-community:23@sha256:5a28da013d97ac66033b6c836015c7ee7f5d3e07c705d51f1e6c26a04fd17b8e AS graalvm
3+
# Use an old Ubuntu base to retain compatibility with older glibc versions.
4+
FROM ubuntu:18.04@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98
55
ENV JAVA_HOME=/usr/lib64/graalvm/graalvm-community-java23
6-
COPY --from=ghcr.io/graalvm/native-image-community:23 $JAVA_HOME $JAVA_HOME
76
ENV PATH="${JAVA_HOME}/bin:${PATH}"
8-
RUN apt-get -y update --allow-releaseinfo-change && apt-get install -V -y software-properties-common
9-
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
10-
RUN apt-get update
11-
# We need to update gcc and g++ to 10 for Graal to work on ARM64
12-
RUN apt-get install -y git build-essential zlib1g-dev gcc-10 g++-10
13-
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave /usr/bin/g++ g++ /usr/bin/g++-10
14-
# Avoid errors like: "fatal: detected dubious ownership in repository"
15-
RUN git config --global --add safe.directory '*'
7+
COPY --from=graalvm ${JAVA_HOME} ${JAVA_HOME}
8+
# Install the GCC 10 toolchain required by GraalVM, trusting only the checked-in PPA key.
9+
COPY ubuntu-toolchain-r-test.asc /usr/share/keyrings/ubuntu-toolchain-r-test.asc
10+
RUN apt-get update --allow-releaseinfo-change && \
11+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12+
ca-certificates && \
13+
printf '%s\n' \
14+
'deb [signed-by=/usr/share/keyrings/ubuntu-toolchain-r-test.asc] https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu bionic main' \
15+
> /etc/apt/sources.list.d/ubuntu-toolchain-r-test.list && \
16+
apt-get update && \
17+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
18+
git build-essential zlib1g-dev gcc-10 g++-10 && \
19+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 \
20+
--slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
21+
rm -rf /var/lib/apt/lists/*
22+
# Avoid errors like "fatal: detected dubious ownership in repository."
23+
RUN git config --global --add safe.directory '*'

.github/release-automation/docker/native-image-java23/ubuntu-toolchain-r-test.asc renamed to docker/native-image/ubuntu-toolchain-r-test.asc

File renamed without changes.

0 commit comments

Comments
 (0)