
This 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.
Here are some of the things you can do if your images requiring "Root" acccess - you really want to do it:
We 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)
sudo agt-get remove -y sudo
After 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:
Ubuntu 20.04 LTS now as LTS Docker base image.
openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
Apache Maven 3.6
Python 3.8 + pip 21.1 + Python 3 virtual environments (venv, virtualenv, virtualenvwrapper, mkvirtualenv, ..., etc.)
Node v16 + npm 7 (from NodeSource official Node Distribution)
Gradle 6
Other tools: git wget unzip vim python python-setuptools python-dev python-numpy, ..., etc.
https://github.com/DrSnowbird/jdk-mvn-py3/blob/master/README.md#Releases-information
./run.sh
./tryJava.sh ./tryNodeJS.sh ./tryPython.sh ./tryWebSockerServer.sh
./build.sh
bashdocker pull openkbs/jdk-mvn-py3
DockerfileFROM openkbs/jdk-mvn-py3 ... (then your customization Dockerfile code here)
Then, you're ready to run:
bashmkdir ./data docker run -d --name my-jdk-mvn-py3 -v $PWD/data:/data -i -t openkbs/jdk-mvn-py3
Say, you will build the image "my/jdk-mvn-py3".
bashdocker build -t my/jdk-mvn-py3 .
To run your own image, say, with some-jdk-mvn-py3:
bashmkdir ./data docker run -d --name some-jdk-mvn-py3 -v $PWD/data:/data -i -t my/jdk-mvn-py3
bashdocker exec -it some-jdk-mvn-py3 /bin/bash
To run Python code
bashdocker run -it --rm openkbs/jdk-mvn-py3 python3 -c 'print("Hello World")'
or,
bashdocker run -i --rm openkbs/jdk-mvn-py3 python3 < myPyScript.py
or,
bashmkdir ./data echo "print('Hello World')" > ./data/myPyScript.py docker run -it --rm --name some-jdk-mvn-py3 -v "$PWD"/data:/data openkbs/jdk-mvn-py3 python3 myPyScript.py
or,
bashalias dpy3='docker run --rm openkbs/jdk-mvn-py3 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 -v '$PWD'/data:/data openkbs/jdk-mvn-py3 javac' alias djava='docker run -it --rm --name some-jdk-mvn-py3 -v '$PWD'/data:/data openkbs/jdk-mvn-py3 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.
Run the NodeJS mini-server script:
./tryNodeJS.sh
Then, open web browser to go to [***] to NodeJS mini-web server test.
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
However, for larger complex projects, you might want to *** to use Docker-based IDE. For example, try the following Docker-based IDEs:
./certificates-v `pwd`/certificates:/certificates ... (the rest parameters)
If you want to map to different directory for certificates, e.g., /home/developer/certificates, then
-v `pwd`/certificates:/home/developer/certificates -e SOURCE_CERTIFICATES_DIR=/home/developer/certificates ... (the rest parameters)
~/scripts/setup_system_certificates.sh. Note that the script assumes the certficates are in /certificates directory.~/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'.developer@8ed21b5dc528:~$ /usr/scripts/printVersions.sh + echo JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 + whereis java java: /usr/bin/java /usr/share/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/share/man/man1/java.1.gz + echo + java -version openjdk version "11.0.11" 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing) + mvn --version Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /usr/apache-maven-3.6.3 Java version: 11.0.11, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64 Default locale: en, platform encoding: UTF-8 OS name: "linux", version: "5.8.0-59-generic", arch: "amd64", family: "unix" + python -V /usr/scripts/printVersions.sh: line 8: python: command not found + python3 -V Python 3.8.10 + pip --version pip 21.1.3 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8) + pip3 --version pip 21.1.3 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8) + gradle --version Welcome to Gradle 6.7! Here are the highlights of this release: - File system watching is ready for production use - Declare the version of Java your build requires - Java 15 support For more details see https://docs.gradle.org/6.7/release-notes.html ------------------------------------------------------------ Gradle 6.7 ------------------------------------------------------------ Build time: 2020-10-14 16:13:12 UTC Revision: 312ba9e0f4f8a02d01854d1ed743b79ed996dfd3 Kotlin: 1.3.72 Groovy: 2.5.12 Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020 JVM: 11.0.11 (Ubuntu 11.0.11+9-Ubuntu-0ubuntu2.20.04) OS: Linux 5.8.0-59-generic amd64 + npm -v 7.20.0 + node -v v16.4.1 + cat /etc/lsb-release /etc/os-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS" NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
developer@6f369aab375e:~$ pip freeze appdirs==1.4.4 argon2-cffi==20.1.0 async-generator==1.10 atomicwrites==1.1.5 attrs==20.3.0 backcall==0.2.0 beautifulsoup4==4.8.2 bleach==3.3.0 certifi==2020.12.5 cffi==1.14.4 chardet==4.0.0 cloudpickle==1.6.0 cycler==0.10.0 dbus-python==1.2.16 decorator==4.4.2 defusedxml==0.6.0 distlib==0.3.1 distro-info===0.23ubuntu1 entrypoints==0.3 et-xmlfile==1.0.1 filelock==3.0.12 funcy==1.15 future==0.18.2 html5lib==1.0.1 httpie==2.3.0 hyperopt==0.2.5 idna==2.10 importlib-metadata==1.5.0 iniconfig==1.1.1 ipaddress==1.0.23 ipykernel==5.4.3 ipython==7.20.0 ipython-genutils==0.2.0 ipywidgets==7.6.3 j2cli==0.3.10 jdcal==1.0 jedi==0.18.0 Jinja2==2.11.3 joblib==1.0.0 json-lines==0.5.0 jsonschema==3.2.0 jupyter==1.0.0 jupyter-client==6.1.11 jupyter-console==6.2.0 jupyter-core==4.7.1 jupyterlab-pygments==0.1.2 jupyterlab-widgets==1.0.0 kiwisolver==1.3.1 lxml==4.5.0 MarkupSafe==1.1.1 matplotlib==3.3.4 mistune==0.8.4 more-itertools==4.2.0 nbclient==0.5.1 nbconvert==6.0.7 nbformat==5.1.2 nest-asyncio==1.5.1 networkx==2.5 notebook==6.2.0 numexpr==2.7.2 numpy==1.20.0 olefile==0.46 openpyxl==3.0.3 packaging==20.9 panda==0.3.1 pandas==1.2.1 pandasql==0.7.3 pandocfilters==1.4.3 parso==0.8.1 pbr==5.5.1 pexpect==4.8.0 pickleshare==0.7.5 Pillow==8.1.0 pkgconfig==1.5.1 pluggy==0.13.1 prometheus-client==0.9.0 prompt-toolkit==3.0.14 ptyprocess==0.7.0 py==1.10.0 pycparser==2.20 Pygments==2.7.4 PyGObject==3.36.0 pyLDAvis==2.1.2 pyparsing==2.4.7 pyrsistent==0.17.3 PySocks==1.7.1 pytest==6.2.2 python-apt==2.0.0+ubuntu0.20.4.4 python-dateutil==2.8.1 python-git==2018.2.1 pytz==2021.1 PyYAML==3.11 pyzmq==22.0.2 qtconsole==5.0.2 QtPy==1.9.0 requests==2.25.1 requests-toolbelt==0.9.1 requests-unixsocket==0.2.0 scikit-learn==0.24.1 scipy==1.6.0 seaborn==0.11.1 Send2Trash==1.5.0 six==1.15.0 soupsieve==1.9.5 SQLAlchemy==1.3.23 stevedore==3.3.0 tables==3.6.1 terminado==0.9.2 testpath==0.4.4 threadpoolctl==2.1.0 toml==0.10.2 tornado==6.1 tqdm==4.56.0 traitlets==5.0.5 unattended-upgrades==0.1 urllib3==1.26.3 virtualenv==20.4.2 virtualenv-clone==0.5.4 virtualenvwrapper==4.8.4 wcwidth==0.2.5 webencodings==0.5.1 widgetsnbextension==3.5.1 xlrd==1.1.0 xlwt==1.3.0 yml2json==1.0.1 zipp==1.0.0
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务