GithubHelp home page GithubHelp logo

adambene / react-native-android Goto Github PK

View Code? Open in Web Editor NEW
29.0 3.0 10.0 6 KB

Docker image for building ReactNative APKs. Latest Java + Node.js + Android SDK.

License: MIT License

Shell 100.00%
docker-image reactnative-apks docker react-native android dockerfile

react-native-android's Introduction

adambene/react-native-android

Docker image for building ReactNative APKs. Latest Java + Node.js + Android SDK.

GitHub

github.com/adambene/react-native-android

DockerHub

hub.docker.com/r/adambene/react-native-android

Example

### Command Line Build a React Native project for Android from the command line.

cd my-project/

docker run -t -i \
  -v $(pwd):/workspace \
  -v ~/.gradle/:/home/user/.gradle/ \
  -w /workspace \
  -e LOCAL_USER_ID=`id -u $USER` \
  adambene/react-native-android \
  /bin/sh -c "cd android && ./gradlew --stacktrace assembleRelease"

package.json & npm

Build a React Native project for Android with npm.

  "scripts": {
    "build-with-docker-debug": "docker run -t -i -v $(pwd):/workspace -v ~/.gradle/:/home/user/.gradle/ -w /workspace -e LOCAL_USER_ID=`id -u $USER` adambene/react-native-android /bin/sh -c \"cd android && ./gradlew --stacktrace assembleDebug\"",
    "build-with-docker-release": "docker run -t -i -v $(pwd):/workspace -v ~/.gradle/:/home/user/.gradle/ -w /workspace -e LOCAL_USER_ID=`id -u $USER` adambene/react-native-android /bin/sh -c \"cd android && ./gradlew --stacktrace assembleRelease\""
  },
npm run build-with-docker-debug
npm run build-with-docker-release

More

The container runs the command with username user and user id LOCAL_USER_ID. This is important to avoid permission problems. The built files are owned by user not the root.

### Volumes Projects directory as workspace and host's ~/.gradle/ directory is needed.

APK

Debug and release APK are built into the usual build directory android/app/build/outputs/apk/.

Customizations

You can override the following defaults either in your Dockerfile or command line using -e.

ENV ANDROID_COMPONENTS platform-tools,build-tools-23.0.1,build-tools-23.0.3,android-23
ENV GOOGLE_COMPONENTS extra-android-m2repository,extra-google-m2repository,extra-google-google_play_services,extra-google-gcm

react-native-android's People

Contributors

adambene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.