can I develop react-native app inside docker image can I develop react-native app inside docker image docker docker

can I develop react-native app inside docker image


I know its an old post but might help some one else.

I managed to run expo-cli in a docker image and do remote development using VS Code. Wrote a blog post explaining the work flow. Can check the post here.

All the docker files are pushed to git.


I am very confident that what you are trying to do is possible. Without having done it myself, I can not say 100% confidence,

However, your Dockerfile is clearly wrong. I do not know what the correct way would be. That is your work.

I think that somehow you need to get the react-native code that you are writing into the container. For example you could:

  • use a COPY command in the Dockerfile;
  • or bind mount it at runtime (which you might be doing); or
  • there are a lot of other ways to get the code into the container.

Imagine you were working on an ubuntu machine. You just installed all the software, checked out the source code, did any necessary compilation. Your react-native app is ready to be used. You type "/usr/bin/xyx a b c" into the shell and the magic happens. This suggests that your CMD command should be "/usr/bin/xyz a b c".


I just went through this and solved your problem. First, you need to replace EXPORT with EXPOSE. Secondly, you need to to open the ports used by expo at the docker cmd you use to invoke your docker machine using

.... -p 3000:3000 -p 19000:19000 -p 19001:19001 -p 19002:19002 ...

Lastly, run your app using npm start like at:

expo init AwesomeProjectcd AwesomeProjectnpm start # you can also use: expo start

Now from Expo search for this app using your computer ipaddress and the 19000 port like at:

exp://<ipaddress>:19000

and voila!!

Remember: YOU will need node 10+ to use this option