From 3bc2696d652184fc4676f2fbba1d56e604428d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Wed, 9 May 2018 23:26:39 -0700 Subject: [PATCH] Update Android docker images Summary: Quick update to switch to a new React Native CI org on Docker Hub. Note that the images are not yet automatically generated on CI. We could do this on Circle CI in certain scenarios: - Base image needs to be updated whenever the Android development environment has changed (e.g. switch to a new SDK version, build tools, etc) - Tests image should ideally be updated on each commit This PR should be safe to land as Circle CI is not yet using these images. Closes https://github.com/facebook/react-native/pull/19192 Differential Revision: D7939209 Pulled By: hramos fbshipit-source-id: 0f845a8fffbf8f5b9cecef4fa0ba802bc755f7aa --- ContainerShip/Dockerfile.android | 10 +++++++++- ContainerShip/Dockerfile.android-base | 15 +++++++++++++++ package.json | 6 +++--- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ContainerShip/Dockerfile.android b/ContainerShip/Dockerfile.android index f7a207aea..a72a4b644 100644 --- a/ContainerShip/Dockerfile.android +++ b/ContainerShip/Dockerfile.android @@ -1,4 +1,12 @@ -FROM hramos/android-base:latest +# React Native Android Unit Tests +# +# This image builds upon the React Native Base Android Development Environment +# image. Ideally, this image would be rebuilt with any new commit to the master +# branch. Doing so will catch issues such as BUCK failing to fetch dependencies +# or run tests, as well as unit test failures. +FROM reactnativeci/android-base:latest + +LABEL Description="This image prepares and runs React Native's Android tests." maintainer "Héctor Ramos " # set default environment variables ENV GRADLE_OPTS="-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs=\"-Xmx512m -XX:+HeapDumpOnOutOfMemoryError\"" diff --git a/ContainerShip/Dockerfile.android-base b/ContainerShip/Dockerfile.android-base index 93a1aafa8..083903341 100644 --- a/ContainerShip/Dockerfile.android-base +++ b/ContainerShip/Dockerfile.android-base @@ -1,5 +1,20 @@ +# React Native Base Android Development Environment +# +# This image provides a base Android development environment for React Native, +# including, but not limited to, the Android SDK, Android NDK, Node, and BUCK. +# These are required in order to run React Native's Android unit and integration +# tests. +# +# This image is not currently built automatically as part of React Native's CI +# infrastructure. It should not be necessary to rebuild this image while the +# Android dependencies (Android SDK version, build tools version, etc) remain +# equal. The operations performed to build this image are those that tend to +# remain stable across commits in any given React Native release. + FROM library/ubuntu:16.04 +LABEL Description="This image provides a base Android development environment for React Native, and may be used to run tests." maintainer "Héctor Ramos " + # set default build arguments ARG ANDROID_TOOLS_VERSION=25.2.5 ARG BUCK_VERSION=v2018.02.16.01 diff --git a/package.json b/package.json index 02d8deb8c..f345d3909 100644 --- a/package.json +++ b/package.json @@ -128,9 +128,9 @@ "lint": "eslint .", "prettier": "find . -name node_modules -prune -or -name '*.js' -print | xargs prettier --write", "start": "/usr/bin/env bash -c './scripts/packager.sh \"$@\" || true' --", - "docker-setup-android": "docker pull hramos/android-base:latest", - "docker-build-android-base": "docker build -t hramos/android-base -f ContainerShip/Dockerfile.android-base .", - "docker-build-android": "docker build -t react/android -f ContainerShip/Dockerfile.android .", + "docker-setup-android": "docker pull reactnativeci/android-base:latest", + "docker-build-android-base": "docker build -t reactnativeci/android-base -f ContainerShip/Dockerfile.android-base .", + "docker-build-android": "docker build -t reactnativeci/android -f ContainerShip/Dockerfile.android .", "test-android-run-instrumentation": "docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-instrumentation-tests.sh", "test-android-run-unit": "docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-unit-tests.sh", "test-android-run-e2e": "docker run --privileged -it react/android bash ContainerShip/scripts/run-ci-e2e-tests.sh --android --js",