File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -71,20 +71,24 @@ COPY --from=ghcr.io/graalvm/native-image-community:25-ol10 /usr/lib64/graalvm/gr
7171# Note:
7272# 1. Token can be created here: https://cloud.oracle.com/?tenant=ddsbxplayground&domain=datadog®ion=us-ashburn-1
7373# 2. Once created, token should be added to GitHub protected environment by repository administrator.
74- RUN <<-EOT
74+ RUN --mount=type=secret,id=oracle_java8_token <<-EOT
7575 set -eux
7676 sudo mkdir -p /usr/lib/jvm/oracle8
77+ # turn off tracing before touching secrets
78+ set +x
79+ ORACLE_JAVA8_TOKEN="$(cat /run/secrets/oracle_java8_token)"
7780 sudo curl -L --fail -H "token:${ORACLE_JAVA8_TOKEN}" https://java.oraclecloud.com/java/8/latest/jdk-8-linux-x64_bin.tar.gz | sudo tar -xvzf - -C /usr/lib/jvm/oracle8 --strip-components 1
81+ unset ORACLE_JAVA8_TOKEN
7882EOT
7983
8084# Remove cruft from JDKs that is not used in the build process.
8185RUN <<-EOT
8286 sudo rm -rf \
83- /usr/lib/jvm/*/man \
84- /usr/lib/jvm/*/lib/src.zip \
85- /usr/lib/jvm/*/demo \
86- /usr/lib/jvm/*/sample \
87- /usr/lib/jvm/graalvm*/lib/installer
87+ /usr/lib/jvm/*/man \
88+ /usr/lib/jvm/*/lib/src.zip \
89+ /usr/lib/jvm/*/demo \
90+ /usr/lib/jvm/*/sample \
91+ /usr/lib/jvm/graalvm*/lib/installer
8892EOT
8993
9094FROM scratch AS default-jdk
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ function docker_build() {
7272 shift
7373 docker build \
7474 --build-arg LATEST_VERSION=$LATEST_VERSION \
75+ --secret id=oracle_java8_token,env=ORACLE_JAVA8_TOKEN \
7576 --platform linux/amd64 \
7677 --label org.opencontainers.image.created=" $BUILD_DATE " \
7778 --label org.opencontainers.image.source=https://github.com/DataDog/dd-trace-java-docker-build \
You can’t perform that action at this time.
0 commit comments