Skip to content

Latest commit

 

History

History
33 lines (33 loc) · 1.44 KB

README.md

File metadata and controls

33 lines (33 loc) · 1.44 KB

React Native Dockerize

Setting up the development environment using docker.

0. Set up docker image

> docker pull jungseoro/react-native 

or

> docker build . -t <image name> 

and modify services name in docker-compose.yml

1. Init react native project on docker (Optional)

If react-native project does not exist, make it with command below and mv repo in the project.

> docker run -it --rm -v <PROJECT_DIR>:/vol jungseoro/react-native sh -c "cd /vol && npx react-native init <PROJECT_NAME>"
> mv react-native-dockerize <PROJECT_DIR>/<PROJECT_NAME>/

2. Fill in .env

This docker supports device debugging, so you need an adb pair on the same wifi over Android OS 11.
Please refer to Android Developers for details.

3. Start metro bundler

> docker-compose up

If the app is not installed on the device, build it with command below, otherwise run the app.

> docker exec -it react-native sh -c "cd /vol && npx react-native run-android"

Reference