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.8 https://github.com/moxx799/Docker-file.gitThis 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.14.0aimage:docker build -t xubuntu-tc:1.8 --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:22.12-py3 --build-arg BASE_LAUNCH=/opt/nvidia/nvidia_entrypoint.sh https://github.com/moxx799/Docker-file.git
-
Start from
cuda 11.8image:docker build -t xubuntu-cuda:1.8 --build-arg BASE_IMAGE=nvcr.io/nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 --build-arg BASE_LAUNCH="" https://github.com/moxx799/Docker-file.git -
Start from
tensorflow 1.13.1image:docker build -t xubuntu-tf:1.8 --build-arg BASE_IMAGE=nvcr.io/nvidia/tensorflow:19.03-py3 --build-arg BASE_LAUNCH=/usr/local/bin/nvidia_entrypoint.sh https://github.com/moxx799/Docker-file.git
There are 3 available options:
| Option | Description | Default |
|---|---|---|
BASE_IMAGE |
The base image for building this desktop image. | nvcr.io/nvidia/pytorch:22.12-py3 |
BASE_LAUNCH |
The entrypoint script from the base image. If there is no entry script, please use"". |
/opt/nvidia/nvidia_entrypoint.sh |
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 |
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 https://github.com/moxx799/Docker-file.git xubuntu After that, run such command to build the image:
docker build -t xubuntu:1.8 xubuntuwhere 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.8 uid=$(id -u) gid=$(id -g)Then commit the image by
docker commit --change='CMD [""]' <conatiner-id> xubuntu:1.8
-
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.8It is equivalent to use
--vncor 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--vncoption is required when you need to force the image to switch to VNC mode. The following command would force thevnclaunched byrootmode.docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 6080:6080 xubuntu:1.8 --rootIn current version, users could use either
httpto get access to the unencrypted noVNC session orhttpsto 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--xvncwill make the desktop hosted by theXvncprogram. Everything will be run in the same process. There will be no sub-process manager liketigervncserverto manage desktop related programs. A good thing is that, users do not need to runtigervncserver -kill :1before 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 -auxto validate the running processes before saving the image.docker run --gpus all -it --rm -v ~:/homelocal -p 6080:6080 xubuntu:1.8 --xvncCertainly, there is also a root mode for this method:
docker run --gpus all -it --rm -v ~:/homelocal -p 6080:6080 xubuntu:1.8 --rootxvncAfter using Ctrl+C to kill the
Xvncprogram, users can use the following command to relaunch theXvncandnoVNCservices: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.8The
rootmode could be also applied here. -
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.8 --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.8 script=<the-path-to-your-script>
-
With
Cloudreve🔗: We recommend users to launchCloudreveby 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.
⚠️ UsingCloudreverequires users to add the extra appcin the optionWITH_EXTRA_APPSwhen 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
Cloudreveby<dgx-ip>:5212port. Remember to expose the port number by-p 5212:5212when launching the container.If users have configured
Cloudreveby 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.8 --cloudreve --bashor launch
Cloudrevetogether with the desktop:docker run --gpus all -it --rm --shm-size=1g -v ~:/homelocal -p 5212:5212 xubuntu:1.8 --cloudreveCloudreve will show you a lot of logs on the terminal, it may interfere the messages from
XvncornoVNC. 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 thecloudrevecommand. -
With
FileBrowser🔗: We recommend users to launchfilebrowserby 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
FileBrowserby<dgx-ip>:5212port. Remember to expose the port number by-p 5212:5212when launching the container.Similarly, the users can also launch
FileBrowserby adding the option--filebrowserwhen launching the container. The usage is exactly the same asCloudreve.⚠️ Note thatCloudreveshould 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.
- Multiple launching method: including VNC server, 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
ffmpegandgcc). These files will be convenient examples for users who want extra features.
- Copy from original documentation and update licence to latest version.
- Update the tiger-vnc version.
- Update the configs for XFCE panel.
- Update the extension list of VSCode.
- Update the
yjin-tool. - Use
mambato update thecondato avoid the time costs and error.
- Add
INIT_UIDandINIT_GIDto the docker build arguments. - Add xubuntu to
dconfusers. - Add the environment variable to the
.profile. - Debug of
dconf: Adddbus-launch. - Move the package
kaleidoto theCONDA_OPTIONALbecause of the version conflict. - Move the
screensaverconfig to the correct path in 18.04 & 16.04. - Config the xubuntu 16.04
shinitfile. - Config the
.profileto the correct path. - Config the XDG paths and unset the
SESSION_MANAGER.
- Clear the Jupyterlab related configs.
- Delete all the information about Jupyterlab.
- Delete the option for installation of Atom.
- Delete the VSCode extension:
hookyqr.beautify.