If you do not want to change the contents of the dockerfile, you could use such command to build the image:
docker build -t xubuntu:1.7 https://github.com/cainmagi/Dockerfiles.git#xubuntu
This image is compatible for Ubuntu 16.04, 18.04 and 20.04. Please check your base image and confirm that the Ubuntu inside the image is compatible with this dockerfile.
We provide 3 examples:
-
Start from
pytorch 1.12.0a
image:docker build -t xubuntu-tc:1.7 --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:22.03-py3 --build-arg BASE_LAUNCH=/opt/nvidia/nvidia_entrypoint.sh --build-arg JLAB_VER=3 https://github.com/cainmagi/Dockerfiles.git#xubuntu
-
Start from
cuda 11.6
image:docker build -t xubuntu-cuda:1.7 --build-arg BASE_IMAGE=nvcr.io/nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04 --build-arg BASE_LAUNCH="" --build-arg JLAB_VER=3 https://github.com/cainmagi/Dockerfiles.git#xubuntu
-
Start from
tensorflow 1.13.1
image (since it is a Python 3.5 image, we recommend to fall back to Jupyter Lab 2.x):docker build -t xubuntu-tf:1.7 --build-arg BASE_IMAGE=nvcr.io/nvidia/tensorflow:19.03-py3 --build-arg BASE_LAUNCH=/usr/local/bin/nvidia_entrypoint.sh --build-arg JLAB_VER=2 https://github.com/cainmagi/Dockerfiles.git#xubuntu
There are 3 available options:
Option | Description | Default |
---|---|---|
BASE_IMAGE |
The base image for building this desktop image. | nvcr.io/nvidia/pytorch:22.03-py3 |
BASE_LAUNCH |
The entrypoint script from the base image. If there is no entry script, please use"" . |
/opt/nvidia/nvidia_entrypoint.sh |
JLAB_VER |
The version of the Jupyter Lab to be installed. Could be1 , 2 , 3 or unset . If use unset , nothing would be installed if there is already a Jupyter Lab. |
unset |
JLAB_EXTIERS |
The to-be-installed extra extensions for the Jupyter Lab. IfJLAB_VER is unset , nothing would be installed. To view details about which extensions would be installed, see here. |
2 |
WITH_CHINESE |
If set, the image would be built with Chinese support for vscode, sublime and codeblocks. | true |
WITH_EXTRA_APPS |
The installed extra applications. Each character represents an app or several apps. For example,cgo represents fully installing Cloudreve , GIMP , LibreOffice and Thunderbird . More details could be referred in the following table. |
cgo |
ADDR_PROXY |
Set the proxy address pointing to localhost . If specified, this value should be a full address. (Experimental feature ::) |
unset |
Here we show the list of extra apps:
Code | Description |
---|---|
c |
Cloudreve |
p |
PyCharm |
g |
GIMP |
k |
GitKraken |
m |
Sublime Text 4 |
x |
TeXLive + TeXstudio |
n |
Nautilus + Nemo |
o |
LibreOffice + Thunderbird |
a |
Atom + Nuclide |
e |
GNU Emacs |
To find your launch script of your base image, use
docker inspect <your-base-image>:<tag>
Otherwise, you need to clone the branch firstly:
git clone --single-branch -b xubuntu https://github.com/cainmagi/Dockerfiles.git xubuntu
After that, run such command to build the image:
docker build -t xubuntu:1.7 xubuntu
where xubuntu
is the folder of the corresponding branch. The options in online building examples could be also used for offline buliding.
When launching the image for the first time, please use the following command to configure your user id and VNC password. When you use this image for the first time, please configure your user id by:
docker run --gpus all -it --rm xubuntu:1.7 uid=$(id -u) gid=$(id -g)Then commit the image by
docker commit --change='CMD [""]' <conatiner-id> xubuntu:1.7
-
By built-in
noVNC
: In default mode, you just need to launch the built image by:docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 6080:6080 xubuntu:1.7
It is equivalent to use
--vnc
or not in the above command. However, if you have saved the image in other modes before, you may need this flag to force the image to enter the VNC mode. The--vnc
option is required when you need to force the image to switch to VNC mode. The following command would force thevnc
launched byroot
mode.docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 6080:6080 xubuntu:1.7 --root
In current version, users could use either
http
to get access to the unencrypted noVNC session orhttps
to get access to the ssl-encrypted noVNC session. For users who open the encrypted session firstly, they may need to add the noVNC site into the trusted list. -
Switch the VNCServer to
XTigerVNC
(experimental): Add the option--xvnc
will make the desktop hosted by theXvnc
program. Everything will be run in the same process. There will be no sub-process manager liketigervncserver
to manage desktop related programs. A good thing is that, users do not need to runtigervncserver -kill :1
before saving the image. However, currently these desktop related programs are not guaranteed to be closed if hitting Ctrl+C. Therefore, we suggest the users to useps -aux
to validate the running processes before saving the image.docker run --gpus all -it --rm -v ~:/homelocal -p 6080:6080 xubuntu:1.7 --xvnc
Certainly, there is also a root mode for this method:
docker run --gpus all -it --rm -v ~:/homelocal -p 6080:6080 xubuntu:1.7 --rootxvnc
After using Ctrl+C to kill the
Xvnc
program, users can use the following command to relaunch theXvnc
andnoVNC
services:xvnc-launch [--root]
If adding the option
--root
, the desktop will be run with root privilege. -
By external VNC viewer (client): If you have installed a VNC viewer on your client side, and want to connect the VNC server of the image directly, please use:
docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 5901:5901 xubuntu:1.7
The
root
mode could be also applied here. -
By
Jupyter Lab
: If you want to launch the Jupyter Lab but do not start the desktop, please usedocker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 6080:6080 xubuntu:1.7 --jlab jlab_password=openjupyter jlab_rootdir=/homelocal
The
jlab_password
would override the default random token. Thejlab_rootdir
is the root folder of the launched jupyter lab. If not setjlab_rootdir
, the default root folder would be/homelocal
. The--jlab
option is required when you need to force the image to switch to Jupyter Lab mode. -
By
BASH
: If you want to enter the command line but do not start the desktop, please usedocker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal xubuntu:1.7 --bash
-
By any script: If you want run any script inside the docker for only one time, please use
docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal xubuntu:1.7 script=<the-path-to-your-script>
-
With
Cloudreve
π: We recommend users to launchCloudreve
by opening a new terminal on the desktop, and using the following command:crpasswd # only used for checking the INITIAL admin password. cloudreve # launch Cloudreve service, requires users to expose 5212 port.
β οΈ UsingCloudreve
requires users to add the extra appc
in the optionWITH_EXTRA_APPS
when building the image.β οΈ We STRONGLY recommend users to change their admin password, and create a non-admin user for usingCloudreve
. You can also configure your data exchanging folder.After launching the app, users can get access to
Cloudreve
by<dgx-ip>:5212
port. Remember to expose the port number by-p 5212:5212
when launching the container.If users have configured
Cloudreve
by the webpage, and commit the image. Then the users can launch the container only withCloudreve
(not opening the desktop):docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 5212:5212 xubuntu:1.7 --cloudreve --bash
or launch
Cloudreve
together with the desktop:docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 5212:5212 xubuntu:1.7 --cloudreve
Cloudreve will show you a lot of logs on the terminal, it may interfere the messages from
Xvnc
ornoVNC
. So we do not recommend to launch it together with the desktop. It is always better if you open a terminal on the desktop and use thecloudreve
command. -
With
FileBrowser
π: We recommend users to launchfilebrowser
by opening a new terminal on the desktop, and using the following command:fbrowser # although users can use filebrowser to launch the app, we still recommend users to use this command, because this command can configure the IP and PORT number automatically.
β οΈ We STRONGLY recommend users to change the initial admin password, and keep the modified password by themselves.After launching the app, users can get access to
FileBrowser
by<dgx-ip>:5212
port. Remember to expose the port number by-p 5212:5212
when launching the container.Similarly, the users can also launch
FileBrowser
by adding the option--filebrowser
when launching the container. The usage is exactly the same asCloudreve
.β οΈ Note thatCloudreve
should not be launched together withFileBrowser
, unless you have carefully configured the launching scripts and understood what you want to do.
This is the minimal desktop test based on ubuntu
16.04
, 18.04
or 20.04
image, it has:
- Fully installed xfce4 desktop: it has most of the useful plug-ins for xfce4 desktop. While libreoffice and texlive are not installed.
- Fully inherit the base image: some base image may already have the entrypoint script. We provide options for including the the entry-script of base image.
- Modern VNC server: it contains tigervncserver, which is a modern VNC server and could provide more features than tightvncserver and vnc4server, like cutomizing display settings, fully implemented animated cursor and shadow effects.
- Compatible for multiple Ubuntu versions: including Ubuntu 16.04, 18.04 and 20.04.
- Useful apps: including nomacs, notepadqq, visual studio code, peazip, okular, smplayer and chrome.
- Fully installed Jupyter Lab: if user needs, a full Jupyter Lab with several extensions could be installed, the details could be checked here.
- Multiple launching method: including VNC server, jupyterlab, bash and arbitrary script mode.
- Chinese language support: for some apps including edge, chrome (chromium), firefox, vscode, kate, codeblocks, ...
- Cloudreve Service (Chinese only) π: a private cloud storage service, allowing users to expose their personal folder as an "online drive" available on LAN. If users are interested, they can dig into the configurations and enable more features (like WebDAV and offline downloading). Currently this feature is designed for using a browser-based app to replace the WinSCP client.
- FileBrowser Service π: an alternative of
Cloudreve
. It supports multi-language and is more flexible for exchanging files with a single server. Although it does not support so many online drive features likeCloudreve
, withFileBrowser
, users can upload / download files, share links, and even run commands (need to be added to the whitelist) easily. - Extra scripts: we also provide some extra scripts for compiling specific libraries (like
ffmpeg
andgcc
). These files will be convenient examples for users who want extra features.
- Provide Microsoft Edge in the basic tier of the desktop apps.
- Add more extensions for Visual Studio Code.
- Upgrade the input method fcitx to version 5 when using Ubuntu 20.04. This is a previewed version in Ubuntu 20.04.
- Upgrade the other basic tier dependencies, including PeaZip, GitFiend, and Sublime 4.
- Move Sublime to the extra tier, because it is not a free software. Use Kate as the replacement.
- Support a cloud file transfer tool: Cloudreve. This tool may be able to replace the functionality of WinSCP.
- Update the versions of packages in the icon / theme bundle.
- Switch from Jupyter Lab 2 to Jupyter Lab 3 by default. This configuration is not recommended for those images with Python 3.5. Users may need to configure the J-lab version manually in that case.
- Provide the Oh-my-posh (OMP) π terminal theme.
- Provide some optional scripts in the folder
/home/xubuntu
(~
). - Fix small bugs about dependency problems (in
detach
), and the OMP installation. - Fix a bug caused by
get-conda-path.py
. When there is neitherconda
norpython
, the script incorrectly returnedTrue
value before. - Prefer a local snapshot to install VS Code extensions. This change may help avoid the Server 503 error π during the extension installations.
- Adjust the formats of some installation scripts.
- Provide Bing Wallpaper.
- Wrap up of all tests and scripts. This version can be released now.
- Fix a bug caused by missing of LibreOffice libs (Fixed by
~/.config/xfce4/xinitrc
). - Enable users to run GUIs with
sudo
(Fixed by~/.config/xfce4/xinitrc
). - Make the desktop get launched properly. This fixture corrects a bug where the desktop may be launched by twice in Ubuntu 16.04 (Fixed by
~/.vnc/xstartup
). - Fix a bug caused by using
get-pip.py
with Python 3.6. Since thepip
may be downgraded by NVIDIA configurations, this fixture will also correct thepip
version. (Fixed byinstall-desktop
). - Prefer
conda/mamba
when updating python packages (Fixed byinstall-desktop
). - Upgrade TigerVNC to 1.12.80. (Fixed by
install-vnc
). - Add more path to
sudo/secure_path
, now users are allowed to useconda
/mamba
/pip
directly withsudo
(Fixed bysudoers
). - Finish the launching mode
--xvnc
(Fixed bydocker-entrypoint
andxvnc-launch
).
This docker file has been tested sucessfully on:
-
nvcr.io/nvidia/pytorch:22.03-py3
(Ubuntu 20.04
,python 3.8
) -
nvcr.io/nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04
(Ubuntu 20.04
) -
nvcr.io/nvidia/pytorch:19.08-py3
(Ubuntu 18.04
,python 3.6
) -
nvcr.io/nvidia/tensorflow:19.03-py3
(Ubuntu 16.04
,python 3.5
)
Finished at 4/19/2022.
β This testing build is configured by
WITH_EXTRA_APPS=cpgkmxnoe
indicating an incomplete build. The build test for Atom (a
) is currently skipped, because the plugin market of Atom is currently down, see the issues atom/atom#25417 and atom/apm#946. :exclamation: The build for VS Code extensions also falls back to the local build method, because currently VS Code extension market is not stably working. See the issue microsoft/vscode#147670. Despite this situation, we still manage to install all extensions with a full snapshot of the.vsix
files.
- Fix a bug caused by the upgrade of noVNC.
- Support the proxy value for the built image, this value is important for the devices protected by the firewall.
- Move GitKraken to the optional packages. Instead, the default Git client is switched to GitFiend.
- Replace the default system monitor by
stacer
, the previous appgnome-system-monitor
is dropped. - Change the default configurations of
XFCE4
. - Bump
Pycharm
,tigervncserver
to the newest versions. - Upgrade the Jupyter Lab script to
1.3
. - Fix a fatal bug caused by the user authority. We may need to find a method for forwarding the current user to the docker image.
- Fix a bug of caused by dbus initialization. In the previous version, the bug would cause strange behaviors (for example, the screen savers would not work).
- Fix a bug caused by the changed address of
get-pip.py
.
- Enhance the launchers of system menu and panels.
- Set the user as
xubuntu
, and provide the--root
mode. - Make python version auto-detected, which means
XUBUNTU_COMPAT
has been removed. - Add options for installing some extra apps, like PyCharm and GIMP.
- Enhance the VNC support by OpenSSL entryption.
- Upgrade the Jupyter Lab script.
- Add some themes.
- Fix the compatibility problem caused by
pip 21.0
. - Fix small bugs, related to
nvm
path,root
authority, anddetach
script. - Fix small bugs, related to
jlab
path and the authority of creating SSL certificate.
- Arrange the theme pack installations.
- Add fully supported Jupyter Lab installation.
- Adjust the usage of some options.
- Add some packages for the desktop.
- Correct the format of some launchers.
- Re-craft the icons and themes for
ubuntu 20.04
. - Add
gcc
andgfortran
supports for building the image. - Add some packages for the desktop.
- Add check for
ubuntu
version. - Add meta-data in the dockerfile.
- Add extra Chinese supports for some packages.
- Add vscode package installation script.
- Add exposed ports (
5901
,6080
). - Add
Jupyter Lab
supports.
- Support Ubuntu 20.04.
- Fix the font issues.
- Finish all testings for Ubuntu 16.04, 18.04 and 20.04.
This docker file has been tested sucessfully on:
-
nvcr.io/nvidia/pytorch:20.12-py3
(Ubuntu 20.04
,python 3.8
) -
nvcr.io/nvidia/cuda:11.1-cudnn8-runtime-ubuntu20.04
(Ubuntu 20.04
) -
nvcr.io/nvidia/pytorch:20.11-py3
(Ubuntu 18.04
,python 3.6
) -
nvcr.io/nvidia/tensorflow:19.03-py3
(Ubuntu 16.04
,python 3.5
)
Re-craft this dockerfile.
Create the dockerfile branch.