- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Created on 06-28-2016 10:19 PM - edited 08-17-2019 11:51 AM
How to get a docker image up and running which encapulates a PyCharm IDE integrated with spark and pybuilder. The IDE reside on the docker container and will be display on your laptop/machine. This is to isolate your development enviorment with has spark integrated with spark.
Why? I am a spark developer and spend significant time trying to build a integrated environment. I am spending way too much time on integration before doing what I get paid to do --- Develop! Creating a isolated environment which is integrated with spark and a CIT, easily spun up and down, and repeatable is something which would accelerate my efficiency.
- Download latest virtualbox from here.
- To run docker containers or build images a docker machine is required. Download docker machine from here.
- Download xQuartz to display the IDE on your laptop.
- View my docker page for information on the docker image here.
- Clone my PyCharm github repo. You are doing this bootstrap code sample code I have built to your docker container during launch. For example I performed git clone in my /Users/smanjee/docktest
- git clone https://github.com/sunileman/pycharm.git
- To start this tutorial start docker machine in a new terminal. For example on my laptop here is the start script
- :/Applications/Docker/Docker*app/Contents/Resources/Scripts/start.sh
- Run docker-machine env to check the IP your machine is assigned (informational only)
- Pull the image
docker pull sunileman/pycharm
- Build the image
docker build -t sunileman/pycharm .
- Open another terminal and start port forwarding
- socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
- Get your IP address (not docker machines)
- Run the image
- docker run -it -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v ~/docktest/pycharm/PycharmProjects:/root/PycharmProjects -v ~/docktest/pycharm/.Pycharm40:/root/.PyCharm40 -e DISPLAY=XXX.XX.XX.X:0 --rm sunileman/pycharm
- Replace XXX.xx.xx.x with your IP
- replace ~/docktest/pycharm/PycharmProjects with your path to pycharm which you downloaded from my github repo
- Replace ~/docktest/pycharm/.Pycharm40 with your path to pycharm which you downloaded from my github repo
- Click on I do not have previous versions
- Click on OK
- Click on OPEN to open the project you mounted to the docker container
- Find the PyCharm project to open
- Now the project has been imported
- So you have the project imported into your IDE which is running within the docker container. To prove the IDE is connected/integrated with spark simply run the python file and you will see spark modules have been imported