ubuntu-vnc-xfce-g3

ubuntu-vnc-xfce-g3

Ubuntu Docker镜像集成Xfce桌面和远程访问功能

ubuntu-vnc-xfce-g3项目基于Ubuntu LTS构建Docker镜像,集成Xfce桌面、TigerVNC和noVNC。镜像支持VNC和浏览器远程访问,内置Chromium和Firefox。项目特点包括灵活构建系统、自定义功能、CI/CD支持、轻量化设计等。镜像优化性能和安全性,适合多种远程工作需求。

DockerUbuntuVNCnoVNCXfceGithub开源项目

Headless Ubuntu/Xfce containers with VNC/noVNC

Project accetto/ubuntu-vnc-xfce-g3

Version: G3v5


[User Guide][this-user-guide] - [Docker Hub][this-docker] - [Changelog][this-changelog] - [Wiki][this-wiki] - [Discussions][this-discussions]

![badge-github-release][badge-github-release] ![badge-github-release-date][badge-github-release-date] ![badge-github-stars][badge-github-stars] ![badge-github-forks][badge-github-forks] ![badge-github-open-issues][badge-github-open-issues] ![badge-github-closed-issues][badge-github-closed-issues] ![badge-github-releases][badge-github-releases] ![badge-github-commits][badge-github-commits] ![badge-github-last-commit][badge-github-last-commit]


Introduction

This GitHub repository contains resources and tools for building Docker images for headless working.

The images are based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. The popular web browsers [Chromium][chromium] and [Firefox][firefox] are also included.

This [User guide][this-user-guide] describes the images and how to use them.

The content of this GitHub project is intended for developers and image builders.

Ordinary users can simply use the images available in the following repositories on Docker Hub:

  • [accetto/ubuntu-vnc-xfce-g3][accetto-docker-ubuntu-vnc-xfce-g3]
  • [accetto/ubuntu-vnc-xfce-chromium-g3][accetto-docker-ubuntu-vnc-xfce-chromium-g3]
  • [accetto/ubuntu-vnc-xfce-firefox-g3][accetto-docker-ubuntu-vnc-xfce-firefox-g3]

There is also a sibling project [accetto/debian-vnc-xfce-g3][accetto-github-debian-vnc-xfce-g3] containing similar images based on [Debian][docker-debian].

There are also another sibling projects containing images for headless diagramming, drawing, image processing and modelling ([accetto/headless-drawing-g3][accetto-github-headless-drawing-g3]) and for headless programming ([accetto/headless-coding-g3][accetto-github-headless-coding-g3]).

Building images

You can execute the individual hook scripts in the folder [/docker/hooks/][this-folder-docker-hooks]. However, the provided utilities are more convenient.

The script [builder.sh][this-readme-builder] builds individual images. The script [ci-builder.sh][this-readme-ci-builder] can build various groups of images or all of them at once.

Before building the images you have to prepare and source the file secrets.rc (see [example-secrets.rc][this-example-secrets-file]).

Features that are enabled by default can be explicitly disabled via environment variables. This allows building even smaller images by excluding the individual features (e.g. noVNC).

The resources for building the individual images and their variations (tags) are in the subfolders of the [/docker/][this-folder-docker] folder.

The individual README files contain quick examples of building the images:

  • [accetto/ubuntu-vnc-xfce-g3][this-readme-ubuntu-vnc-xfce-g3]
  • [accetto/ubuntu-vnc-xfce-chromium-g3][this-readme-ubuntu-vnc-xfce-chromium-g3]
  • [accetto/ubuntu-vnc-xfce-firefox-g3][this-readme-ubuntu-vnc-xfce-firefox-g3]

Each image also has a separate README file intended for Docker Hub. The final files should be generated by the utility [util-readme.sh][this-readme-util-readme-examples] and then copied to Docker Hub manually.

The following resources describe the image building subject in details:

  • [readme-local-building-example.md][this-readme-local-building-example]
  • [readme-builder.md][this-readme-builder]
  • [readme-ci-builder.md][this-readme-ci-builder]
  • [readme-g3-cache.md][this-readme-g3-cache]
  • [readme-util-readme-examples.md][this-readme-util-readme-examples]
  • [Wiki][this-wiki]

Image generations

