Skip to content

Commit 2609656

Browse files
committed
Initial commit
0 parents  commit 2609656

File tree

3 files changed

+143
-0
lines changed

3 files changed

+143
-0
lines changed

.gitignore

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Xcode
2+
!**/*.xcodeproj
3+
!**/*.pbxproj
4+
!**/*.xcworkspacedata
5+
!**/*.xcsettings
6+
!**/*.xcscheme
7+
*.pbxuser
8+
!default.pbxuser
9+
*.mode1v3
10+
!default.mode1v3
11+
*.mode2v3
12+
!default.mode2v3
13+
*.perspectivev3
14+
!default.perspectivev3
15+
xcuserdata
16+
*.xccheckout
17+
*.moved-aside
18+
DerivedData
19+
*.hmap
20+
*.ipa
21+
*.xcuserstate
22+
project.xcworkspace
23+
24+
# Gradle
25+
/build/
26+
/RNTester/android/app/build/
27+
/RNTester/android/app/gradle/
28+
/RNTester/android/app/gradlew
29+
/RNTester/android/app/gradlew.bat
30+
/ReactAndroid/build/
31+
32+
# Buck
33+
.buckd
34+
buck-out
35+
/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/
36+
/ReactAndroid/src/main/jni/prebuilt/lib/x86/
37+
/ReactAndroid/src/main/gen
38+
39+
# Watchman
40+
.watchmanconfig
41+
42+
# Android
43+
.idea
44+
.gradle
45+
local.properties
46+
*.iml
47+
48+
# Node
49+
node_modules
50+
*.log
51+
.nvm
52+
/bots/node_modules/
53+
package-lock.json
54+
55+
# OS X
56+
.DS_Store
57+
58+
# Test generated files
59+
/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
60+
*.js.meta
61+
62+
/coverage
63+
/third-party
64+
65+
# Root dir shouldn't have Xcode project
66+
/*.xcodeproj
67+
68+
# ReactCommon subdir shouldn't have Xcode project
69+
/ReactCommon/**/*.xcodeproj
70+
RNTester/build

Dockerfile

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM library/ubuntu:16.04
2+
3+
LABEL Description="This image provides a base Android development environment for React Native, and may be used to run tests."
4+
LABEL maintainer="Héctor Ramos <[email protected]>"
5+
6+
# set default build arguments
7+
ARG SDK_VERSION=sdk-tools-linux-3859397.zip
8+
ARG ANDROID_BUILD_VERSION=27
9+
ARG ANDROID_TOOLS_VERSION=27.0.3
10+
ARG BUCK_VERSION=v2018.10.29.01
11+
ARG NDK_VERSION=17c
12+
ARG NODE_VERSION=8.10.0
13+
ARG WATCHMAN_VERSION=4.9.0
14+
15+
# set default environment variables
16+
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
17+
ENV ADB_INSTALL_TIMEOUT=10
18+
ENV PATH=${PATH}:/opt/buck/bin/
19+
ENV ANDROID_HOME=/opt/android
20+
ENV ANDROID_SDK_HOME=${ANDROID_HOME}
21+
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
22+
ENV ANDROID_NDK=/opt/ndk/android-ndk-r$NDK_VERSION
23+
ENV PATH=${PATH}:${ANDROID_NDK}
24+
25+
# install system dependencies
26+
RUN apt-get update && apt-get install ant autoconf automake curl g++ gcc git libqt5widgets5 lib32z1 lib32stdc++6 make maven npm openjdk-8* python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev unzip -y
27+
28+
# configure npm
29+
RUN npm config set spin=false && \
30+
npm config set progress=false
31+
32+
# install node
33+
RUN npm install n -g
34+
RUN n $NODE_VERSION
35+
36+
# download buck
37+
RUN git clone https://github.com/facebook/buck.git /opt/buck --branch $BUCK_VERSION --depth=1
38+
WORKDIR /opt/buck
39+
40+
# build buck
41+
RUN ant
42+
43+
# Full reference at https://dl.google.com/android/repository/repository2-1.xml
44+
# download and unpack android
45+
RUN mkdir /opt/android && \
46+
cd /opt/android && \
47+
curl --silent https://dl.google.com/android/repository/${SDK_VERSION} > android.zip && \
48+
unzip android.zip && \
49+
rm android.zip
50+
51+
# download and unpack NDK
52+
RUN mkdir /opt/ndk && \
53+
cd /opt/ndk && \
54+
curl --silent https://dl.google.com/android/repository/android-ndk-r$NDK_VERSION-linux-x86_64.zip > ndk.zip && \
55+
unzip ndk.zip && \
56+
rm ndk.zip
57+
58+
# Add android SDK tools
59+
RUN yes | sdkmanager --licenses && sdkmanager --update
60+
RUN sdkmanager "system-images;android-19;google_apis;armeabi-v7a" \
61+
"platform-tools" \
62+
"platforms;android-$ANDROID_BUILD_VERSION" \
63+
"build-tools;$ANDROID_TOOLS_VERSION" \
64+
"add-ons;addon-google_apis-google-23" \
65+
"extras;android;m2repository"
66+
67+
# clean up unnecessary directories
68+
RUN rm -rf /opt/android/.android

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Official Android Image for react native
2+
3+
This is an implementation of https://github.com/react-native-community/discussions-and-proposals/blob/master/proposals/0003-Official-Docker.md.
4+
5+
Original version is split from react-native repo, see https://github.com/facebook/react-native/blob/master/ContainerShip/Dockerfile.android-base.

0 commit comments

Comments
 (0)