Skip to content

Commit 71e6ccd

Browse files
debug 13
1 parent cb078ae commit 71e6ccd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ FROM eclipse-temurin:${LATEST_VERSION}-jdk-noble AS temurin-latest
66
# Intermediate image used to prune cruft from JDKs and squash them all.
77
FROM ubuntu:latest AS all-jdk
88
ARG LATEST_VERSION
9-
ARG ORACLE_JAVA8_TOKEN
109

1110
RUN <<-EOT
1211
set -eux
@@ -72,10 +71,10 @@ WORKDIR /home/non-root-user
7271
# Note:
7372
# 1. Token can be created here: https://cloud.oracle.com/?tenant=ddsbxplayground&domain=datadog&region=us-ashburn-1
7473
# 2. Once created, token should be added to GitHub protected environment by repository administrator.
75-
RUN <<-EOT
74+
RUN --mount=type=secret,id=oracle_java8_token,uid=1001,gid=1001,mode=0400 <<-EOT
7675
set -eux
7776
sudo mkdir -p /usr/lib/jvm/oracle8
78-
echo "token is: $ORACLE_JAVA8_TOKEN"
77+
ORACLE_JAVA8_TOKEN="$(cat /run/secrets/oracle_java8_token)"
7978
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
8079
unset ORACLE_JAVA8_TOKEN
8180
EOT

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function docker_build() {
7272
shift
7373
docker build \
7474
--build-arg LATEST_VERSION=$LATEST_VERSION \
75-
--build-arg ORACLE_JAVA8_TOKEN=$ORACLE_JAVA8_TOKEN \
75+
--secret id=oracle_java8_token,env=ORACLE_JAVA8_TOKEN \
7676
--platform linux/amd64 \
7777
--label org.opencontainers.image.created="$BUILD_DATE" \
7878
--label org.opencontainers.image.source=https://github.com/DataDog/dd-trace-java-docker-build \

0 commit comments

Comments
 (0)