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
55ENV JAVA_HOME=/usr/lib64/graalvm/graalvm-community-java23
6- COPY --from=ghcr.io/graalvm/native-image-community:23 $JAVA_HOME $JAVA_HOME
76ENV 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 '*'
0 commit comments