This is the third generation (G3) of my headless images. The second generation (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. The first generation (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce].

Project versions

This file describes the fifth version (G3v5) of the project.

However, also this version keeps evolving. Please check the [CHANGELOG][this-changelog] for more information about the changes.

The first version (G3v1, or simply G3), the second version (G3v2, only 20.04 images) and the third version (G3v3, 22.04 and 20.04 images) are still available in this GitHub repository as the branches archived-generation-g3v1, archived-generation-g3v2 and archived-generation-g3v3. The fourth version (G3v4) was not archived, because the changes are minor.

The version G3v5 brings only one significant change comparing to the previous version G3v4:

  • The updated script set_user_permissions.sh, which is part of Dockerfiles, skips the hidden files and directories now. It generally should not have any unwanted side effects, but it may make a difference in some scenarios, hence the version increase.

The version G3v4 has brought the updated startup scripts and the following major changes comparing to the previous version G3v3:

  • The updated startup scripts that support overriding the user ID (id) and group ID (gid) without needing the former build argument ARG_FEATURES_USER_GROUP_OVERRIDE, which has been removed.
  • The user ID and the group ID can be overridden during the build time (docker build) and the run time (docker run).
  • The user name, the group name and the initial sudo password can be overridden during the build time.
  • The permissions of the files /etc/passwd and /etc/groups are set to the standard 644 after creating the user.
  • The content of the home folder and the startup folder belongs to the created user.
  • The created user gets permissions to use sudo. The initial sudo password is configurable during the build time using the build argument ARG_SUDO_INITIAL_PW. The password can be changed inside the container.
  • The default id:gid has been changed from 1001:0 to 1000:1000.

Please refer to the release 23.02 in the CHANGELOG for more information.

The version G3v3 has brought the following major changes comparing to the previous version G3v2:

  • The updated startup scripts that support overriding the user ID (id) and group ID (gid) without needing the former build argument ARG_FEATURES_USER_GROUP_OVERRIDE, which has been removed.
  • The user ID and the group ID can be overridden during the build time (docker build) and the run time (docker run).
  • The user name, the group name and the initial sudo password can be overridden during the build time.
  • The permissions of the files /etc/passwd and /etc/groups are set to the standard 644 after creating the user.
  • The content of the home folder and the startup folder belongs to the created user.
  • The created user gets permissions to use sudo. The initial sudo password is configurable during the build time using the build argument ARG_SUDO_INITIAL_PW. The password can be changed inside the container.
  • The default id:gid has been changed from 1001:0 to 1000:1000.
  • Features NOVNC and FIREFOX_PLUS, that are enabled by default, can be disabled via environment variables.
  • If FEATURES_NOVNC="0", then
    • image will not include noVNC
    • image tag will get the -vnc suffix (e.g. latest-vnc, 20.04-firefox-vnc etc.)
  • If FEATURES_FIREFOX_PLUS="0" and FEATURES_FIREFOX="1", then
    • image with Firefox will not include the Firefox Plus features
    • image tag will get the -default suffix (e.g. latest-firefox-default or also latest-firefox-default-vnc etc.)
  • The images based on Ubuntu 22.04 LTS and Ubuntu 20.04 LTS (formerly only on Ubuntu 20.04 LTS).

The version G3v3 has brought the following major changes comparing to the previous version G3v2:

  • The images based on Ubuntu 22.04 LTS (jammy) and Ubuntu 20.04 LTS (focal).
  • An extended, but simplified tag set for publishing on the Docker Hub.
  • The improved builder scripts, including support for the --target building parameter

The version G3v2 has brought the following major changes comparing to the previous version G3v1:

  • Significantly improved building performance by introducing a local cache (g3-cache).

  • Auto-building on the Docker Hub and using of the GitHub Actions have been abandoned.

  • The enhanced building pipeline moves towards building the images outside the Docker Hub and aims to support also stages with CI/CD capabilities (e.g. the GitLab).

  • The local stage is the default building stage now. However, the new building pipeline has already been tested also with a local GitLab installation in a Docker container on a Linux machine.

  • Automatic publishing of README files to the Docker Hub has been removed, because it was not working properly any more. However, the README files for the Docker Hub can still be prepared with the provided utility util-readme.sh and then copy-and-pasted to the Docker Hub manually.

    The changes affect only the building pipeline, not the Docker images themselves. The Dockerfile, apart from using the new local g3-cache, stays conceptually unchanged.

Project goals

Unlike the first two generations, this G3 generation aims to support CI/CD.

The main project goal is to develop a free, simple and self-containing CI/CD pipeline for building sets of configurable Docker images with minimal dependencies outside the project itself.

There are indeed only three service providers used, all available for free:

  • [GitHub][github] repository contains everything required for building the Docker images. Both public and private repositories can be used. GitHub Gists are used for persisting data, e.g. badge endpoints.

  • [Docker Hub][dockerhub] hosts the repositories for the final Docker images. Public or private repositories can be used.

  • [Badgen.net][badgen] is used for generating and hosting most of the badges.

None of the above service providers is really required. All images can be built locally under Linux or Windows and published elsewhere, if needed.

Building process is implemented to minimize image pollution. New images are pushed to the repositories only if something essential has changed. This can be overridden if needed.

Changes and new features

Hint: More detailed information about new features can be found in [User guide][this-user-guide] and [Wiki][this-wiki].

Naming scheme

Unlike the first two generations, this one will aim to use less Docker Hub image repositories with more image tags. For example, previously there have been two Docker Hub repositories xubuntu-vnc and ubuntu-vnc-novnc. Now there will be only one Docker Hub repository accetto/ubuntu-vnc-xfce-g3.

Slimmer images

New images are significantly slimmer than the previous ones. It's because that the most of the packages are installed with the apt-get switch --no-install-recommends by default. This could have consequences, so it is configurable.

Fewer and more flexible Dockerfiles

Image variations are build from fewer Dockerfiles. This is allowed by using multi-stage builds and the [Buildkit][docker-doc-build-with-buildkit]. On the other hand, flexible and configurable Dockerfiles are slightly more complex.

Concept of features

Flexibility in Dockerfiles is supported by introducing the concept of features. These are variables that control the building process. For example, the variable FEATURES_BUILD_SLIM controls the --no-install-recommends switch, the variable FEATURES_NOVNC controls the inclusion of noVNC and so on. Some other available features include, for example, the FEATURES_SCREENSHOOTING and FEATURES_THUMBNAILING variables. Also the web browsers [Chromium][chromium] and [Firefox][firefox] are defined as features controlled by the variables FEATURES_CHROMIUM, FEATURES_FIREFOX and FEATURES_FIREFOX_PLUS.

Selected features that are enabled by default can be explicitly disabled via environment variables. See [readme-local-building-example.md][this-readme-local-building-example] for more information.

Faster building with g3-cache

Building performance has been significantly improved by introducing a local cache (g3-cache), which contains the external packages that would be otherwise downloaded by each build. Refreshing the cache is part of the building pipeline. The Dockerfiles fall back to the ad-hoc downloading if the local cache is not available.

Overriding container user and group

Overriding the container user and group is described in [User guide][this-user-guide-using-containers].

Overriding environment variables and VNC/noVNC parameters

Overriding environment variables and VNC/noVNC parameters is described in [User guide][this-user-guide-using-containers].

Different use of version sticker

The concept of version sticker has been introduced in the second generation and later implemented also in the first generation. Check this Wiki page for more information.

However, the usage of the version sticker has been changed in the third generation.

Previously it has been used for testing, if there are any newer packages available by following the try-and-fail pattern. That was sufficient for human controlled building process, but it became a problem for CI/CD. Therefore it is used differently now.

The verbose version sticker is used for minimizing image pollution.

The short form of the version sticker is available as an image label and a badge in the README file. The version sticker badge is also linked with the verbose version sticker gist, so it is possible to check the actual image configuration even without downloading it.

The version sticker feature is also described in [User guide][this-user-guide-version-sticker].

Image metadata

The image metadata are now stored exclusively as image labels. The previous environment variables like REFRESHED_AT or VERSION_STICKER have been removed. Most of the labels are namespaced according the OCI IMAGE SPEC recommendations. However, the version-sticker label is in the namespace any.accetto for obvious reasons.

Simple self-containing CI

The first version of the third generation (G3v1) implemented a relatively simple self-containing CI by utilizing the Docker Hub builder hooks. The same build pipeline could be executed also manually if building locally. For example, an image could be refreshed by executing the /hooks/pre_build and /hooks/build scripts. The script /hooks/push would push the image to the deployment repository. The script /hooks/post_push would update the gist data and trigger the GitHub Actions workflow, which would publish the image's README file to the Docker Hub.

However, in the middle of the year 2021 the Docker Hub removed the auto-building feature from the free plan. Because one of the main objectives of this project is not to depend on any paid services, I had to remove the dependency on the Docker Hub's auto-building. There has also not been any use for the GitHub Actions any more.

The second version (G3v2) of the building pipeline does not depend on the Docker Hub's auto-building feature or the **GitHub

编辑推荐精选

蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI助手AI工具AI写作工具AI辅助写作蛙蛙写作学术助手办公助手营销助手
Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

聊天机器人AI助手热门AI工具AI对话
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

热门AI工具AI办公办公工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

模型训练热门AI工具内容创作智能问答AI开发讯飞星火大模型多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

AI助手热门AI工具AI创作AI辅助写作讯飞绘文内容运营个性化文章多平台分发
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多