Sign inSign up

mmedin/react-native-apk-build

By mmedin

•Updated about 4 years ago

Base tools to generate an Android APK from React Native. It could also help with other tasks and CI.

Image
Integration & delivery
Developer tools
1

1.3K

mmedin/react-native-apk-build repository overview

⁠Intro

This image is primarily oriented to help with the creation of a debug APK for Android. Version 1.0.0⁠ is based on the minimalist Debian-based image bitnami/minideb⁠. Version 2.0.0⁠ is based on the official gradle⁠ image.

It tries to be a lighter option than other similar efforts, and therefore more suitable for CI.

⁠Some of the components included

  • glibc
  • openjdk-11-jre
  • nvm
  • nodejs lts/gallium
  • npm
  • react-native and react-native-cli
  • command line tools from the android sdk

⁠Usage examples

With this image you could create a React Native app skeleton:

docker run --rm -v $(pwd):/workspace mmedin/react-native-apk-build "react-native init HelloReact"

And then you could generate an Android debug APK to manually install in your phone:

cd HelloReact
docker run --rm -v $(pwd):/workspace mmedin/react-native-apk-build "cd android; gradle assembleDebug"

This is assuming that you have the proper configuration in android/app/build.gradle:

project.ext.react = [
    ...
    bundleInDebug: true,
    devDisabledInDebug: true,
    ...
]

Otherwise, you could need to bundle before creating the APK:

docker run --rm -v $(pwd):/workspace mmedin/react-native-apk-build \
    "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res"

(folders may differ)

⁠Source

https://github.com/mmedin/docker-react-native-apk-build⁠

Tag summary

Content type

Image

Digest

sha256:edf4a0c41…

Size

810.6 MB

Last updated

about 4 years ago

docker pull mmedin/react-native-apk-build