OpenJDK 8/11 + Maven 3.6 + Python 3.5 + PIP3 18.1 + npm 6.4.1 + node v10.15.0 + Gradle 5.1 + X11
10K+
Please consider to donate what you can to help UNICEF, WHO, and Red Cross if you like what we provide to you for free. Thanks so much!World Health Organization (WHO) COVID-19 Solidarity Response FundHelp UNICEF’s COVID-19 ResponseHelp Red CrossUse OpenJDK from now on!!
docker pull openkbs/jdk-mvn-py3-x11
FROM openkbs/jdk-mvn-py3-x11
Then, you're ready to run:
mkdir ./data
docker run -d --name my-jdk-mvn-py3-x11 -v $PWD/data:/data -i -t openkbs/jdk-mvn-py3-x11
You can use this X11 Container as your "isolated Container for your internet browsing - while keep the safety (security) of HOST computer. And, you can just do below (in the future, a slim-version of this X11 only browsers will be created for just this purpose with security locked down removing sudo and other measures - to just use this Container as Docker-based Browser for more safety in browsing the Internet) to prevent using your HOST's PC/laptop to expose your HOST computer to
./run.sh firefox
or
./run.sh google-chrome --no-sandbox
Default is to show xeyes (X11 app) when using "docker-compose up" or "make up". You can use another host's teminal to enter the Container to start run, say, Firefox or Google-Chrome:
./shell.sh
(once you enter the Container - while you have another terminal have xeyes running)
firefox
or
google-chrome --no-sandbox
Say, you will build the image "my/jdk-mvn-py3-x11".
docker build -t my/jdk-mvn-py3-x11 .
To run your own image, say, with some-jdk-mvn-py3-x11:
mkdir ./data
docker run -d --name some-jdk-mvn-py3-x11 -v $PWD/data:/data -i -t my/jdk-mvn-py3
docker exec -it some-jdk-mvn-py3-x11 /bin/bash
To run Python code
docker run -it --rm openkbs/jdk-mvn-py3-x11 python3 -c 'print("Hello World")'
or,
docker run -i --rm openkbs/jdk-mvn-py3-x11 python3 < myPyScript.py
or,
mkdir ./data
echo "print('Hello World')" > ./data/myPyScript.py
docker run -it --rm --name some-jdk-mvn-py3-x11 -v "$PWD"/data:/data openkbs/jdk-mvn-py3-x11 python3 myPyScript.py
or,
alias dpy3='docker run --rm openkbs/jdk-mvn-py3-x11 python3'
dpy3 -c 'print("Hello World")'
Remember, the default working directory, /data, inside the docker container -- treat is as "/". So, if you create subdirectory, "./data/workspace", in the host machine and the docker container will have it as "/data/workspace".
#!/bin/bash -x
mkdir ./data
cat >./data/HelloWorld.java <<-EOF
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
EOF
cat ./data/HelloWorld.java
alias djavac='docker run -it --rm --name some-jdk-mvn-py3-x11 -v '$PWD'/data:/data openkbs/jdk-mvn-py3-x11 javac'
alias djava='docker run -it --rm --name some-jdk-mvn-py3-x11 -v '$PWD'/data:/data openkbs/jdk-mvn-py3-x11 java'
djavac HelloWorld.java
djava HelloWorld
And, the output:
Hello, World
Hence, the alias above, "djavac" and "djava" is your docker-based "javac" and "java" commands and it will work the same way as your local installed Java's "javac" and "java" commands. However, for larger complex projects, you might want to consider to use Docker-based IDEs as listed in the later sections of this document.
There are various ways to run Python virtual envrionments, for example,
Add the following code to the end of ~/.bashrc
#########################################################################
#### ---- Customization for multiple virtual python environment ---- ####
#########################################################################
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
export WORKON_HOME=~/Envs
if [ ! -d $WORKON_HOME ]; then
mkdir -p $WORKON_HOME
fi
mkvirtualenv my-venv
workon my-venv
More resource in X11 display of Eclipse on your host machine's OS, please see
You might see the warning message in the launching xterm console like below, you can just ignore it. I googles around and some blogs just suggested to ignore since the IDE still functional ok.
Content type
Image
Digest
Size
959.3 MB
Last updated
over 5 years ago
docker pull openkbs/jdk-mvn-py3-x11