Skip to content

DrSnowbird/pycharm-vnc-docker

Repository files navigation

PyCharm IDE in a VNC/noVNC-based Docker container

License Agreement

By using this image, you agree the Oracle Java JDK License. This image contains Oracle JDK 8. You must accept the Oracle Binary Code License Agreement for Java SE to use this image.

Components

  • PyCharm version PyCharmCE2018.3
  • java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
  • Apache Maven 3.6.0
  • Python 3.5 + 2.7
  • Pip 19.0
  • npm 6.5 + node v11.8 (from NodeSource official Node Distribution)
  • Gradle 5.1
  • Other tools: git wget unzip vim python python-setuptools python-dev python-numpy
  • VNC/noVNC for remote Desktop over Container Platform (Openshift, Kubernetes, etc.)

Run (recommended for easy-start)

It's highly recommended to change vnc password to prevent others using the default password to get into your container, modify the file "./docker.env" as below and save the file before you hit, "./run.sh":

(./docker.env) file:

#### ---- VNC Password: ----
VNC_PW=VeryEtrongPasswordHere

#### ---- VNC Resolution (1280x800, 1920x1080, etc.): ----
VNC_RESOLUTION=1920x1080

  • Once the above update is done, you can now run the command below.
./run.sh

Deployment over Openshift or Kubernetes

You need to manually provide the environment variables for deployment (since run.sh automatically aggregate all the needed variables for running the PyCharm docker container to ensure the persistent information stayed with the host directories even you delete the container instances. Here is what you need to setup in Openshift "deployment" configuration GUI or YAML template (from docker-compose.yaml file below):

    volumes:
      -v ./PycharmProjects:/home/developer/PycharmProjects
      -v ./.PyCharmCE2018.3:/home/developer/.PyCharmCE2018.3
      -v ./.profile:/home/developer/.profile
      -v ./.java:/home/developer/.java
      -v ./data:/home/developer/data
      -v ./workspace:/home/developer/workspace

Build

You can build your own image locally.

./build.sh

Persist IDE profiles/projects

If you run "./run.sh" instead of "docker-compose up", you don't have to do anything as below.

PyCharm configurations are kept on $HOME/PyCharmCE2018.[N] inside the container, so if you want to keep them around after you close it, you'll need to share it with your host.

For example: (auto-generated by ./run.sh -- highly recommended for standalone deployment with Portainer Container Desktop)


docker run --rm -it 
    --name=pycharm-vnc-docker 
    --restart=no 
    -e VNC_RESOLUTION=1920x1080 
    -e VNC_PW=vncpassword 
    -v /home/user1/data-docker/pycharm-vnc-docker/data:/home/developer/data 
    -v /home/user1/data-docker/pycharm-vnc-docker/workspace:/home/developer/workspace 
    -v /home/user1/data-docker/pycharm-vnc-docker/.PyCharmCE2018.3:/home/developer/.PyCharmCE2018.3 
    -v /home/user1/data-docker/pycharm-vnc-docker/.java:/home/developer/.java 
    -v /home/user1/data-docker/pycharm-vnc-docker/PycharmProjects:/home/developer/PycharmProjects 
    -p 5901:5901 
    -p 6901:6901 
    openkbs/pycharm-vnc-docker

See also X11 and VNC/noVNC docker-based IDE collections

See Also - Docker-based SQL GUI

Reference

Releases information

root@6dc0b2859b9d:~# /usr/printVersions.sh 
+ echo JAVA_HOME=/usr/java
JAVA_HOME=/usr/java
+ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
+ mvn --version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T18:41:47Z)
Maven home: /usr/apache-maven-3.6.0
Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: /usr/jdk1.8.0_201/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.15.0-43-generic", arch: "amd64", family: "unix"
+ python -V
Python 2.7.12
+ python3 -V
Python 3.5.2
+ pip --version
pip 18.1 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
+ pip3 --version
pip 18.1 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
+ gradle --version

------------------------------------------------------------
Gradle 5.1.1
------------------------------------------------------------

Build time:   2019-01-10 23:05:02 UTC
Revision:     3c9abb645fb83932c44e8610642393ad62116807

Kotlin DSL:   1.1.1
Kotlin:       1.3.11
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_201 (Oracle Corporation 25.201-b09)
OS:           Linux 4.15.0-43-generic amd64

+ npm -v
6.5.0
+ node -v
v11.7.0
+ cat /etc/lsb-release /etc/os-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial