From 0edc426ee796ac32ede67e7329334f4fa5526615 Mon Sep 17 00:00:00 2001 From: Yousif Ahmed Date: Thu, 18 Jan 2024 16:51:44 +0000 Subject: [PATCH] set java and node versions from build args in android builder image --- dockerfiles/Dockerfile.android-builder-base | 1 - dockerfiles/Dockerfile.react-native-android-builder | 9 +++++++-- dockerfiles/Dockerfile.react-native-cli-android-builder | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dockerfiles/Dockerfile.android-builder-base b/dockerfiles/Dockerfile.android-builder-base index 31f9d6a743..9c39c4636f 100644 --- a/dockerfiles/Dockerfile.android-builder-base +++ b/dockerfiles/Dockerfile.android-builder-base @@ -2,7 +2,6 @@ FROM openjdk:11-jdk-bullseye as java-11 FROM openjdk:17-jdk-bullseye COPY --from=java-11 /usr/local/openjdk-11 /usr/local/openjdk-11 -ENV JAVA_HOME=/usr/local/openjdk-11 # OS setup RUN apt-get update && apt-get install -y gradle jq git-core build-essential openssl libssl-dev diff --git a/dockerfiles/Dockerfile.react-native-android-builder b/dockerfiles/Dockerfile.react-native-android-builder index a8eb3e1298..b50d0e93e9 100644 --- a/dockerfiles/Dockerfile.react-native-android-builder +++ b/dockerfiles/Dockerfile.react-native-android-builder @@ -1,6 +1,11 @@ FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/js:android-builder-base -RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - +# Java version +ARG JAVA_VERSION +ENV JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION} + +ARG NODE_VERSION +RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - RUN apt-get install -y nodejs rsync RUN npm i -g run-func @@ -29,4 +34,4 @@ COPY lerna.json . COPY scripts/common.js scripts/react-native-helper.js scripts/ # Do a full build by running the container -CMD JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION} run-func scripts/react-native-helper.js buildAndroid "/app/test/react-native/features/fixtures" "/app/features/fixtures" +CMD run-func scripts/react-native-helper.js buildAndroid "/app/test/react-native/features/fixtures" "/app/features/fixtures" diff --git a/dockerfiles/Dockerfile.react-native-cli-android-builder b/dockerfiles/Dockerfile.react-native-cli-android-builder index 7ef762d2f4..4a7bae8e57 100644 --- a/dockerfiles/Dockerfile.react-native-cli-android-builder +++ b/dockerfiles/Dockerfile.react-native-cli-android-builder @@ -1,5 +1,9 @@ FROM 855461928731.dkr.ecr.us-west-1.amazonaws.com/js:android-builder-base +# Java version +ARG JAVA_VERSION +ENV JAVA_HOME=/usr/local/openjdk-${JAVA_VERSION} + RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - RUN apt-get update && apt-get install -y nodejs rsync expect \ # Dependencies for MazeRunner