Skip to content

Commit

Permalink
set java and node versions from build args in android builder image
Browse files Browse the repository at this point in the history
  • Loading branch information
yousif-bugsnag committed Jan 18, 2024
1 parent f3ea419 commit 0edc426
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion dockerfiles/Dockerfile.android-builder-base
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions dockerfiles/Dockerfile.react-native-android-builder
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
4 changes: 4 additions & 0 deletions dockerfiles/Dockerfile.react-native-cli-android-builder
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 0edc426

Please sign in to comment.