Switch to an empty folder and run the following command: create-react-app reactondocker Use sudo with above command if it gives permission denied error. Open VS Code and install create-react-app command if not already installed using Terminal: npm install -g create-react-app I’m using VS Code to create the basic ReactJS App. Follow the installation steps and it should be available to open under Applications. You can check whether your Mac has Intel chip or Apple chip from About This Mac menu option. It includes all the necessary files and resources to run your Application as is by creating an image that can be run anywhere as a container.įirst you need to download and install the latest version of Docker for Desktop on your machine here. Containers let your Application run in an environment isolated from the rest of your machine. If the xhost command is not found check /usr/X11/bin/xhost as that might not be in your path.This post explains how you can run your ReactJS App using Docker containers on your MacBook. Now add the IP using Xhost with xhost + $IP. If you’re on wifi you may want to use en1 instead of en0, check the value of the variable using echo $IP. IP=$(ifconfig en0 | grep inet | awk '$1="inet" ') should set the IP variable as the ip of your local machine. In the XQuartz preferences, go to the “Security” tab and make sure you’ve got “Allow connections from network clients” ticked: Start XQuartz from command line using open -a XQuartz. Install docker using brew cask install docker or directly from the website here. After installing XQuartz restart your machine. At the time of writing, I had 2.7.11 installed on my machine with OSX El Capitan. You can install XQuartz using homebrew with brew cask install xquartz or directly from the website here. This uses XQuartz to enable to set the DISPLAY variable within the container. This is a short guide explaining how to run GUI applications from within Docker on Mac.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |