-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Dockerfile.builder.linux-amd64
30 lines (23 loc) · 1.37 KB
/
Dockerfile.builder.linux-amd64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM debian:9-slim
COPY ./src/main/docker/builder-amd64/sources.list /etc/apt/sources.list
RUN apt-get update -y &&\
apt-get install --force-yes -y zlib1g-dev=1:1.2.8.dfsg-5 zlib1g=1:1.2.8.dfsg-5 &&\
apt-get install --force-yes -y build-essential libz-dev curl
ENV GRAALVM_URL='https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
RUN mkdir /graalvm &&\
curl -L $GRAALVM_URL > /tmp/graalvm.tgz &&\
tar --strip 1 -zxvf /tmp/graalvm.tgz -C /graalvm
ENV JAVA_HOME=/graalvm
ENV PATH="${PATH}:$JAVA_HOME/bin"
RUN uname -a && whoami && $JAVA_HOME/bin/java -version
COPY ./ /app
WORKDIR /app
RUN ./gradlew clean build compTest shadowJar nativeImageJar nativeCompile -i &&\
ls -lha ./build &&\
echo "min required GLIBC version:" &&\
objdump -T /app/build/native/nativeCompile/dns-proxy-server | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu | tail -n1 &&\
mkdir -p ./build/artifacts/linux-amd64 && mv ./build/native/nativeCompile/dns-proxy-server ./build/artifacts/linux-amd64/ &&\
mkdir -p ./build/artifacts/jre && mv ./build/libs/dns-proxy-server-*-all.jar ./build/artifacts/jre/dns-proxy-server.jar &&\
mkdir -p ./build/artifacts/native-image-source && cp ./build/libs/native-image-*.jar ./build/artifacts/native-image-source/dns-proxy-server.jar &&\
ls -lhS ./build/artifacts/*
ENTRYPOINT cat