{"id":15069507,"url":"https://github.com/drsnowbird/jdk-mvn-py3","last_synced_at":"2025-04-10T16:52:36.357Z","repository":{"id":55793362,"uuid":"60442094","full_name":"DrSnowbird/jdk-mvn-py3","owner":"DrSnowbird","description":"Ubuntu 24.04 + OpenJDK Java 23 + Maven 3.9 + Python 3.12  + pip 23 + node 21 + npm 10 + Yarn + Gradle 7","archived":false,"fork":false,"pushed_at":"2024-03-01T15:06:26.000Z","size":33856,"stargazers_count":16,"open_issues_count":1,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T14:44:37.805Z","etag":null,"topics":["docker","gradle","java","maven","node-js","npm-package","openjdk","python3","websocket"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrSnowbird.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-06-05T03:50:35.000Z","updated_at":"2024-10-07T02:34:52.000Z","dependencies_parsed_at":"2024-03-01T16:24:40.223Z","dependency_job_id":"3a62418d-31a3-4126-a41e-f4578dfa5472","html_url":"https://github.com/DrSnowbird/jdk-mvn-py3","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fjdk-mvn-py3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fjdk-mvn-py3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fjdk-mvn-py3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrSnowbird%2Fjdk-mvn-py3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrSnowbird","download_url":"https://codeload.github.com/DrSnowbird/jdk-mvn-py3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248256344,"owners_count":21073507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","gradle","java","maven","node-js","npm-package","openjdk","python3","websocket"],"created_at":"2024-09-25T01:42:54.600Z","updated_at":"2025-04-10T16:52:36.330Z","avatar_url":"https://github.com/DrSnowbird.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenJDK Java 23 + Maven 3.9 + Python 3.12  + pip 23 + node 21 + npm 10 + Yarn + Gradle 7\n\n[![](https://images.microbadger.com/badges/image/openkbs/jdk-mvn-py3.svg)](https://microbadger.com/images/openkbs/jdk-mvn-py3 \"Get your own image badge on microbadger.com\") [![](https://images.microbadger.com/badges/version/openkbs/jdk-mvn-py3.svg)](https://microbadger.com/images/openkbs/jdk-mvn-py3 \"Get your own version badge on microbadger.com\")\n\n# ** Currently Docker Hub not allowing free hosting for Docker images: Please run ./build.sh first by yourself locally **\n\n`(**NEW**) Updated to latest Ubuntu 24.04 and related latest tools, e.g., pip, Maven, Python, Java, etc.`\n\n# NOTICE: Change to use `Non-Root` implementation\nThis new release is designed to support the deployment for Non-Root child images implementations and deployments to platform such as OpenShift or RedHat host operating system which requiring special policy to deploy. And, for better security practice, we decided to migrate (eventaully) our Docker containers to use Non-Root implementation. \nHere are some of the things you can do if your images requiring \"Root\" acccess - you `really` want to do it:\n1. For Docker build: Use \"sudo\" or \"sudo -H\" prefix to your Dockerfile's command which requiring \"sudo\" access to install packages.\n2. For Docker container (access via shell): Use \"sudo\" command when you need to access root privilges to install packages or change configurations.\n3. Or, you can use older version of this kind of base images which use \"root\" in Dockerfile.\n4. Yet, you can also modify the Dockerfile at the very bottom to remove/comment out the \"USER ${USER}\" line so that your child images can have root as USER.\n5. Finally, you can also, add a new line at the very top of your child Docker image's Dockerfile to include \"USER root\" so that your Docker images built will be using \"root\".\n\nWe like to promote the use of \"Non-Root\" images as better Docker security practice. And, whenever possible, you also want to further confine the use of \"root\" privilges in your Docker implementation so that it can prevent the \"rooting hacking into your Host system\". To lock down your docker images and/or this base image, you will add the following line at the very end to remove sudo: `(Notice that this might break some of your run-time code if you use sudo during run-time)`\n```\nsudo agt-get remove -y sudo\n```\nAfter that, combining with other Docker security practice (see below references), you just re-build your local images and re-deploy it as non-development quality of docker container. However, there are many other practices to secure your Docker containes. See below:\n\n* [Docker security | Docker Documentation](https://docs.docker.com/engine/security/security/)\n* [5 tips for securing your Docker containers - TechRepublic](https://www.techrepublic.com/article/5-tips-for-securing-your-docker-containers/)\n* [Docker Security - 6 Ways to Secure Your Docker Containers](https://www.sumologic.com/blog/security/securing-docker-containers/)\n* [Five Docker Security Best Practices - The New Stack](https://thenewstack.io/5-docker-security-best-practices/)\n\n# Components\n* Ubuntu 24.04 now.\n* openjdk version \"23-ea\" 2024-09-17\n  OpenJDK Runtime Environment (build 23-ea+10-Ubuntu-1)\n  OpenJDK 64-Bit Server VM (build 23-ea+10-Ubuntu-1, mixed mode, sharing)\n* Apache Maven 3.9\n* Python 3.12 + pip 23 + Python 3 virtual environments (venv, virtualenv, virtualenvwrapper, mkvirtualenv, ..., etc.)\n* Node v21 + npm 10 (from NodeSource official Node Distribution)\n* Gradle 7\n* Other tools: git wget unzip vim python python-setuptools python-dev python-numpy, ..., etc.\n* [See Releases Information](https://github.com/DrSnowbird/jdk-mvn-py3/blob/master/README.md#Releases-information)\n* Note: 'yarn' is removed from this latest build -- if needed, it will be put back later releases.\n\n# Quick commands\n* build.sh - build local image.\n* logs.sh - see logs of container.\n* run.sh - run the container.\n* shell.sh - shell into the container.\n* save.sh - save a running Container instance into a tgz file for later to restore.\n* restore.sh - restore the previously archived tgz Container instance ready for running again.\n* stop.sh - stop the container.\n* tryJava.sh : test Java\n* tryNodeJS.sh : test NodeJS\n* tryPython.sh : test Python\n* tryWebSocketServer.sh : test WebSockert NodeJS Server\n\n# How to use and quick start running?\n1. git clone https://github.com/DrSnowbird/jdk-mvn-py3.git\n2. cd jdk-mvn-py3\n3. ./run.sh\n\n# Default Run (test) - Just entering Container\n```\n./build.sh or 'make build'\n./run.sh\n```\n\n# Test Java, NodeJS, and Python3 Runs\n```\n./tryJava.sh\n./tryNodeJS.sh\n./tryPython.sh\n./tryWebSockerServer.sh\n```\n* Issue: the `./tryJava.sh` encouters some permission to write share folder in Container. To fix later!\n\n# Default Build (locally)\n```\n./build.sh\n```\n# Pull the image from Docker Repository\n\n```bash\ndocker pull openkbs/jdk-mvn-py3\n```\n\n# Base the image to build add-on components\n\n```Dockerfile\nFROM openkbs/jdk-mvn-py3\n... (then your customization Dockerfile code here)\n```\n\n# Manually setup to Run the image\n\nThen, you're ready to run:\n- make sure you create your work directory, e.g., ./data\n\n```bash\nmkdir ./data\ndocker run -d --name my-jdk-mvn-py3 -v $PWD/data:/data -i -t openkbs/jdk-mvn-py3\n```\n\n# Build and Run your own image\nSay, you will build the image \"my/jdk-mvn-py3\".\n\n```bash\ndocker build -t my/jdk-mvn-py3 .\n```\n\nTo run your own image, say, with some-jdk-mvn-py3:\n\n```bash\nmkdir ./data\ndocker run -d --name some-jdk-mvn-py3 -v $PWD/data:/data -i -t my/jdk-mvn-py3\n```\n\n# Shell into the Docker instance\n\n```bash\ndocker exec -it some-jdk-mvn-py3 /bin/bash\n```\n\n# Run Python code\n\nTo run Python code \n\n```bash\ndocker run -it --rm openkbs/jdk-mvn-py3 python3 -c 'print(\"Hello World\")'\n```\n\nor,\n\n```bash\ndocker run -i --rm openkbs/jdk-mvn-py3 python3 \u003c myPyScript.py \n```\n\nor,\n\n```bash\nmkdir ./data\necho \"print('Hello World')\" \u003e ./data/myPyScript.py\ndocker run -it --rm --name some-jdk-mvn-py3 -v \"$PWD\"/data:/data openkbs/jdk-mvn-py3 python3 myPyScript.py\n```\n\nor,\n\n```bash\nalias dpy3='docker run --rm openkbs/jdk-mvn-py3 python3'\ndpy3 -c 'print(\"Hello World\")'\n```\n\n# Compile or Run java -- while no local installation needed\nRemember, the default working directory, /data, inside the docker container -- treat is as \"/\".\nSo, if you create subdirectory, \"./data/workspace\", in the host machine and \nthe docker container will have it as \"/data/workspace\".\n\n```\n#!/bin/bash -x\nmkdir ./data\ncat \u003e./data/HelloWorld.java \u003c\u003c-EOF\npublic class HelloWorld {\n   public static void main(String[] args) {\n      System.out.println(\"Hello, World\");\n   }\n}\nEOF\ncat ./data/HelloWorld.java\nalias djavac='docker run -it --rm --name some-jdk-mvn-py3 -v '$PWD'/data:/data openkbs/jdk-mvn-py3 javac'\nalias djava='docker run -it --rm --name some-jdk-mvn-py3 -v '$PWD'/data:/data openkbs/jdk-mvn-py3 java'\ndjavac HelloWorld.java\ndjava HelloWorld\n```\nAnd, the output:\n```\nHello, World\n```\nHence, the alias above, \"djavac\" and \"djava\" is your docker-based \"javac\" and \"java\" commands and \nit will work the same way as your local installed Java's \"javac\" and \"java\" commands. \n\n# Run JavaScript -- while no local installation needed\nRun the NodeJS mini-server script:\n```\n./tryNodeJS.sh\n```\nThen, open web browser to go to http://0.0.0.0:3000/ to NodeJS mini-web server test.\n\n# Python Virtual Environments\nThere are various ways to run Python virtual envrionments, for example,\n\n### Setup virtualenvwrapper in $HOME/.bashrc profile\nAdd the following code to the end of ~/.bashrc\n```\n#########################################################################\n#### ---- Customization for multiple virtual python environment ---- ####\n#########################################################################\nexport VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3\nsource /usr/local/bin/virtualenvwrapper.sh\nexport WORKON_HOME=~/Envs\nif [ ! -d $WORKON_HOME ]; then\n    mkdir -p $WORKON_HOME\nfi\n```\n\n### To create \u0026 activate your default venv environment, say, \"my-venv\":\n```\nmkvirtualenv my-venv\nworkon my-venv\n```\n\n# To run specialty Java/Scala IDE alternatives\nHowever, for larger complex projects, you might want to consider to use Docker-based IDE. \nFor example, try the following Docker-based IDEs:\n* [openkbs/docker-atom-editor](https://hub.docker.com/r/openkbs/docker-atom-editor/)\n* [openkbs/eclipse-photon-docker](https://hub.docker.com/r/openkbs/eclipse-photon-docker/)\n* [openkbs/eclipse-photon-vnc-docker](https://hub.docker.com/r/openkbs/eclipse-photon-vnc-docker/)\n* [openkbs/eclipse-oxygen-docker](https://hub.docker.com/r/openkbs/eclipse-oxygen-docker/)\n* [openkbs/intellj-docker](https://hub.docker.com/r/openkbs/intellij-docker/)\n* [openkbs/intellj-vnc-docker](https://hub.docker.com/r/openkbs/intellij-vnc-docker/)\n* [openkbs/knime-vnc-docker](https://hub.docker.com/r/openkbs/knime-vnc-docker/)\n* [openkbs/netbeans9-docker](https://hub.docker.com/r/openkbs/netbeans9-docker/)\n* [openkbs/netbeans](https://hub.docker.com/r/openkbs/netbeans/)\n* [openkbs/papyrus-sysml-docker](https://hub.docker.com/r/openkbs/papyrus-sysml-docker/)\n* [openkbs/pycharm-docker](https://hub.docker.com/r/openkbs/pycharm-docker/)\n* [openkbs/scala-ide-docker](https://hub.docker.com/r/openkbs/scala-ide-docker/)\n* [openkbs/sublime-docker](https://hub.docker.com/r/openkbs/sublime-docker/)\n* [openkbs/webstorm-docker](https://hub.docker.com/r/openkbs/webstorm-docker/)\n* [openkbs/webstorm-vnc-docker](https://hub.docker.com/r/openkbs/webstorm-vnc-docker/)\n\n# See also\n* [Java Development in Docker](https://blog.giantswarm.io/getting-started-with-java-development-on-docker/)\n* [Alpine small image JDKs](https://github.com/frol/docker-alpine-oraclejdk8)\n* [NPM Prefix for not using SUDO NPM](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally)\n\n# Proxy \u0026 Certificate Setup\n* [Setup System and Browsers Root Certificate](https://thomas-leister.de/en/how-to-import-ca-root-certificate/)\n\n# Corporate Proxy Root and Intemediate Certificates setup for System and Web Browsers (FireFox, Chrome, etc)\n1. Save your corporate's Certificates in the currnet GIT directory, `./certificates`\n2. During Docker run command, \n```\n   -v `pwd`/certificates:/certificates ... (the rest parameters)\n```\nIf you want to map to different directory for certificates, e.g., /home/developer/certificates, then\n```\n   -v `pwd`/certificates:/home/developer/certificates -e SOURCE_CERTIFICATES_DIR=/home/developer/certificates ... (the rest parameters)\n```\n3. And, inside the Docker startup script to invoke the `~/scripts/setup_system_certificates.sh`. Note that the script assumes the certficates are in `/certificates` directory.\n4. The script `~/scripts/setup_system_certificates.sh` will automatic copy to target directory and setup certificates for both System commands (wget, curl, etc) to use and Web Browsers'.\n\n# Releases information\n```\n~$ /usr/scripts/printVersions.sh \nJAVA_HOME=/usr/lib/jvm/java-23-openjdk-amd64\njava: /usr/bin/java /usr/share/java /usr/lib/jvm/java-23-openjdk-amd64/bin/java /usr/share/man/man1/java.1.gz\n\n/usr/lib/jvm/java-23-openjdk-amd64/bin/java\nopenjdk version \"23-ea\" 2024-09-17\nOpenJDK Runtime Environment (build 23-ea+10-Ubuntu-1)\nOpenJDK 64-Bit Server VM (build 23-ea+10-Ubuntu-1, mixed mode, sharing)\n/usr/bin/mvn\nApache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)\nMaven home: /usr/apache-maven-3.9.6\nJava version: 23-ea, vendor: Private Build, runtime: /usr/lib/jvm/java-23-openjdk-amd64\nDefault locale: en, platform encoding: UTF-8\nOS name: \"linux\", version: \"6.5.0-21-generic\", arch: \"amd64\", family: \"unix\"\n/usr/bin/python3\nPython 3.12.2\n/usr/bin/pip\npip 23.3 from /usr/lib/python3/dist-packages/pip (python 3.12)\n/usr/bin/pip3\npip 23.3 from /usr/lib/python3/dist-packages/pip (python 3.12)\n/usr/bin/gradle\n\nWelcome to Gradle 7.6.4!\n\nHere are the highlights of this release:\n - Added support for Java 19.\n - Introduced `--rerun` flag for individual task rerun.\n - Improved dependency block for test suites to be strongly typed.\n - Added a pluggable system for Java toolchains provisioning.\n\nFor more details see https://docs.gradle.org/7.6.4/release-notes.html\n\n\n------------------------------------------------------------\nGradle 7.6.4\n------------------------------------------------------------\n\nBuild time:   2024-02-05 14:29:18 UTC\nRevision:     e0bb3fc8cefad8432c9033cdfb12dc14facc9dd9\n\nKotlin:       1.7.10\nGroovy:       3.0.13\nAnt:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023\nJVM:          23-ea (Private Build 23-ea+10-Ubuntu-1)\nOS:           Linux 6.5.0-21-generic amd64\n\n/usr/bin/npm\n10.2.4\n/usr/bin/node\nv21.6.2\nDISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=24.04\nDISTRIB_CODENAME=noble\nDISTRIB_DESCRIPTION=\"Ubuntu Noble Numbat (development branch)\"\nPRETTY_NAME=\"Ubuntu Noble Numbat (development branch)\"\nNAME=\"Ubuntu\"\nVERSION_ID=\"24.04\"\nVERSION=\"24.04 (Noble Numbat)\"\nVERSION_CODENAME=noble\nID=ubuntu\nID_LIKE=debian\nHOME_URL=\"https://www.ubuntu.com/\"\nSUPPORT_URL=\"https://help.ubuntu.com/\"\nBUG_REPORT_URL=\"https://bugs.launchpad.net/ubuntu/\"\nPRIVACY_POLICY_URL=\"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy\"\nUBUNTU_CODENAME=noble\nLOGO=ubuntu-logo\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsnowbird%2Fjdk-mvn-py3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrsnowbird%2Fjdk-mvn-py3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrsnowbird%2Fjdk-mvn-py3/lists"}