Compare commits
3 Commits
FEATURES_O
...
FirstRelea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaf0eefe4b | ||
|
|
57a085c8fa | ||
|
|
5bc10f0e69 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -2,10 +2,18 @@
|
||||
|
||||
## Project `accetto/debian-vnc-xfce-g3`
|
||||
|
||||
[Docker Hub][this-docker] - [Git Hub][this-github] - [sibling Wiki][sibling-wiki] - [sibling Discussions][sibling-discussions]
|
||||
[User Guide][this-user-guide] - [Docker Hub][this-docker] - [Git Hub][this-github] - [sibling Wiki][sibling-wiki] - [sibling Discussions][sibling-discussions]
|
||||
|
||||
***
|
||||
|
||||
### Release 23.08
|
||||
|
||||
This release brings updated and significantly shortened README files, because most of the content has been moved into the new [User guide][this-user-guide].
|
||||
|
||||
### Release 23.07.1
|
||||
|
||||
This release brings some enhancements in the Dockerfile and the script `user_generator.rc` with the aim to better support extending the images.
|
||||
|
||||
### Release 23.07
|
||||
|
||||
This release introduces a new feature `FEATURES_OVERRIDING_ENVV`, which controls the overriding or adding of environment variables at the container startup-time.
|
||||
@@ -54,13 +62,14 @@ The initial version of the project has been derived from the sibling project [ac
|
||||
|
||||
***
|
||||
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-docker]: https://hub.docker.com/u/accetto/
|
||||
|
||||
[this-github]: https://github.com/accetto/debian-vnc-xfce-g3/
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3
|
||||
|
||||
<!-- Sibling projects -->
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
229
README.md
229
README.md
@@ -6,7 +6,7 @@ Version: G3v1
|
||||
|
||||
***
|
||||
|
||||
[Docker Hub][this-docker] - [Changelog][this-changelog] - [sibling Wiki][sibling-wiki] - [sibling Discussions][sibling-discussions]
|
||||
[User Guide][this-user-guide] - [Docker Hub][this-docker] - [Changelog][this-changelog] - [sibling Wiki][sibling-wiki] - [sibling Discussions][sibling-discussions]
|
||||
|
||||
![badge-github-release][badge-github-release]
|
||||
![badge-github-release-date][badge-github-release-date]
|
||||
@@ -18,237 +18,168 @@ Version: G3v1
|
||||
![badge-github-commits][badge-github-commits]
|
||||
![badge-github-last-commit][badge-github-last-commit]
|
||||
|
||||
<!-- ![badge-github-workflow-dockerhub-autobuild][badge-github-workflow-dockerhub-autobuild] -->
|
||||
<!-- ![badge-github-workflow-dockerhub-post-push][badge-github-workflow-dockerhub-post-push] -->
|
||||
|
||||
***
|
||||
|
||||
- [Headless Debian/Xfce containers with VNC/noVNC](#headless-debianxfce-containers-with-vncnovnc)
|
||||
- [Project `accetto/debian-vnc-xfce-g3`](#project-accettodebian-vnc-xfce-g3)
|
||||
- [Introduction](#introduction)
|
||||
- [TL;DR](#tldr)
|
||||
- [Installing packages](#installing-packages)
|
||||
- [Shared memory size](#shared-memory-size)
|
||||
- [Extending images](#extending-images)
|
||||
- [Introduction](#introduction)
|
||||
- [Building images](#building-images)
|
||||
- [Sharing devices](#sharing-devices)
|
||||
- [Image generations](#image-generations)
|
||||
- [Project versions](#project-versions)
|
||||
- [Project goals](#project-goals)
|
||||
- [Project features](#project-features)
|
||||
- [Issues, Wiki and Discussions](#issues-wiki-and-discussions)
|
||||
- [Credits](#credits)
|
||||
- [Image generations](#image-generations)
|
||||
- [Project versions](#project-versions)
|
||||
- [Project goals](#project-goals)
|
||||
- [Project features](#project-features)
|
||||
- [Getting help](#getting-help)
|
||||
- [Credits](#credits)
|
||||
|
||||
## Introduction
|
||||
### Introduction
|
||||
|
||||
This repository contains resources for building Docker images based on [Debian 11][docker-debian] with [Xfce][xfce] desktop environment and [VNC][tigervnc]/[noVNC][novnc] servers for headless use.
|
||||
This GitHub repository contains resources and tools for building Docker images for headless working.
|
||||
|
||||
The resources for the individual images and their variations (tags) are stored in the subfolders of the **master** branch. Each image has its own README file describing its features and usage.
|
||||
The images are based on [Debian 11][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client.
|
||||
The popular web browsers [Chromium][chromium] and [Firefox][firefox] are also included.
|
||||
|
||||
The repository has been derived from the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
The content of this GitHub project is intended for developers and image builders.
|
||||
|
||||
## TL;DR
|
||||
|
||||
There are currently resources for the following Docker images:
|
||||
Ordinary users can simply use the images available in the following repositories on Docker Hub:
|
||||
|
||||
- [accetto/debian-vnc-xfce-g3][accetto-docker-debian-vnc-xfce-g3]
|
||||
- [full Readme][this-readme-image-base]
|
||||
- [Dockerfile][this-dockerfile] (common for all images)
|
||||
- [sibling Dockerfile stages diagram][sibling-diagram-dockerfile-stages] (common for all images)
|
||||
- [accetto/debian-vnc-xfce-chromium-g3][accetto-docker-debian-vnc-xfce-chromium-g3]
|
||||
- [full Readme][this-readme-image-chromium]
|
||||
- [accetto/debian-vnc-xfce-firefox-g3][accetto-docker-debian-vnc-xfce-firefox-g3]
|
||||
- [full Readme][this-readme-image-firefox]
|
||||
|
||||
### Installing packages
|
||||
This [User guide][this-user-guide] describes the images and how to use them.
|
||||
|
||||
I try to keep the images slim. Consequently you can sometimes encounter missing dependencies while adding more applications yourself. You can track the missing libraries on the [Debian Packages Search][debian-packages-search] page and install them subsequently.
|
||||
|
||||
You can also try to fix it by executing the following (the default `sudo` password is **headless**):
|
||||
|
||||
```shell
|
||||
### apt cache needs to be updated only once
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt --fix-broken install
|
||||
```
|
||||
|
||||
### Shared memory size
|
||||
|
||||
Note that some applications require larger shared memory than the default 64MB. Using 256MB usually solves crashes or strange behavior.
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size.
|
||||
|
||||
### Extending images
|
||||
|
||||
The provided example file `Dockerfile.extend` shows how to use the images as the base for your own images.
|
||||
|
||||
Your concrete `Dockerfile` may need more statements, but the concept should be clear.
|
||||
|
||||
The compose file `example.yml` shows how to switch to another non-root user and how to set the VNC password and resolution.
|
||||
This project has been derived from the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
### Building images
|
||||
|
||||
The fastest way to build the images:
|
||||
You can execute the individual hook scripts in the folder [/docker/hooks/][this-folder-docker-hooks].
|
||||
However, the provided utilities are more convenient.
|
||||
|
||||
```shell
|
||||
### PWD = project root
|
||||
### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc')
|
||||
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.
|
||||
|
||||
### examples of building and publishing the individual images
|
||||
./builder.sh latest all
|
||||
./builder.sh latest-chromium all
|
||||
./builder.sh latest-firefox all
|
||||
Before building the images you have to prepare and source the file `secrets.rc` (see [example-secrets.rc][this-example-secrets-file]).
|
||||
|
||||
### just building the images, skipping the publishing and the version sticker update
|
||||
./builder.sh latest build
|
||||
./builder.sh latest-chromium build
|
||||
./builder.sh latest-firefox build
|
||||
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).
|
||||
|
||||
### examples of building and publishing the groups of images
|
||||
./ci-builder.sh all group latest
|
||||
./ci-builder.sh all group latest-chromium
|
||||
./ci-builder.sh all group latest-firefox
|
||||
The resources for building the individual images and their variations (tags) are in the subfolders of the [/docker/][this-folder-docker] folder.
|
||||
|
||||
### or all the images at once
|
||||
./ci-builder.sh all group complete
|
||||
The individual README files contain quick examples of building the images:
|
||||
|
||||
### or skipping the publishing to the Docker Hub
|
||||
./ci-builder.sh all-no-push group complete
|
||||
- [accetto/debian-vnc-xfce-g3][this-readme-debian-vnc-xfce-g3]
|
||||
- [accetto/debian-vnc-xfce-chromium-g3][this-readme-debian-vnc-xfce-chromium-g3]
|
||||
- [accetto/debian-vnc-xfce-firefox-g3][this-readme-debian-vnc-xfce-firefox-g3]
|
||||
|
||||
### and so on
|
||||
```
|
||||
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.
|
||||
|
||||
You can still execute the individual hook scripts as before (see the folder `/docker/hooks/`). However, the provided utilities `builder.sh` and `ci-builder.sh` are more convenient. Before pushing the images to the **Docker Hub** you have to prepare and source the file `secrets.rc` (see `example-secrets.rc`). The script `builder.sh` builds the individual images. The script `ci-builder.sh` can build various groups of images or all of them at once. Check the [builder-utility-readme][this-builder-readme], [local-building-example][this-readme-local-building-example] and [sibling Wiki][sibling-wiki] for more information.
|
||||
The following resources describe the image building subject in details:
|
||||
|
||||
### Sharing devices
|
||||
- [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]
|
||||
- [sibling Wiki][sibling-wiki]
|
||||
|
||||
Sharing the audio device for video with sound works only with `Chromium` and only on Linux:
|
||||
### Image generations
|
||||
|
||||
```shell
|
||||
docker run -it -P --rm \
|
||||
--device /dev/snd:/dev/snd:rw \
|
||||
--group-add audio \
|
||||
accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
```
|
||||
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].
|
||||
|
||||
Sharing the display with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
-e DISPLAY=${DISPLAY} \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-g3:latest --skip-vnc
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
Sharing the X11 socket with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-g3:latest
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
## 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
|
||||
### Project versions
|
||||
|
||||
This file describes the **first generation** (G3v1) of this project, which however corresponds to the **fourth version** (G3v4) of the **sibling project** [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
Please refer to the [sibling project][accetto-github-ubuntu-vnc-xfce-g3_project-versions] to learn more about the older project versions.
|
||||
|
||||
## Project goals
|
||||
### Project goals
|
||||
|
||||
Please refer to the [sibling project][accetto-github-ubuntu-vnc-xfce-g3_project-goals] to learn more about the project goals.
|
||||
|
||||
## Project features
|
||||
### Project features
|
||||
|
||||
Please refer to the [sibling project][accetto-github-ubuntu-vnc-xfce-g3_project-features] to learn more about the project features.
|
||||
|
||||
***
|
||||
### Getting help
|
||||
|
||||
## Issues, Wiki and Discussions
|
||||
If you have found a problem or you just have a question, please check the [User guide][this-user-guide], [Issues][this-issues] and the [sibling Wiki][sibling-wiki] first.
|
||||
Please do not overlook the closed issues.
|
||||
|
||||
If you have found a problem or you just have a question, please check the [Issues][this-issues] and the [sibling Wiki][sibling-wiki] first. Please do not overlook the closed issues.
|
||||
|
||||
If you do not find a solution, you can file a new issue. The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
If you do not find a solution, you can file a new issue.
|
||||
The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
If you have a question or an idea and you don't want to open an issue, you can use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
## Credits
|
||||
### Credits
|
||||
|
||||
Credit goes to all the countless people and companies, who contribute to open source community and make so many dreamy things real.
|
||||
|
||||
***
|
||||
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-docker]: https://hub.docker.com/u/accetto/
|
||||
|
||||
[this-changelog]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/CHANGELOG.md
|
||||
<!-- [this-github]: https://github.com/accetto/debian-vnc-xfce-g3/ -->
|
||||
|
||||
[this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues
|
||||
|
||||
[this-dockerfile]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce
|
||||
[this-folder-docker]: https://github.com/accetto/debian-vnc-xfce-g3/tree/master/docker
|
||||
|
||||
[this-readme-image-base]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/xfce/README.md
|
||||
[this-readme-image-chromium]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/xfce-chromium/README.md
|
||||
[this-readme-image-firefox]: https://github.com/accetto/debian-vnc-xfce-g3/tree/master/docker/xfce-firefox
|
||||
[this-folder-docker-hooks]: https://github.com/accetto/debian-vnc-xfce-g3/tree/master/docker/hooks
|
||||
|
||||
[this-example-secrets-file]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/examples/example-secrets.rc
|
||||
|
||||
[this-readme-debian-vnc-xfce-g3]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/xfce/README.md
|
||||
|
||||
[this-readme-debian-vnc-xfce-chromium-g3]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/xfce-chromium/README.md
|
||||
|
||||
[this-readme-debian-vnc-xfce-firefox-g3]: https://github.com/accetto/debian-vnc-xfce-g3/tree/master/docker/xfce-firefox
|
||||
|
||||
[this-builder-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
[this-readme-local-building-example]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-local-building-example.md
|
||||
|
||||
[this-readme-builder]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
|
||||
[this-readme-ci-builder]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-ci-builder.md
|
||||
|
||||
[this-readme-g3-cache]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-g3-cache.md
|
||||
|
||||
[this-readme-util-readme-examples]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/utils/readme-util-readme-examples.md
|
||||
|
||||
[accetto-docker-debian-vnc-xfce-g3]: https://hub.docker.com/r/accetto/debian-vnc-xfce-g3
|
||||
|
||||
[accetto-docker-debian-vnc-xfce-chromium-g3]: https://hub.docker.com/r/accetto/debian-vnc-xfce-chromium-g3
|
||||
|
||||
[accetto-docker-debian-vnc-xfce-firefox-g3]: https://hub.docker.com/r/accetto/debian-vnc-xfce-firefox-g3
|
||||
|
||||
<!-- sibling projects -->
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3_project-versions]: https://github.com/accetto/ubuntu-vnc-xfce-g3#project-versions
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3_project-goals]: https://github.com/accetto/ubuntu-vnc-xfce-g3#project-goals
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3_project-features]: https://github.com/accetto/ubuntu-vnc-xfce-g3#changes-and-new-features
|
||||
|
||||
[sibling-diagram-dockerfile-stages]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/Dockerfile.xfce.png
|
||||
|
||||
<!-- previous generations -->
|
||||
|
||||
[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess
|
||||
[accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
<!-- external links -->
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
[docker-debian]: https://hub.docker.com/_/debian/
|
||||
[docker-ubuntu]: https://hub.docker.com/_/ubuntu/
|
||||
|
||||
[debian-packages-search]: https://packages.debian.org/index
|
||||
|
||||
[chromium]: https://www.chromium.org/Home
|
||||
[firefox]: https://www.mozilla.org
|
||||
[novnc]: https://github.com/kanaka/noVNC
|
||||
[tigervnc]: http://tigervnc.org
|
||||
[xfce]: http://www.xfce.org
|
||||
|
||||
<!-- github badges -->
|
||||
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=release
|
||||
|
||||
[badge-github-release-date]: https://img.shields.io/github/release-date/accetto/debian-vnc-xfce-g3?logo=github
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
### do not use '-e'
|
||||
### @accetto, September 2022
|
||||
### updated: January 2023
|
||||
### updated: July 2023
|
||||
|
||||
### depends on the script 'builder.sh'
|
||||
### set the environment variables first, e.g. 'source .secrets'
|
||||
@@ -288,13 +288,13 @@ main() {
|
||||
pivotal )
|
||||
|
||||
clear_log
|
||||
build_group "${command}" "latest" "latest-chromium" "latest-firefox"
|
||||
build_group "${command}" "latest" "latest-firefox" "latest-chromium"
|
||||
;;
|
||||
|
||||
complete | complete-latest )
|
||||
|
||||
clear_log
|
||||
build_group "${command}" "latest" "latest-chromium" "latest-firefox"
|
||||
build_group "${command}" "latest" "latest-firefox" "latest-chromium"
|
||||
;;
|
||||
|
||||
complete-chromium )
|
||||
@@ -330,8 +330,8 @@ main() {
|
||||
clear_log
|
||||
|
||||
build_family "${command}" "latest"
|
||||
build_family "${command}" "latest-chromium"
|
||||
build_family "${command}" "latest-firefox"
|
||||
build_family "${command}" "latest-chromium"
|
||||
;;
|
||||
|
||||
latest | latest-chromium | latest-firefox )
|
||||
|
||||
@@ -334,6 +334,7 @@ COPY ./xfce/src/home/readme*.md "${HOME}"/
|
||||
### Note that all this will not be done, if the startup script will not be executed.
|
||||
RUN \
|
||||
chmod 666 /etc/passwd /etc/group \
|
||||
&& echo "${HEADLESS_USER_GROUP_NAME}:x:${HEADLESS_USER_GROUP_ID}:" >> /etc/group \
|
||||
&& echo "${HEADLESS_USER_NAME}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:${HOME}:/bin/bash" >> /etc/passwd \
|
||||
&& echo "${HEADLESS_USER_NAME} ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/"${HEADLESS_USER_NAME}" \
|
||||
&& echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${STARTUPDIR}"/.initial_sudo_password \
|
||||
|
||||
BIN
docker/doc/images/debian-vnc-xfce-chromium-g3-latest.png
Normal file
BIN
docker/doc/images/debian-vnc-xfce-chromium-g3-latest.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB |
BIN
docker/doc/images/debian-vnc-xfce-firefox-g3-latest.png
Normal file
BIN
docker/doc/images/debian-vnc-xfce-firefox-g3-latest.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 56 KiB |
BIN
docker/doc/images/debian-vnc-xfce-g3-latest.png
Normal file
BIN
docker/doc/images/debian-vnc-xfce-g3-latest.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
@@ -5,68 +5,82 @@ generate_container_user() {
|
||||
|
||||
local user_id
|
||||
local group_id
|
||||
local application_user_name
|
||||
local group_name
|
||||
local headless_user_name
|
||||
local headless_group_name
|
||||
|
||||
### note that this block will be exuceted only once (see the end of the if-block)
|
||||
### note that this block will be executed only once (see the end of the if-block)
|
||||
if [[ -w /etc/passwd ]] ; then
|
||||
|
||||
user_id="$(id -u)"
|
||||
group_id="$(id -g)"
|
||||
application_user_name="${HEADLESS_USER_NAME}"
|
||||
group_name="${HEADLESS_USER_GROUP_NAME}"
|
||||
|
||||
### user 'root (0)' is always created by default
|
||||
### user 'application_user_name' is created by Dockerfile
|
||||
if [[ "${user_id}" != "0" && "${user_id}" != "${HEADLESS_USER_ID}" ]] ; then
|
||||
|
||||
### rename the existing 'application_user_name' to 'builder'
|
||||
if [[ $( grep -c "${application_user_name}:x:${HEADLESS_USER_ID}:" /etc/passwd ) -ne 0 ]]; then
|
||||
|
||||
cat /etc/passwd | sed -e "s/^${application_user_name}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:/builder:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Builder:/" > /tmp/passwd
|
||||
|
||||
cp /tmp/passwd /etc/
|
||||
rm /tmp/passwd
|
||||
|
||||
if [[ -n "${_verbose}" ]] ; then
|
||||
echo "User '${application_user_name} (${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID})' renamed to 'builder (${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID})' in '/etc/passwd'"
|
||||
fi
|
||||
fi
|
||||
|
||||
### add the current application user ID as a new 'application_user_name' if it does not exist yet
|
||||
if [[ $( grep -c "${application_user_name}:x:${user_id}:" /etc/passwd ) -eq 0 ]] ; then
|
||||
|
||||
cat /etc/passwd > /tmp/passwd
|
||||
echo "${application_user_name}:x:${user_id}:${group_id}:Default:${HOME}:/bin/bash" >> /tmp/passwd
|
||||
|
||||
cp /tmp/passwd /etc/
|
||||
rm /tmp/passwd
|
||||
|
||||
if [[ -n "${_verbose}" ]] ; then
|
||||
echo "User '${application_user_name} (${user_id}:${group_id})' added into '/etc/passwd'"
|
||||
fi
|
||||
|
||||
### update the environment variables
|
||||
export HEADLESS_USER_ID=${user_id}
|
||||
export HEADLESS_USER_GROUP_ID=${group_id}
|
||||
fi
|
||||
fi
|
||||
headless_user_name="${HEADLESS_USER_NAME}"
|
||||
headless_group_name="${HEADLESS_USER_GROUP_NAME}"
|
||||
|
||||
### add the new group if the same GID does not exist yet
|
||||
if [[ "${group_id}" != "0" ]] ; then
|
||||
if [[ "${group_id}" != "0" && "${group_id}" != "${HEADLESS_USER_GROUP_ID}" ]] ; then
|
||||
|
||||
if [[ $( grep -c -E ":x:${group_id}:$" /etc/group ) -eq 0 ]] ; then
|
||||
### rename the existing 'headless_group_name' into 'g3builder'
|
||||
if [[ $( grep -c "${headless_group_name}:x:${HEADLESS_USER_GROUP_ID}:" /etc/group ) -ne 0 ]]; then
|
||||
|
||||
cat /etc/group > /tmp/group
|
||||
echo "${group_name}:x:${group_id}:" >> /tmp/group
|
||||
cat /etc/group | sed -e "s/^${headless_group_name}:x:${HEADLESS_USER_GROUP_ID}:/g3builder:x:${HEADLESS_USER_GROUP_ID}:/" > /tmp/group
|
||||
|
||||
cp /tmp/group /etc/
|
||||
rm /tmp/group
|
||||
|
||||
if [[ -n "${_verbose}" ]] ; then
|
||||
echo "Group '${group_name} (${group_id})' added into '/etc/group'"
|
||||
echo "Default user group '${headless_group_name}(${HEADLESS_USER_GROUP_ID})' renamed into 'g3builder(${HEADLESS_USER_GROUP_ID})' in '/etc/group'"
|
||||
fi
|
||||
fi
|
||||
|
||||
### add the current default user group ID as a new 'headless_group_name' if it does not exist yet
|
||||
if [[ $( grep -c -E ":x:${group_id}:$" /etc/group ) -eq 0 ]] ; then
|
||||
|
||||
cat /etc/group > /tmp/group
|
||||
echo "${headless_group_name}:x:${group_id}:" >> /tmp/group
|
||||
|
||||
cp /tmp/group /etc/
|
||||
rm /tmp/group
|
||||
|
||||
if [[ -n "${_verbose}" ]] ; then
|
||||
echo "Default user group '${headless_group_name}(${group_id})' added into '/etc/group'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
### user 'root (0)' is always created by default
|
||||
### user 'headless_user_name' is created by Dockerfile
|
||||
if [[ "${user_id}" != "0" && "${user_id}" != "${HEADLESS_USER_ID}" ]] ; then
|
||||
|
||||
### rename the existing 'headless_user_name' into 'g3builder'
|
||||
if [[ $( grep -c "${headless_user_name}:x:${HEADLESS_USER_ID}:" /etc/passwd ) -ne 0 ]]; then
|
||||
|
||||
cat /etc/passwd | sed -e "s/^${headless_user_name}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:/g3builder:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:G3Builder:/" > /tmp/passwd
|
||||
|
||||
cp /tmp/passwd /etc/
|
||||
rm /tmp/passwd
|
||||
|
||||
if [[ -n "${_verbose}" ]] ; then
|
||||
echo "Default user '${headless_user_name}(${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID})' renamed into 'g3builder(${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID})' in '/etc/passwd'"
|
||||
fi
|
||||
fi
|
||||
|
||||
### add the current default user ID as a new 'headless_user_name' if it does not exist yet
|
||||
if [[ $( grep -c "${headless_user_name}:x:${user_id}:" /etc/passwd ) -eq 0 ]] ; then
|
||||
|
||||
cat /etc/passwd > /tmp/passwd
|
||||
echo "${headless_user_name}:x:${user_id}:${group_id}:Default:${HOME}:/bin/bash" >> /tmp/passwd
|
||||
|
||||
cp /tmp/passwd /etc/
|
||||
rm /tmp/passwd
|
||||
|
||||
if [[ -n "${_verbose}" ]] ; then
|
||||
echo "Default user '${headless_user_name}(${user_id}:${group_id})' added into '/etc/passwd'"
|
||||
fi
|
||||
|
||||
### update the environment variables
|
||||
export HEADLESS_USER_ID=${user_id}
|
||||
export HEADLESS_USER_GROUP_ID=${group_id}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -s "${STARTUPDIR}"/.initial_sudo_password ]] ; then
|
||||
|
||||
@@ -2,237 +2,124 @@
|
||||
|
||||
## accetto/debian-vnc-xfce-chromium-g3
|
||||
|
||||
[Docker Hub][this-docker] - [Git Hub][this-github] - [Dockerfile][this-dockerfile] - [Full Readme][this-readme-full] - [Changelog][this-changelog] - [Project Readme][this-readme-project]
|
||||
[User Guide][this-user-guide] - [GitHub][this-github] - [Dockerfile][this-dockerfile] - [Readme][this-readme-full] - [Changelog][this-changelog]
|
||||
|
||||
![badge-docker-pulls][badge-docker-pulls]
|
||||
![badge-docker-stars][badge-docker-stars]
|
||||
![badge-github-release][badge-github-release]
|
||||
![badge-github-release-date][badge-github-release-date]
|
||||
|
||||
***
|
||||
|
||||
- [Headless Debian/Xfce container with VNC/noVNC and Chromium Browser](#headless-debianxfce-container-with-vncnovnc-and-chromium-browser)
|
||||
- [accetto/debian-vnc-xfce-chromium-g3](#accettodebian-vnc-xfce-chromium-g3)
|
||||
- [Introduction](#introduction)
|
||||
- [TL;DR](#tldr)
|
||||
- [Installing packages](#installing-packages)
|
||||
- [Shared memory size](#shared-memory-size)
|
||||
- [Extending images](#extending-images)
|
||||
- [Building images](#building-images)
|
||||
- [Sharing devices](#sharing-devices)
|
||||
- [Description](#description)
|
||||
- [Image tags](#image-tags)
|
||||
- [More information](#more-information)
|
||||
This Docker Hub repository contains Docker images for headless working.
|
||||
|
||||
***
|
||||
The images are based on [Debian 11][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client.
|
||||
|
||||
### Introduction
|
||||
|
||||
This repository contains resources for building Docker images based on [Debian 11][docker-debian] with [Xfce][xfce] desktop environment and [VNC][tigervnc]/[noVNC][novnc] servers for headless use and the current [Chromium][chromium] web browser.
|
||||
The popular web browser [Chromium][chromium] is also included.
|
||||
|
||||
There is also a similar sibling image [accetto/ubuntu-vnc-xfce-chromium-g3][accetto-dockerhub-ubuntu-vnc-xfce-chromium-g3] based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
This is the **short README** version for the **Docker Hub**. There is also the [full-length README][this-readme-full] on the **GitHub**.
|
||||
This [User guide][this-user-guide] describes the images and how to use them.
|
||||
|
||||
### TL;DR
|
||||
The following image tags are regularly built and published on Docker Hub:
|
||||
|
||||
#### Installing packages
|
||||
|
||||
I try to keep the images slim. Consequently you can encounter missing dependencies while adding more applications yourself. You can track the missing libraries on the [Debian Packages Search][debian-packages-search] page and install them subsequently.
|
||||
|
||||
You can also try to fix it by executing the following (the default `sudo` password is **headless**):
|
||||
|
||||
```shell
|
||||
### apt cache needs to be updated only once
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt --fix-broken install
|
||||
```
|
||||
|
||||
#### Shared memory size
|
||||
|
||||
Note that some applications require larger shared memory than the default 64MB. Using 256MB usually solves crashes or strange behavior.
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size.
|
||||
|
||||
#### Extending images
|
||||
|
||||
The provided example file `Dockerfile.extend` shows how to use the images as the base for your own images.
|
||||
|
||||
Your concrete `Dockerfile` may need more statements, but the concept should be clear.
|
||||
|
||||
The compose file `example.yml` shows how to switch to another non-root user and how to set the VNC password and resolution.
|
||||
|
||||
#### Building images
|
||||
|
||||
The fastest way to build the images:
|
||||
|
||||
```shell
|
||||
### PWD = project root
|
||||
### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc')
|
||||
|
||||
### examples of building and publishing the individual images
|
||||
./builder.sh latest-chromium all
|
||||
|
||||
### just building an image, skipping the publishing and the version sticker update
|
||||
./builder.sh latest-chromium build
|
||||
|
||||
### examples of building and publishing the images as a group
|
||||
./ci-builder.sh all group latest-chromium
|
||||
|
||||
### or also
|
||||
./ci-builder.sh all family latest-chromium
|
||||
```
|
||||
|
||||
You can still execute the individual hook scripts as before (see the folder `/docker/hooks/`). However, the provided utilities `builder.sh` and `ci-builder.sh` are more convenient. Before pushing the images to the **Docker Hub** you have to prepare and source the file `secrets.rc` (see `example-secrets.rc`). The script `builder.sh` builds the individual images. The script `ci-builder.sh` can build various groups of images or all of them at once. Check the [builder-utility-readme][this-builder-readme], [local-building-example][this-readme-local-building-example] and [sibling Wiki][sibling-wiki] for more information.
|
||||
|
||||
Note that selected features that are enabled by default can be explicitly disabled via environment variables. This allows to build even smaller images by excluding, for example, `noVNC`. See the [local-building-example][this-readme-local-building-example] for more information.
|
||||
|
||||
#### Sharing devices
|
||||
|
||||
Sharing the audio device for video with sound works only with `Chromium` and only on Linux:
|
||||
|
||||
```shell
|
||||
docker run -it -P --rm \
|
||||
--device /dev/snd:/dev/snd:rw \
|
||||
--group-add audio \
|
||||
accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
```
|
||||
|
||||
Sharing the display with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
-e DISPLAY=${DISPLAY} \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-chromium-g3:latest --skip-vnc
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
Sharing the X11 socket with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
### Description
|
||||
|
||||
**Attention:** The [Chromium Browser][chromium] in these images runs in the `--no-sandbox` mode. You should be aware of the implications. The image is intended for testing and development.
|
||||
|
||||
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].
|
||||
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- utilities **ping**, **wget**, **sudo** (Debian distribution)
|
||||
- current version of JSON processor [jq][jq]
|
||||
- light-weight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding both the container user and the group
|
||||
- support of **version sticker** (see the [full-length README][this-readme-full] on the **GitHub**)
|
||||
- current version of [Chromium Browser][chromium] open-source web browser (Debian distribution)
|
||||
|
||||
The history of notable changes is documented in the [CHANGELOG][this-changelog].
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
### Image tags
|
||||
|
||||
The following image tags are regularly built and published on the **Docker Hub**:
|
||||
<!-- markdownlint-disable MD052 -->
|
||||
|
||||
- `latest` based on `Debian 11`
|
||||
|
||||
![badge_latest_created][badge_latest_created]
|
||||
[![badge_latest_version-sticker][badge_latest_version-sticker]][link_latest_version-sticker-verbose]
|
||||
|
||||
Clicking on the version sticker badge reveals more information about the actual configuration of the image.
|
||||
<!-- markdownlint-enable MD052 -->
|
||||
|
||||
### More information
|
||||
**Hint:** Clicking the version sticker badge reveals more information about the particular build.
|
||||
|
||||
More information about these images can be found in the [full-length README][this-readme-full] file on the GitHub.
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- lightweight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- [sudo][sudo] support
|
||||
- current version of JSON processor [jq][jq]
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding environment variables, VNC parameters, user and group (see [User guide][this-user-guide-using-containers])
|
||||
- support of **version sticker** (see [User guide][this-user-guide-version-sticker])
|
||||
- current version of [Chromium Browser][chromium] open-source web browser (Debian distribution)
|
||||
|
||||
The [Chromium Browser][chromium] in these images runs in the `--no-sandbox` mode.
|
||||
You should be aware of the implications.
|
||||
The images are intended for testing and development.
|
||||
|
||||
The following **TCP** ports are exposed by default:
|
||||
|
||||
- **5901** for access over **VNC** (using VNC viewer)
|
||||
- **6901** for access over [noVNC][novnc] (using web browser)
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
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].
|
||||
|
||||
If you've found a problem or you just have a question, please check the [User guide][this-user-guide], [Issues][this-issues] and [sibling Wiki][sibling-wiki] first.
|
||||
Please do not overlook the closed issues.
|
||||
|
||||
If you do not find a solution, you can file a new issue.
|
||||
The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
If you have a question or an idea and you don't want to open an issue, you can also use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
**Remark:** The [GitHub project][this-github] contains image generators that image users generally don’t need, unless they want to build the images themselves.
|
||||
|
||||
***
|
||||
|
||||
<!-- GitHub project common -->
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-user-guide-version-sticker]: https://accetto.github.io/user-guide-g3/version-sticker/
|
||||
|
||||
[this-user-guide-using-containers]: https://accetto.github.io/user-guide-g3/using-containers/
|
||||
|
||||
[this-changelog]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/CHANGELOG.md
|
||||
|
||||
[this-github]: https://github.com/accetto/debian-vnc-xfce-g3/
|
||||
<!-- [this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues -->
|
||||
|
||||
[this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues
|
||||
|
||||
[this-readme-full]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/xfce-chromium/README.md
|
||||
[this-readme-project]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-builder-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
[this-readme-local-building-example]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-local-building-example.md
|
||||
|
||||
<!-- Docker image specific -->
|
||||
|
||||
[this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-chromium-g3/
|
||||
[this-dockerfile]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce
|
||||
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-chromium.jpg
|
||||
|
||||
<!-- Sibling projects -->
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-chromium-g3-latest.png
|
||||
|
||||
[accetto-dockerhub-ubuntu-vnc-xfce-chromium-g3]: https://hub.docker.com/r/accetto/ubuntu-vnc-xfce-chromium-g3
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
<!-- Previous generations -->
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
[accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess
|
||||
|
||||
<!-- External links -->
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
[docker-debian]: https://hub.docker.com/_/debian/
|
||||
[docker-ubuntu]: https://hub.docker.com/_/ubuntu/
|
||||
|
||||
<!-- [docker-doc]: https://docs.docker.com/ -->
|
||||
<!-- [docker-doc-managing-data]: https://docs.docker.com/storage/ -->
|
||||
|
||||
[debian-packages-search]: https://packages.debian.org/index
|
||||
|
||||
[jq]: https://stedolan.github.io/jq/
|
||||
[mousepad]: https://github.com/codebrainz/mousepad
|
||||
[nano]: https://www.nano-editor.org/
|
||||
[novnc]: https://github.com/kanaka/noVNC
|
||||
[sudo]: https://www.sudo.ws/
|
||||
[tigervnc]: http://tigervnc.org
|
||||
[tini]: https://github.com/krallin/tini
|
||||
[xfce]: http://www.xfce.org
|
||||
|
||||
[chromium]: https://www.chromium.org/Home
|
||||
|
||||
<!-- github badges common -->
|
||||
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=release
|
||||
|
||||
[badge-github-release-date]: https://img.shields.io/github/release-date/accetto/debian-vnc-xfce-g3?logo=github
|
||||
|
||||
<!-- docker badges specific -->
|
||||
|
||||
[badge-docker-pulls]: https://badgen.net/docker/pulls/accetto/debian-vnc-xfce-chromium-g3?icon=docker&label=pulls
|
||||
|
||||
[badge-docker-stars]: https://badgen.net/docker/stars/accetto/debian-vnc-xfce-chromium-g3?icon=docker&label=stars
|
||||
|
||||
<!-- Appendix -->
|
||||
<!-- Appendix will be added by util-readme.sh -->
|
||||
|
||||
@@ -2,92 +2,25 @@
|
||||
|
||||
## accetto/debian-vnc-xfce-chromium-g3
|
||||
|
||||
[Docker Hub][this-docker] - [Git Hub][this-github] - [Dockerfile][this-dockerfile] - [Docker Readme][this-readme-dockerhub] - [Changelog][this-changelog] - [Project Readme][this-readme-project]
|
||||
|
||||
![badge-docker-pulls][badge-docker-pulls]
|
||||
![badge-docker-stars][badge-docker-stars]
|
||||
![badge-github-release][badge-github-release]
|
||||
![badge-github-release-date][badge-github-release-date]
|
||||
[User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog]
|
||||
|
||||
***
|
||||
|
||||
- [Headless Debian/Xfce container with VNC/noVNC and Chromium Browser](#headless-debianxfce-container-with-vncnovnc-and-chromium-browser)
|
||||
- [accetto/debian-vnc-xfce-chromium-g3](#accettodebian-vnc-xfce-chromium-g3)
|
||||
- [Introduction](#introduction)
|
||||
- [TL;DR](#tldr)
|
||||
- [Installing packages](#installing-packages)
|
||||
- [Shared memory size](#shared-memory-size)
|
||||
- [Extending images](#extending-images)
|
||||
- [Building images](#building-images)
|
||||
- [Sharing devices](#sharing-devices)
|
||||
- [Description](#description)
|
||||
- [Image tags](#image-tags)
|
||||
- [Ports](#ports)
|
||||
- [Volumes](#volumes)
|
||||
- [Version sticker](#version-sticker)
|
||||
- [Using headless containers](#using-headless-containers)
|
||||
- [Overriding environment variables](#overriding-environment-variables)
|
||||
- [Overriding VNC/noVNC parameters](#overriding-vncnovnc-parameters)
|
||||
- [Container user account](#container-user-account)
|
||||
- [Overriding container user parameters](#overriding-container-user-parameters)
|
||||
- [Overriding user parameters in build-time](#overriding-user-parameters-in-build-time)
|
||||
- [Overriding user parameters in run-time](#overriding-user-parameters-in-run-time)
|
||||
- [User permissions and ownership](#user-permissions-and-ownership)
|
||||
- [Other considerations](#other-considerations)
|
||||
- [Running containers in background (detached)](#running-containers-in-background-detached)
|
||||
- [Running containers in foreground (interactively)](#running-containers-in-foreground-interactively)
|
||||
- [Startup options and help](#startup-options-and-help)
|
||||
- [Issues, Wiki and Discussions](#issues-wiki-and-discussions)
|
||||
- [Credits](#credits)
|
||||
- [Diagrams](#diagrams)
|
||||
- [Dockerfile.xfce](#dockerfilexfce)
|
||||
This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-chromium-g3][this-docker].
|
||||
|
||||
***
|
||||
The [Chromium Browser][chromium] in these images runs in the `--no-sandbox` mode.
|
||||
You should be aware of the implications.
|
||||
The images are intended for testing and development.
|
||||
|
||||
### Introduction
|
||||
There is also a sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
This repository contains resources for building Docker images based on [Debian 11][docker-debian] with [Xfce][xfce] desktop environment and [VNC][tigervnc]/[noVNC][novnc] servers for headless use and the current [Chromium][chromium] web browser.
|
||||
This [User guide][this-user-guide] describes the images and how to use them.
|
||||
|
||||
There is also the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
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].
|
||||
|
||||
### TL;DR
|
||||
|
||||
#### Installing packages
|
||||
|
||||
I try to keep the images slim. Consequently you can encounter missing dependencies while adding more applications yourself. You can track the missing libraries on the [Debian Packages Search][debian-packages-search] page and install them subsequently.
|
||||
|
||||
You can also try to fix it by executing the following (the default `sudo` password is **headless**):
|
||||
|
||||
```shell
|
||||
### apt cache needs to be updated only once
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt --fix-broken install
|
||||
```
|
||||
|
||||
#### Shared memory size
|
||||
|
||||
Note that some applications require larger shared memory than the default 64MB. Using 256MB usually solves crashes or strange behavior.
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size.
|
||||
|
||||
#### Extending images
|
||||
|
||||
The provided example file `Dockerfile.extend` shows how to use the images as the base for your own images.
|
||||
|
||||
Your concrete `Dockerfile` may need more statements, but the concept should be clear.
|
||||
|
||||
The compose file `example.yml` shows how to switch to another non-root user and how to set the VNC password and resolution.
|
||||
|
||||
#### Building images
|
||||
|
||||
The fastest way to build the images:
|
||||
### Building images
|
||||
|
||||
```shell
|
||||
### PWD = project root
|
||||
@@ -103,586 +36,54 @@ The fastest way to build the images:
|
||||
./ci-builder.sh all group latest-chromium
|
||||
```
|
||||
|
||||
You can still execute the individual hook scripts as before (see the folder `/docker/hooks/`). However, the provided utilities `builder.sh` and `ci-builder.sh` are more convenient. Before pushing the images to the **Docker Hub** you have to prepare and source the file `secrets.rc` (see `example-secrets.rc`). The script `builder.sh` builds the individual images. The script `ci-builder.sh` can build various groups of images or all of them at once. Check the [builder-utility-readme][this-builder-readme], [local-building-example][this-readme-local-building-example] and [sibling Wiki][sibling-wiki] for more information.
|
||||
Refer to the main [README][this-readme] file for more information about the building subject.
|
||||
|
||||
Note that selected features that are enabled by default can be explicitly disabled via environment variables. This allows to build even smaller images by excluding, for example, `noVNC`. See the [local-building-example][this-readme-local-building-example] for more information.
|
||||
### Getting help
|
||||
|
||||
#### Sharing devices
|
||||
If you've found a problem or you just have a question, please check the [User guide][this-user-guide], [Issues][this-issues] and [sibling Wiki][sibling-wiki] first.
|
||||
Please do not overlook the closed issues.
|
||||
|
||||
Sharing the audio device for video with sound works only with `Chromium` and only on Linux:
|
||||
If you do not find a solution, you can file a new issue.
|
||||
The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
```shell
|
||||
docker run -it -P --rm \
|
||||
--device /dev/snd:/dev/snd:rw \
|
||||
--group-add audio \
|
||||
accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
```
|
||||
If you have a question or an idea and you don't want to open an issue, you can also use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
Sharing the display with the host works only on Linux:
|
||||
### Diagrams
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
Diagram of the multi-staged Dockerfile used for building multiple images.
|
||||
|
||||
docker run -it -P --rm \
|
||||
-e DISPLAY=${DISPLAY} \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-chromium-g3:latest --skip-vnc
|
||||
The actual content of a particular image build is controlled by the *feature variables*.
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
Sharing the X11 socket with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
### Description
|
||||
|
||||
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].
|
||||
|
||||
**Attention:** The [Chromium Browser][chromium] in these images runs in the `--no-sandbox` mode. You should be aware of the implications. The image is intended for testing and development.
|
||||
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- utilities **ping**, **wget**, **sudo** (Debian distribution)
|
||||
- current version of JSON processor [jq][jq]
|
||||
- light-weight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding both the container user and the group
|
||||
- support of **version sticker** (see below)
|
||||
- current version of [Chromium Browser][chromium] open-source web browser (Debian distribution)
|
||||
|
||||
The history of notable changes is documented in the [CHANGELOG][this-changelog].
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
### Image tags
|
||||
|
||||
The following image tags are regularly built and published on the **Docker Hub**:
|
||||
|
||||
- `latest` based on `Debian 11`
|
||||
|
||||
Clicking on the version sticker badge in the [README on Docker Hub][this-readme-dockerhub] reveals more information about the actual configuration of the image.
|
||||
|
||||
### Ports
|
||||
|
||||
Following **TCP** ports are exposed by default:
|
||||
|
||||
- **5901** is used for access over **VNC**
|
||||
- **6901** is used for access over [noVNC][novnc]
|
||||
|
||||
These default ports and also some other parameters can be overridden several ways (see bellow).
|
||||
|
||||
### Volumes
|
||||
|
||||
The containers do not create or use any external volumes by default.
|
||||
|
||||
Both **named volumes** and **bind mounts** can be used. More about volumes can be found in [Docker documentation][docker-doc] (e.g. [Manage data in Docker][docker-doc-managing-data]).
|
||||
|
||||
### Version sticker
|
||||
|
||||
Version sticker serves multiple purposes that are closer described in the [sibling Wiki][sibling-wiki-version-stickers]. Note that the usage of the version sticker has changed between the generations of images.
|
||||
|
||||
The **short version sticker value** describes the version of the image and it is persisted in its **label** during the build-time. It is also shown as its **badge** in the README file.
|
||||
|
||||
The **verbose version sticker value** is used by the CI builder to decide if the image needs to be refreshed. It describes the actual configuration of the essential components of the image. It can be revealed by clicking on the version sticker badge in the README file.
|
||||
|
||||
The version sticker values are generated by the script `version_sticker.sh`, which is deployed into the startup directory `/dockerstartup`. The script will show a short help if executed with the argument `-h`. There is also a convenient `Version Sticker` launcher on the container desktop.
|
||||
|
||||
## Using headless containers
|
||||
|
||||
There are two ways, how to use the containers created from this image.
|
||||
|
||||
All containers are accessible by a VNC viewer (e.g. [TigerVNC][tigervnc] or [TightVNC][tightvnc]).
|
||||
|
||||
The default `VNC_PORT` value is `5901`. The default `DISPLAY` value is `:1`. The default VNC password (`VNC_PW`) is `headless`.
|
||||
|
||||
The containers that are created from the images built with the **noVNC feature** can be also accessed over [noVNC][noVNC] by any web browser supporting HTML5.
|
||||
|
||||
The default `NOVNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.
|
||||
|
||||
There are several ways of connecting to headless containers and the possibilities also differ between the Linux and Windows environments, but usually it is done by mapping the VNC/noVNC ports exposed by the container to some free TCP ports on its host system.
|
||||
|
||||
For example, the following command would map the VNC/noVNC ports `5901/6901` of the container to the TCP ports `25901/26901` on the host:
|
||||
|
||||
```shell
|
||||
docker run -p 25901:5901 -p 26901:6901 ...
|
||||
```
|
||||
|
||||
If the container would run on the local computer, then it would be accessible over **VNC** as `localhost:25901` and over **noVNC** as `http://localhost:26901`.
|
||||
|
||||
If it would run on the remote server `mynas`, then it would be accessible over **VNC** as `mynas:25901` and over **noVNC** as `http://mynas:26901`.
|
||||
|
||||
The image offers two [noVNC][novnc] clients - **lite client** and **full client**. Because the connection URL differs slightly in both cases, the container provides a **simple startup page**.
|
||||
|
||||
The startup page offers two hyperlinks for both noVNC clients:
|
||||
|
||||
- **noVNC Lite Client** (`http://mynas:26901/vnc_lite.html`)
|
||||
- **noVNC Full Client** (`http://mynas:26901/vnc.html`)
|
||||
|
||||
It is also possible to provide the password through the links:
|
||||
|
||||
- `http://mynas:26901/vnc_lite.html?password=headless`
|
||||
- `http://mynas:26901/vnc.html?password=headless`
|
||||
|
||||
### Overriding environment variables
|
||||
|
||||
If the environment variable `FEATURES_OVERRIDING_ENVV=1`, which is the case by default, then the container startup script will look for the file `$HOME/.override/.override_envv.rc` and source all the lines that begin with the string 'export ' at the first position and contain the '=' character.
|
||||
|
||||
You can provide the overriding file from outside the container using *bind mounts* or *volumes*.
|
||||
|
||||
This feature allows overriding or adding environment variables at the **container startup-time**.
|
||||
It means, even after the container has already been created.
|
||||
|
||||
You can disable this behavior by setting the variable `FEATURES_OVERRIDING_ENVV` to zero when the container is created or the image is built.
|
||||
|
||||
The lines that have been actually sourced can be reported into the container's log if the startup parameter `--verbose` or `--debug` is provided.
|
||||
|
||||
Look below for the example how to override the VNC/noVNC parameters at the container startup-time.
|
||||
|
||||
### Overriding VNC/noVNC parameters
|
||||
|
||||
The VNC/noVNC parameters are controlled by related environment variables embedded into the image.
|
||||
|
||||
They have the following default values:
|
||||
|
||||
```shell
|
||||
DISPLAY=:1
|
||||
NOVNC_PORT=6901
|
||||
VNC_COL_DEPTH=24
|
||||
VNC_PORT=5901
|
||||
VNC_PW=headless
|
||||
VNC_RESOLUTION=1360x768
|
||||
VNC_VIEW_ONLY=false
|
||||
```
|
||||
|
||||
These environment variables can be overridden several ways.
|
||||
|
||||
**At image build-time** you can embed different default values by using the following build arguments:
|
||||
|
||||
- `ARG_VNC_PW` sets the variable `VNC_PW` (VNV/noVNC password)
|
||||
- `ARG_VNC_DISPLAY` sets the variable `DISPLAY`
|
||||
- `ARG_VNC_PORT` sets the variable `VNC_PORT`
|
||||
- `ARG_VNC_RESOLUTION` sets the variable `VNC_RESOLUTION`
|
||||
- `ARG_VNC_COL_DEPTH` sets the variable `VNC_COL_DEPTH`
|
||||
- `ARG_VNC_VIEW_ONLY` set the variable `VNC_VIEW_ONLY`
|
||||
- `ARG_NOVNC_PORT` sets the variable `NOVNC_PORT`
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker build --build-arg DISPLAY=:2 --build-arg ARG_VNC_PORT=6902 ...
|
||||
```
|
||||
|
||||
**At container creation-time** you can override the environment variable values by using the `docker run -e` option. Please note that in this case you have to use the actual environment variable names, not the build argument names (e.g. `VNC_PORT` instead of `ARG_VNC_PORT`).
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker run -e VNC_PORT=6902 ...
|
||||
```
|
||||
|
||||
**At container startup-time** you can override the VNC/noVNC variables using the feature `FEATURES_OVERRIDING_ENVV' described above.
|
||||
|
||||
For example, the following command would bind the file `my_own_vnc_parameters.rc` from the directory `/home/joe` to the container:
|
||||
|
||||
```shell
|
||||
docker run -v /home/joe/my_own_vnc_parameters.rc:/home/headless/.override/.override_envv.rc
|
||||
```
|
||||
|
||||
The content of the file should be similar to the provided example file `example-override-envv.rc`:
|
||||
|
||||
```shell
|
||||
### only the lines beginning with 'export ' at the first position and containing '=' will be sourced
|
||||
export VNC_RESOLUTION=1024x768
|
||||
export VNC_PW=secret
|
||||
#export DISPLAY=:2
|
||||
#export VNC_COL_DEPTH=32
|
||||
```
|
||||
|
||||
Please note that only the lines beginning with the string 'export ' at the first position and containing the '=' character will be imported.
|
||||
|
||||
By providing the variable values the following rules apply:
|
||||
|
||||
- The value of `ARG_VNC_DISPLAY/VNC_DISPLAY` should include also the leading colon (e.g. `:1`).
|
||||
- The value of `ARG_VNC_PW/VNC_PW` can be empty. It effectively disables the VNC/noVNC password.
|
||||
|
||||
If you want to check, what parameter values have been actually applied, then you can start the container with the parameter `--debug`.
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker run -it -P --rm accetto/debian-vnc-xfce-g3:latest --debug
|
||||
|
||||
### output (excerpt)
|
||||
VNC server started on display ':1' and TCP port '5901'
|
||||
Connect via VNC viewer with 172.17.0.3:5901
|
||||
noVNC started on TCP port '6901'
|
||||
```
|
||||
|
||||
You should be aware, that overriding the VNC/noVNC parameters incorrectly could prevent the container from starting.
|
||||
|
||||
This feature assumes some preliminary knowledge and it is provided for advanced users that already know what they want to achieve.
|
||||
|
||||
For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NOVNC_PORT = 6900 + DISPLAY`).
|
||||
|
||||
You may decide not to follow the conventions. This image allows you to set the parameters differently, but again, you should know, what you are doing.
|
||||
|
||||
Be also aware, that there are differences between the Linux and Windows environments.
|
||||
|
||||
If your session disconnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the **NOVNC_HEARTBEAT=XX** environment variable at startup-time, where **XX** is the number of seconds between [websocket ping/pong](https://github.com/websockets/ws/issues/977) packets.
|
||||
|
||||
## Container user account
|
||||
|
||||
Containers created from this image run under the **application user** (by default `headless:headless`, `1000:1000`), which is a **non-root** user account. However, the application user gets permissions for `sudo`.
|
||||
|
||||
The **application user name** also defines the **home directory name**, which is by default `/home/headless`.
|
||||
|
||||
The default application user's password is `headless`, which is also the default `sudo` password.
|
||||
|
||||
The user's (and `sudo`) password can be changed inside the container by using the `passwd` command. For example, changing the password to `docker`:
|
||||
|
||||
```shell
|
||||
echo 'headless:docker' | sudo chpasswd
|
||||
|
||||
### or also
|
||||
sudo chpasswd <<<"headless:docker"
|
||||
```
|
||||
|
||||
The `sudo` command allows user elevation, so the **application user** can install additional software inside the container.
|
||||
|
||||
The following example shows how to install **vim**:
|
||||
|
||||
```shell
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y vim
|
||||
```
|
||||
|
||||
### Overriding container user parameters
|
||||
|
||||
The user ID, user name, user group ID, user group name and the initial `sudo` password can be overridden during the build time (`docker build`).
|
||||
|
||||
The user ID and the group ID can be overridden also in run time (`docker run`).
|
||||
|
||||
#### Overriding user parameters in build-time
|
||||
|
||||
The build parameters `ARG_HEADLESS_USER_ID`, `ARG_HEADLESS_USER_NAME`, `ARG_HEADLESS_USER_GROUP_ID` and `ARG_HEADLESS_USER_GROUP_NAME` are used during the build time (`docker build`) and they allow to override the related container parameters.
|
||||
|
||||
Their values are persisted in the corresponding environment variables `HEADLESS_USER_ID`, `HEADLESS_USER_NAME`, `HEADLESS_USER_GROUP_ID` and `HEADLESS_USER_GROUP_NAME`.
|
||||
|
||||
The build argument `ARG_SUDO_INITIAL_PW` allows overriding the initial application user's and `sudo` password (which is `headless`). This initial password is not stored into any environment variable, but into a temporary file, which is removed on the first container start. The password can be changed inside the container.
|
||||
|
||||
For example, building an image with the application user name `hairless`, with the primary user group `hairygroup`, the IDs `2002:3003` and the initial password `docker`:
|
||||
|
||||
```shell
|
||||
docker build --build-arg ARG_HEADLESS_USER_NAME=hairless --build-arg ARG_HEADLESS_USER_GROUP_NAME=hairygroup --build-arg ARG_HEADLESS_USER_ID=2002 --build-arg ARG_HEADLESS_USER_GROUP_ID=3003 --build-arg ARG_SUDO_INITIAL_PW=docker ... -t my/image:overriden
|
||||
```
|
||||
|
||||
#### Overriding user parameters in run-time
|
||||
|
||||
Both the user ID and group ID can be overridden also in the run time (`docker run`). It does not apply to the application user name, the group name and the initial password.
|
||||
|
||||
For example, this would override the `user:group` by `2000:3000`:
|
||||
|
||||
```shell
|
||||
docker run --user 2000:3000 ... my/image:overriden
|
||||
```
|
||||
|
||||
#### User permissions and ownership
|
||||
|
||||
The actual application user account and the user group are created by the startup script on the first container start.
|
||||
|
||||
During this one-time task the startup script needs to modify the container files `/etc/passwd` and `/etc/group`. That is why there is the line `chmod 666 /etc/passwd /etc/group` in the Dockerfile (see the `stage_final`). However, the permissions of these two files will be set to the standard value `644` just after creating the user.
|
||||
|
||||
The created user gets permissions for `sudo` and the ownership to the content of the home and startup folders.
|
||||
|
||||
The temporary file `${STARTUPDIR}/.initial_sudo_password` is cleared after creating the user.
|
||||
|
||||
However, note that the initial `sudo` password will still be persisted in the image history. You have to change it inside the container, if you want to keep it really secret.
|
||||
|
||||
There is the test script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
|
||||
#### Other considerations
|
||||
|
||||
Please note that the described configuration will not be done if the startup script `startup.sh` will not be executed.
|
||||
|
||||
Also do not confuse the application user's password with the **VNC password**, because they both have the same default value (`headless`).
|
||||
|
||||
## Running containers in background (detached)
|
||||
|
||||
The following container will keep running in the background and it will listen on an automatically selected TCP port on the host computer:
|
||||
|
||||
```shell
|
||||
docker run -d -P accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
```
|
||||
|
||||
The following container will listen on the host's TCP port **25901**:
|
||||
|
||||
```shell
|
||||
docker run -d -p 25901:5901 accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
```
|
||||
|
||||
The following container will create (or re-use) the local named volume **my\_Downloads** mounted as `/home/headless/Downloads`:
|
||||
|
||||
```shell
|
||||
docker run -d -P -v my_Downloads:/home/headless/Downloads accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
```
|
||||
|
||||
or using the newer syntax with **--mount** flag:
|
||||
|
||||
```shell
|
||||
docker run -d -P --mount source=my_Downloads,target=/home/headless/Downloads accetto/debian-vnc-xfce-chromium-g3:latest
|
||||
```
|
||||
|
||||
## Running containers in foreground (interactively)
|
||||
|
||||
The following container can be used interactively:
|
||||
|
||||
```shell
|
||||
docker run -it --rm accetto/debian-vnc-xfce-chromium-g3:latest bash
|
||||
```
|
||||
|
||||
The opened `bash` session can be used as usual and then closed by entering `^C` (CTRL-C):
|
||||
|
||||
```shell
|
||||
To run a command as administrator (user "root"), use "sudo <command>".
|
||||
See "man sudo_root" for details.
|
||||
|
||||
headless@cf4a4e01d94b:~$ whoami
|
||||
headless
|
||||
headless@cf4a4e01d94b:~$ pwd
|
||||
/home/headless
|
||||
headless@cf4a4e01d94b:~$
|
||||
```
|
||||
|
||||
The container will remove itself.
|
||||
|
||||
## Startup options and help
|
||||
|
||||
The image supports multiple **start-up options** and **start-up modifiers**. There also also two help modes.
|
||||
|
||||
The following container will print out the short help and then it will remove itself:
|
||||
|
||||
```shell
|
||||
docker run --rm accetto/debian-vnc-xfce-chromium-g3:latest --help
|
||||
```
|
||||
|
||||
Example of the short help text:
|
||||
|
||||
```text
|
||||
Container startup script
|
||||
Usage: /dockerstartup/startup.sh [-v|--version] [-h|--help] [-H|--help-usage] [--(no-)wait] [--(no-)skip-startup] [--(no-)tail-null] [--(no-)tail-vnc] [--(no-)version-sticker] [--(no-)version-sticker-verbose] [--(no-)skip-vnc] [--(no-)skip-novnc] [--(no-)debug] [--(no-)verbose] [--] [<command-1>] ... [<command-n>] ...
|
||||
<command>: Optional command with optional arguments. It is executed during startup.
|
||||
-v, --version: Prints version
|
||||
-h, --help: Prints help
|
||||
-H, --help-usage: Extended container usage help.
|
||||
--wait, --no-wait: Default background execution mode (on by default)
|
||||
--skip-startup, --no-skip-startup: Default foreground execution mode (off by default)
|
||||
--tail-null, --no-tail-null: Alternative background execution mode (off by default)
|
||||
--tail-vnc, --no-tail-vnc: Alternative background execution mode (off by default)
|
||||
--version-sticker, --no-version-sticker: Alternative foreground execution mode (off by default)
|
||||
--version-sticker-verbose, --no-version-sticker-verbose: Alternative foreground execution mode (off by default)
|
||||
--skip-vnc, --no-skip-vnc: Startup process modifier (off by default)
|
||||
--skip-novnc, --no-skip-novnc: Startup process modifier (off by default)
|
||||
--debug, --no-debug: Startup process modifier (off by default)
|
||||
--verbose, --no-verbose: Startup process modifier (off by default)
|
||||
|
||||
Use '-H' or '--help-usage' for extended container usage help.
|
||||
For more information visit https://github.com/accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
The following container will print out the long help and then it will remove itself:
|
||||
|
||||
```shell
|
||||
docker run --rm accetto/debian-vnc-xfce-chromium-g3:latest --help-usage
|
||||
```
|
||||
|
||||
Example of the long help text:
|
||||
|
||||
```text
|
||||
CONTAINER USAGE:
|
||||
docker run [<docker-run-options>] accetto/<image>:<tag> [<startup-options>] [<command>]
|
||||
|
||||
POSITIONAL ARGUMENTS:
|
||||
command
|
||||
Optional command with optional arguments.
|
||||
It will be executed during startup before going waiting, tailing or asleep.
|
||||
It is necessary to use the quotes correctly or the 'bash -c "<command>"' pattern.
|
||||
|
||||
STARTUP OPTIONS:
|
||||
|
||||
--wait, or no options, or unknown option, or empty input
|
||||
Default background execution mode.
|
||||
Starts the VNC and noVNC servers, if available, then executes the command
|
||||
and waits until the VNC server process exits or goes asleep infinitely.
|
||||
Container keeps running in the background.
|
||||
|
||||
--skip-startup
|
||||
Default foreground execution mode.
|
||||
Skips the startup procedure, executes the command and exits.
|
||||
Be aware that the container user generator will be also skipped.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--tail-null
|
||||
Alternative background execution mode.
|
||||
Similar to '--wait', but tails the null device instead of going asleep.
|
||||
Container keeps running in the background.
|
||||
|
||||
--tail-vnc
|
||||
Alternative background execution mode.
|
||||
Similar to '--wait', but tails the VNC log instead of waiting until the VNC process exits.
|
||||
Falls back to '--tail-null' if the VNC server has not been started.
|
||||
Container keeps running in the background.
|
||||
|
||||
--version-sticker
|
||||
Alternative foreground execution mode.
|
||||
Prints out the version sticker info.
|
||||
The VNC server is also started by default, if available, because some applications
|
||||
need a display to report their versions correctly. It can be suppressed by providing
|
||||
also '--skip-vnc'. The '--skip-novnc' option is always enforced automatically.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--version-sticker-verbose
|
||||
Alternative foreground execution mode.
|
||||
Similar to '--version-sticker', but prints out the verbose version sticker info and features list.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--skip-vnc
|
||||
Startup process modifier.
|
||||
If VNC and noVNC startup should be skipped.
|
||||
It also enforces '--skip-novnc'.
|
||||
|
||||
--skip-novnc
|
||||
Startup process modifier.
|
||||
If noVNC startup should be skipped.
|
||||
It is also enforced by '--skip-vnc'.
|
||||
|
||||
--debug
|
||||
Startup process modifier.
|
||||
If additional debugging info should be displayed during startup.
|
||||
It also enforces option '--verbose'.
|
||||
|
||||
--verbose
|
||||
Startup process modifier.
|
||||
If startup progress messages should be displayed.
|
||||
It is also enforced by '--debug'.
|
||||
|
||||
--help-usage, -H
|
||||
Prints out this extended container usage help and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
--help, -h
|
||||
Prints out the short startup script help and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
--version, -v
|
||||
Prints out the version of the startup script and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
Use '-h' or '--help' for short startup script help.
|
||||
Fore more information visit https://github.com/accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
## Issues, Wiki and Discussions
|
||||
|
||||
If you have found a problem or you just have a question, please check the [Issues][this-issues] and the [sibling Wiki][sibling-wiki] first. Please do not overlook the closed issues.
|
||||
|
||||
If you do not find a solution, you can file a new issue. The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
If you have a question or an idea and you don't want to open an issue, you can use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
## Credits
|
||||
|
||||
Credit goes to all the countless people and companies, who contribute to open source community and make so many dreamy things real.
|
||||
|
||||
## Diagrams
|
||||
|
||||
The stage diagram doesn't differ from the [sibling project][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
### Dockerfile.xfce
|
||||
The stage diagram doesn't differ from the sibling project [accetto/github-ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
![Dockerfile.xfce stages][sibling-diagram-dockerfile-stages]
|
||||
|
||||
***
|
||||
|
||||
<!-- GitHub project common -->
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-changelog]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/CHANGELOG.md
|
||||
[this-github]: https://github.com/accetto/debian-vnc-xfce-g3/
|
||||
|
||||
[this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues
|
||||
[this-readme-dockerhub]: https://hub.docker.com/r/accetto/debian-vnc-xfce-chromium-g3
|
||||
[this-readme-project]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-builder-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
[this-readme-local-building-example]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-local-building-example.md
|
||||
|
||||
<!-- Docker image specific -->
|
||||
|
||||
[this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-chromium-g3/
|
||||
|
||||
[this-dockerfile]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce
|
||||
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-chromium.jpg
|
||||
|
||||
<!-- Sibling projects -->
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
[sibling-diagram-dockerfile-stages]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/Dockerfile.xfce.png
|
||||
|
||||
[sibling-wiki-version-stickers]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/Concepts-of-dockerfiles
|
||||
|
||||
<!-- Previous generations -->
|
||||
|
||||
[accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess
|
||||
|
||||
<!-- External links -->
|
||||
|
||||
[docker-debian]: https://hub.docker.com/_/debian/
|
||||
[docker-ubuntu]: https://hub.docker.com/_/ubuntu/
|
||||
|
||||
[docker-doc]: https://docs.docker.com/
|
||||
[docker-doc-managing-data]: https://docs.docker.com/storage/
|
||||
|
||||
[debian-packages-search]: https://packages.debian.org/index
|
||||
|
||||
[jq]: https://stedolan.github.io/jq/
|
||||
[mousepad]: https://github.com/codebrainz/mousepad
|
||||
[nano]: https://www.nano-editor.org/
|
||||
[novnc]: https://github.com/kanaka/noVNC
|
||||
[tigervnc]: http://tigervnc.org
|
||||
[tightvnc]: http://www.tightvnc.com
|
||||
[tini]: https://github.com/krallin/tini
|
||||
[xfce]: http://www.xfce.org
|
||||
|
||||
[chromium]: https://www.chromium.org/Home
|
||||
|
||||
<!-- github badges common -->
|
||||
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=release
|
||||
|
||||
[badge-github-release-date]: https://img.shields.io/github/release-date/accetto/debian-vnc-xfce-g3?logo=github
|
||||
|
||||
<!-- docker badges specific -->
|
||||
|
||||
[badge-docker-pulls]: https://badgen.net/docker/pulls/accetto/debian-vnc-xfce-chromium-g3?icon=docker&label=pulls
|
||||
|
||||
[badge-docker-stars]: https://badgen.net/docker/stars/accetto/debian-vnc-xfce-chromium-g3?icon=docker&label=stars
|
||||
|
||||
@@ -2,231 +2,122 @@
|
||||
|
||||
## accetto/debian-vnc-xfce-firefox-g3
|
||||
|
||||
[Docker Hub][this-docker] - [Git Hub][this-github] - [Dockerfile][this-dockerfile] - [Full Readme][this-readme-full] - [Changelog][this-changelog] - [Project Readme][this-readme-project]
|
||||
[User Guide][this-user-guide] - [GitHub][this-github] - [Dockerfile][this-dockerfile] - [Readme][this-readme-full] - [Changelog][this-changelog]
|
||||
|
||||
![badge-docker-pulls][badge-docker-pulls]
|
||||
![badge-docker-stars][badge-docker-stars]
|
||||
![badge-github-release][badge-github-release]
|
||||
![badge-github-release-date][badge-github-release-date]
|
||||
|
||||
***
|
||||
|
||||
- [Headless Debian/Xfce container with VNC/noVNC and Firefox browser](#headless-debianxfce-container-with-vncnovnc-and-firefox-browser)
|
||||
- [accetto/debian-vnc-xfce-firefox-g3](#accettodebian-vnc-xfce-firefox-g3)
|
||||
- [Introduction](#introduction)
|
||||
- [TL;DR](#tldr)
|
||||
- [Installing packages](#installing-packages)
|
||||
- [Shared memory size](#shared-memory-size)
|
||||
- [Extending images](#extending-images)
|
||||
- [Building images](#building-images)
|
||||
- [Sharing devices](#sharing-devices)
|
||||
- [Description](#description)
|
||||
- [Image tags](#image-tags)
|
||||
- [More information](#more-information)
|
||||
This Docker Hub repository contains Docker images for headless working.
|
||||
|
||||
***
|
||||
The images are based on [Debian 11][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client.
|
||||
|
||||
**Warning** about the images with Firefox
|
||||
|
||||
There is no single-process Firefox image in this repository any more and the **multi-process mode** is always enabled. Be aware, that the multi-process mode requires larger shared memory (`/dev/shm`). At least 256MB is recommended. Please check the **Firefox multi-process** page in this older sibling [Wiki][that-wiki-firefox-multiprocess] for more information and the instructions, how to set the shared memory size in different scenarios.
|
||||
|
||||
***
|
||||
|
||||
### Introduction
|
||||
|
||||
This repository contains resources for building Docker images based on [Debian 11][docker-debian] with [Xfce][xfce] desktop environment and [VNC][tigervnc]/[noVNC][novnc] servers for headless use and the current [Firefox][firefox] web browser.
|
||||
The popular web browser [Firefox][firefox] is also included.
|
||||
|
||||
There is also a similar sibling image [accetto/ubuntu-vnc-xfce-firefox-g3][accetto-dockerhub-ubuntu-vnc-xfce-firefox-g3] based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
This is the **short README** version for the **Docker Hub**. There is also the [full-length README][this-readme-full] on the **GitHub**.
|
||||
This [User guide][this-user-guide] describes the images and how to use them.
|
||||
|
||||
### TL;DR
|
||||
The following image tags are regularly built and published on Docker Hub:
|
||||
|
||||
#### Installing packages
|
||||
|
||||
I try to keep the images slim. Consequently you can encounter missing dependencies while adding more applications yourself. You can track the missing libraries on the [Debian Packages Search][debian-packages-search] page and install them subsequently.
|
||||
|
||||
You can also try to fix it by executing the following (the default `sudo` password is **headless**):
|
||||
|
||||
```shell
|
||||
### apt cache needs to be updated only once
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt --fix-broken install
|
||||
```
|
||||
|
||||
#### Shared memory size
|
||||
|
||||
Note that some applications require larger shared memory than the default 64MB. Using 256MB usually solves crashes or strange behavior.
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size.
|
||||
|
||||
#### Extending images
|
||||
|
||||
The provided example file `Dockerfile.extend` shows how to use the images as the base for your own images.
|
||||
|
||||
Your concrete `Dockerfile` may need more statements, but the concept should be clear.
|
||||
|
||||
The compose file `example.yml` shows how to switch to another non-root user and how to set the VNC password and resolution.
|
||||
|
||||
#### Building images
|
||||
|
||||
The fastest way to build the images:
|
||||
|
||||
```shell
|
||||
### PWD = project root
|
||||
### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc')
|
||||
|
||||
### examples of building and publishing the individual images
|
||||
./builder.sh latest-firefox all
|
||||
|
||||
### just building an image, skipping the publishing and the version sticker update
|
||||
./builder.sh latest-firefox build
|
||||
|
||||
### examples of building and publishing the images as a group
|
||||
./ci-builder.sh all group latest-firefox
|
||||
```
|
||||
|
||||
You can still execute the individual hook scripts as before (see the folder `/docker/hooks/`). However, the provided utilities `builder.sh` and `ci-builder.sh` are more convenient. Before pushing the images to the **Docker Hub** you have to prepare and source the file `secrets.rc` (see `example-secrets.rc`). The script `builder.sh` builds the individual images. The script `ci-builder.sh` can build various groups of images or all of them at once. Check the [builder-utility-readme][this-builder-readme], [local-building-example][this-readme-local-building-example] and [sibling Wiki][sibling-wiki] for more information.
|
||||
|
||||
Note that selected features that are enabled by default can be explicitly disabled via environment variables. This allows to build even smaller images by excluding, for example, `noVNC` or `Firefox Plus features`. See the [local-building-example][this-readme-local-building-example] for more information.
|
||||
|
||||
#### Sharing devices
|
||||
|
||||
Sharing the display with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
-e DISPLAY=${DISPLAY} \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-firefox-g3:latest --skip-vnc
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
Sharing the X11 socket with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-firefox-g3:latest
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
### Description
|
||||
|
||||
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].
|
||||
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- utilities **ping**, **wget**, **sudo** (Debian distribution)
|
||||
- current version of JSON processor [jq][jq]
|
||||
- light-weight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding both the container user and the group
|
||||
- support of **version sticker** (see the [full-length README][this-readme-full] on the **GitHub**)
|
||||
- current version of [Firefox ESR (Extended Support Release)][firefox] web browser and some additional **Firefox plus features** described in the [full-length README][this-readme-full] on the GitHub
|
||||
|
||||
The history of notable changes is documented in the [CHANGELOG][this-changelog].
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
### Image tags
|
||||
|
||||
The following image tags are regularly built and published on the **Docker Hub**:
|
||||
<!-- markdownlint-disable MD052 -->
|
||||
|
||||
- `latest` based on `Debian 11`
|
||||
|
||||
![badge_latest_created][badge_latest_created]
|
||||
[![badge_latest_version-sticker][badge_latest_version-sticker]][link_latest_version-sticker-verbose]
|
||||
|
||||
Clicking on the version sticker badge reveals more information about the actual configuration of the image.
|
||||
<!-- markdownlint-enable MD052 -->
|
||||
|
||||
### More information
|
||||
**Hint:** Clicking the version sticker badge reveals more information about the particular build.
|
||||
|
||||
More information about these images can be found in the [full-length README][this-readme-full] file on the GitHub.
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- lightweight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- [sudo][sudo] support
|
||||
- current version of JSON processor [jq][jq]
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding environment variables, VNC parameters, user and group (see [User guide][this-user-guide-using-containers])
|
||||
- support of **version sticker** (see [User guide][this-user-guide-version-sticker])
|
||||
- current version of [Firefox ESR (Extended Support Release)][firefox] web browser and also the additional **Firefox plus** feature (see [User guide][this-user-guide-firefox-plus])
|
||||
|
||||
The following **TCP** ports are exposed by default:
|
||||
|
||||
- **5901** for access over **VNC** (using VNC viewer)
|
||||
- **6901** for access over [noVNC][novnc] (using web browser)
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
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].
|
||||
|
||||
If you've found a problem or you just have a question, please check the [User guide][this-user-guide], [Issues][this-issues] and [sibling Wiki][sibling-wiki] first.
|
||||
Please do not overlook the closed issues.
|
||||
|
||||
If you do not find a solution, you can file a new issue.
|
||||
The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
If you have a question or an idea and you don't want to open an issue, you can also use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
**Remark:** The [GitHub project][this-github] contains image generators that image users generally don’t need, unless they want to build the images themselves.
|
||||
|
||||
***
|
||||
|
||||
<!-- GitHub project common -->
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-user-guide-version-sticker]: https://accetto.github.io/user-guide-g3/version-sticker/
|
||||
|
||||
[this-user-guide-using-containers]: https://accetto.github.io/user-guide-g3/using-containers/
|
||||
|
||||
[this-user-guide-firefox-plus]: https://accetto.github.io/user-guide-g3/firefox-plus/
|
||||
|
||||
[this-changelog]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/CHANGELOG.md
|
||||
|
||||
[this-github]: https://github.com/accetto/debian-vnc-xfce-g3/
|
||||
<!-- [this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues -->
|
||||
|
||||
[this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues
|
||||
|
||||
[this-readme-full]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/xfce-firefox/README.md
|
||||
[this-readme-project]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-builder-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
[this-readme-local-building-example]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-local-building-example.md
|
||||
|
||||
<!-- Docker image specific -->
|
||||
|
||||
[this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-firefox-g3/
|
||||
[this-dockerfile]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce
|
||||
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-firefox-plus.jpg
|
||||
|
||||
<!-- Sibling projects -->
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-firefox-g3-latest.png
|
||||
|
||||
[accetto-dockerhub-ubuntu-vnc-xfce-firefox-g3]: https://hub.docker.com/r/accetto/ubuntu-vnc-xfce-firefox-g3
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
<!-- Previous generations -->
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
[accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess
|
||||
|
||||
<!-- External links -->
|
||||
|
||||
[docker-debian]: https://hub.docker.com/_/debian/
|
||||
[docker-ubuntu]: https://hub.docker.com/_/ubuntu/
|
||||
|
||||
<!-- [docker-doc]: https://docs.docker.com/ -->
|
||||
<!-- [docker-doc-managing-data]: https://docs.docker.com/storage/ -->
|
||||
|
||||
[debian-packages-search]: https://packages.debian.org/index
|
||||
|
||||
[jq]: https://stedolan.github.io/jq/
|
||||
[mousepad]: https://github.com/codebrainz/mousepad
|
||||
[nano]: https://www.nano-editor.org/
|
||||
[novnc]: https://github.com/kanaka/noVNC
|
||||
[sudo]: https://www.sudo.ws/
|
||||
[tigervnc]: http://tigervnc.org
|
||||
[tini]: https://github.com/krallin/tini
|
||||
[xfce]: http://www.xfce.org
|
||||
|
||||
[firefox]: https://www.mozilla.org
|
||||
<!-- [firefox-doc-preferences]: https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences -->
|
||||
|
||||
<!-- github badges common -->
|
||||
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=release
|
||||
|
||||
[badge-github-release-date]: https://img.shields.io/github/release-date/accetto/debian-vnc-xfce-g3?logo=github
|
||||
|
||||
<!-- docker badges specific -->
|
||||
|
||||
[badge-docker-pulls]: https://badgen.net/docker/pulls/accetto/debian-vnc-xfce-firefox-g3?icon=docker&label=pulls
|
||||
|
||||
[badge-docker-stars]: https://badgen.net/docker/stars/accetto/debian-vnc-xfce-firefox-g3?icon=docker&label=stars
|
||||
|
||||
<!-- Appendix -->
|
||||
<!-- Appendix will be added by util-readme.sh -->
|
||||
|
||||
@@ -2,101 +2,21 @@
|
||||
|
||||
## accetto/debian-vnc-xfce-firefox-g3
|
||||
|
||||
[Docker Hub][this-docker] - [Git Hub][this-github] - [Dockerfile][this-dockerfile] - [Docker Readme][this-readme-dockerhub] - [Changelog][this-changelog] - [Project Readme][this-readme-project]
|
||||
|
||||
![badge-docker-pulls][badge-docker-pulls]
|
||||
![badge-docker-stars][badge-docker-stars]
|
||||
![badge-github-release][badge-github-release]
|
||||
![badge-github-release-date][badge-github-release-date]
|
||||
[User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog]
|
||||
|
||||
***
|
||||
|
||||
- [Headless Debian/Xfce container with VNC/noVNC and Firefox browser](#headless-debianxfce-container-with-vncnovnc-and-firefox-browser)
|
||||
- [accetto/debian-vnc-xfce-firefox-g3](#accettodebian-vnc-xfce-firefox-g3)
|
||||
- [Introduction](#introduction)
|
||||
- [TL;DR](#tldr)
|
||||
- [Installing packages](#installing-packages)
|
||||
- [Shared memory size](#shared-memory-size)
|
||||
- [Extending images](#extending-images)
|
||||
- [Building images](#building-images)
|
||||
- [Sharing devices](#sharing-devices)
|
||||
- [Description](#description)
|
||||
- [Image tags](#image-tags)
|
||||
- [Ports](#ports)
|
||||
- [Volumes](#volumes)
|
||||
- [Version sticker](#version-sticker)
|
||||
- [Using headless containers](#using-headless-containers)
|
||||
- [Overriding environment variables](#overriding-environment-variables)
|
||||
- [Overriding VNC/noVNC parameters](#overriding-vncnovnc-parameters)
|
||||
- [Container user account](#container-user-account)
|
||||
- [Overriding container user parameters](#overriding-container-user-parameters)
|
||||
- [Overriding user parameters in build-time](#overriding-user-parameters-in-build-time)
|
||||
- [Overriding user parameters in run-time](#overriding-user-parameters-in-run-time)
|
||||
- [User permissions and ownership](#user-permissions-and-ownership)
|
||||
- [Other considerations](#other-considerations)
|
||||
- [Running containers in background (detached)](#running-containers-in-background-detached)
|
||||
- [Running containers in foreground (interactively)](#running-containers-in-foreground-interactively)
|
||||
- [Firefox multi-process](#firefox-multi-process)
|
||||
- [Setting shared memory size](#setting-shared-memory-size)
|
||||
- [Firefox preferences and the plus features](#firefox-preferences-and-the-plus-features)
|
||||
- [Startup options and help](#startup-options-and-help)
|
||||
- [Issues, Wiki and Discussions](#issues-wiki-and-discussions)
|
||||
- [Credits](#credits)
|
||||
- [Diagrams](#diagrams)
|
||||
- [Dockerfile.xfce](#dockerfilexfce)
|
||||
This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-firefox-g3][this-docker].
|
||||
|
||||
***
|
||||
There is also a sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
**Warning** about the images with Firefox
|
||||
This [User guide][this-user-guide] describes the images and how to use them.
|
||||
|
||||
There is no single-process Firefox image in this repository any more and the **multi-process mode** is always enabled. Be aware, that the multi-process mode requires larger shared memory (`/dev/shm`). At least 256MB is recommended. Please check the **Firefox multi-process** page in this older sibling [Wiki][that-wiki-firefox-multiprocess] for more information and the instructions, how to set the shared memory size in different scenarios.
|
||||
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].
|
||||
|
||||
***
|
||||
|
||||
### Introduction
|
||||
|
||||
This repository contains resources for building Docker images based on [Debian 11][docker-debian] with [Xfce][xfce] desktop environment and [VNC][tigervnc]/[noVNC][novnc] servers for headless use and the current [Firefox][firefox] web browser.
|
||||
|
||||
There is also the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
### TL;DR
|
||||
|
||||
#### Installing packages
|
||||
|
||||
I try to keep the images slim. Consequently you can encounter missing dependencies while adding more applications yourself. You can track the missing libraries on the [Debian Packages Search][debian-packages-search] page and install them subsequently.
|
||||
|
||||
You can also try to fix it by executing the following (the default `sudo` password is **headless**):
|
||||
|
||||
```shell
|
||||
### apt cache needs to be updated only once
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt --fix-broken install
|
||||
```
|
||||
|
||||
#### Shared memory size
|
||||
|
||||
Note that some applications require larger shared memory than the default 64MB. Using 256MB usually solves crashes or strange behavior.
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size.
|
||||
|
||||
#### Extending images
|
||||
|
||||
The provided example file `Dockerfile.extend` shows how to use the images as the base for your own images.
|
||||
|
||||
Your concrete `Dockerfile` may need more statements, but the concept should be clear.
|
||||
|
||||
The compose file `example.yml` shows how to switch to another non-root user and how to set the VNC password and resolution.
|
||||
|
||||
#### Building images
|
||||
|
||||
The fastest way to build the images:
|
||||
### Building images
|
||||
|
||||
```shell
|
||||
### PWD = project root
|
||||
@@ -112,634 +32,52 @@ The fastest way to build the images:
|
||||
./ci-builder.sh all group latest-firefox
|
||||
```
|
||||
|
||||
You can still execute the individual hook scripts as before (see the folder `/docker/hooks/`). However, the provided utilities `builder.sh` and `ci-builder.sh` are more convenient. Before pushing the images to the **Docker Hub** you have to prepare and source the file `secrets.rc` (see `example-secrets.rc`). The script `builder.sh` builds the individual images. The script `ci-builder.sh` can build various groups of images or all of them at once. Check the [builder-utility-readme][this-builder-readme], [local-building-example][this-readme-local-building-example] and [sibling Wiki][sibling-wiki] for more information.
|
||||
Refer to the main [README][this-readme] file for more information about the building subject.
|
||||
|
||||
Note that selected features that are enabled by default can be explicitly disabled via environment variables. This allows to build even smaller images by excluding, for example, `noVNC` or `Firefox Plus features`. See the [local-building-example][this-readme-local-building-example] for more information.
|
||||
### Getting help
|
||||
|
||||
#### Sharing devices
|
||||
If you've found a problem or you just have a question, please check the [User guide][this-user-guide], [Issues][this-issues] and [sibling Wiki][sibling-wiki] first.
|
||||
Please do not overlook the closed issues.
|
||||
|
||||
Sharing the display with the host works only on Linux:
|
||||
If you do not find a solution, you can file a new issue.
|
||||
The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
If you have a question or an idea and you don't want to open an issue, you can also use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
docker run -it -P --rm \
|
||||
-e DISPLAY=${DISPLAY} \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-firefox-g3:latest --skip-vnc
|
||||
### Diagrams
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
Diagram of the multi-staged Dockerfile used for building multiple images.
|
||||
|
||||
Sharing the X11 socket with the host works only on Linux:
|
||||
The actual content of a particular image build is controlled by the *feature variables*.
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-firefox-g3:latest
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
### Description
|
||||
|
||||
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].
|
||||
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- utilities **ping**, **wget**, **sudo** (Debian distribution)
|
||||
- current version of JSON processor [jq][jq]
|
||||
- light-weight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding both the container user and the group
|
||||
- support of **version sticker** (see below)
|
||||
- current version of [Firefox ESR (Extended Support Release)][firefox] web browser and some additional **Firefox plus features** described below
|
||||
|
||||
The history of notable changes is documented in the [CHANGELOG][this-changelog].
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
### Image tags
|
||||
|
||||
The following image tags are regularly built and published on the **Docker Hub**:
|
||||
|
||||
- `latest` based on `Debian 11`
|
||||
|
||||
Clicking on the version sticker badge in the [README on Docker Hub][this-readme-dockerhub] reveals more information about the actual configuration of the image.
|
||||
|
||||
### Ports
|
||||
|
||||
Following **TCP** ports are exposed by default:
|
||||
|
||||
- **5901** is used for access over **VNC**
|
||||
- **6901** is used for access over [noVNC][novnc]
|
||||
|
||||
These default ports and also some other parameters can be overridden several ways (see bellow).
|
||||
|
||||
### Volumes
|
||||
|
||||
The containers do not create or use any external volumes by default.
|
||||
|
||||
Both **named volumes** and **bind mounts** can be used. More about volumes can be found in [Docker documentation][docker-doc] (e.g. [Manage data in Docker][docker-doc-managing-data]).
|
||||
|
||||
### Version sticker
|
||||
|
||||
Version sticker serves multiple purposes that are closer described in the [sibling Wiki][sibling-wiki-version-stickers]. Note that the usage of the version sticker has changed between the generations of images.
|
||||
|
||||
The **short version sticker value** describes the version of the image and it is persisted in its **label** during the build-time. It is also shown as its **badge** in the README file.
|
||||
|
||||
The **verbose version sticker value** is used by the CI builder to decide if the image needs to be refreshed. It describes the actual configuration of the essential components of the image. It can be revealed by clicking on the version sticker badge in the README file.
|
||||
|
||||
The version sticker values are generated by the script `version_sticker.sh`, which is deployed into the startup directory `/dockerstartup`. The script will show a short help if executed with the argument `-h`. There is also a convenient `Version Sticker` launcher on the container desktop.
|
||||
|
||||
## Using headless containers
|
||||
|
||||
There are two ways, how to use the containers created from this image.
|
||||
|
||||
All containers are accessible by a VNC viewer (e.g. [TigerVNC][tigervnc] or [TightVNC][tightvnc]).
|
||||
|
||||
The default `VNC_PORT` value is `5901`. The default `DISPLAY` value is `:1`. The default VNC password (`VNC_PW`) is `headless`.
|
||||
|
||||
The containers that are created from the images built with the **noVNC feature** can be also accessed over [noVNC][noVNC] by any web browser supporting HTML5.
|
||||
|
||||
The default `NOVNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.
|
||||
|
||||
There are several ways of connecting to headless containers and the possibilities also differ between the Linux and Windows environments, but usually it is done by mapping the VNC/noVNC ports exposed by the container to some free TCP ports on its host system.
|
||||
|
||||
For example, the following command would map the VNC/noVNC ports `5901/6901` of the container to the TCP ports `25901/26901` on the host:
|
||||
|
||||
```shell
|
||||
docker run -p 25901:5901 -p 26901:6901 ...
|
||||
```
|
||||
|
||||
If the container would run on the local computer, then it would be accessible over **VNC** as `localhost:25901` and over **noVNC** as `http://localhost:26901`.
|
||||
|
||||
If it would run on the remote server `mynas`, then it would be accessible over **VNC** as `mynas:25901` and over **noVNC** as `http://mynas:26901`.
|
||||
|
||||
The image offers two [noVNC][novnc] clients - **lite client** and **full client**. Because the connection URL differs slightly in both cases, the container provides a **simple startup page**.
|
||||
|
||||
The startup page offers two hyperlinks for both noVNC clients:
|
||||
|
||||
- **noVNC Lite Client** (`http://mynas:26901/vnc_lite.html`)
|
||||
- **noVNC Full Client** (`http://mynas:26901/vnc.html`)
|
||||
|
||||
It is also possible to provide the password through the links:
|
||||
|
||||
- `http://mynas:26901/vnc_lite.html?password=headless`
|
||||
- `http://mynas:26901/vnc.html?password=headless`
|
||||
|
||||
### Overriding environment variables
|
||||
|
||||
If the environment variable `FEATURES_OVERRIDING_ENVV=1`, which is the case by default, then the container startup script will look for the file `$HOME/.override/.override_envv.rc` and source all the lines that begin with the string 'export ' at the first position and contain the '=' character.
|
||||
|
||||
You can provide the overriding file from outside the container using *bind mounts* or *volumes*.
|
||||
|
||||
This feature allows overriding or adding environment variables at the **container startup-time**.
|
||||
It means, even after the container has already been created.
|
||||
|
||||
You can disable this behavior by setting the variable `FEATURES_OVERRIDING_ENVV` to zero when the container is created or the image is built.
|
||||
|
||||
The lines that have been actually sourced can be reported into the container's log if the startup parameter `--verbose` or `--debug` is provided.
|
||||
|
||||
Look below for the example how to override the VNC/noVNC parameters at the container startup-time.
|
||||
|
||||
### Overriding VNC/noVNC parameters
|
||||
|
||||
The VNC/noVNC parameters are controlled by related environment variables embedded into the image.
|
||||
|
||||
They have the following default values:
|
||||
|
||||
```shell
|
||||
DISPLAY=:1
|
||||
NOVNC_PORT=6901
|
||||
VNC_COL_DEPTH=24
|
||||
VNC_PORT=5901
|
||||
VNC_PW=headless
|
||||
VNC_RESOLUTION=1360x768
|
||||
VNC_VIEW_ONLY=false
|
||||
```
|
||||
|
||||
These environment variables can be overridden several ways.
|
||||
|
||||
**At image build-time** you can embed different default values by using the following build arguments:
|
||||
|
||||
- `ARG_VNC_PW` sets the variable `VNC_PW` (VNV/noVNC password)
|
||||
- `ARG_VNC_DISPLAY` sets the variable `DISPLAY`
|
||||
- `ARG_VNC_PORT` sets the variable `VNC_PORT`
|
||||
- `ARG_VNC_RESOLUTION` sets the variable `VNC_RESOLUTION`
|
||||
- `ARG_VNC_COL_DEPTH` sets the variable `VNC_COL_DEPTH`
|
||||
- `ARG_VNC_VIEW_ONLY` set the variable `VNC_VIEW_ONLY`
|
||||
- `ARG_NOVNC_PORT` sets the variable `NOVNC_PORT`
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker build --build-arg DISPLAY=:2 --build-arg ARG_VNC_PORT=6902 ...
|
||||
```
|
||||
|
||||
**At container creation-time** you can override the environment variable values by using the `docker run -e` option. Please note that in this case you have to use the actual environment variable names, not the build argument names (e.g. `VNC_PORT` instead of `ARG_VNC_PORT`).
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker run -e VNC_PORT=6902 ...
|
||||
```
|
||||
|
||||
**At container startup-time** you can override the VNC/noVNC variables using the feature `FEATURES_OVERRIDING_ENVV' described above.
|
||||
|
||||
For example, the following command would bind the file `my_own_vnc_parameters.rc` from the directory `/home/joe` to the container:
|
||||
|
||||
```shell
|
||||
docker run -v /home/joe/my_own_vnc_parameters.rc:/home/headless/.override/.override_envv.rc
|
||||
```
|
||||
|
||||
The content of the file should be similar to the provided example file `example-override-envv.rc`:
|
||||
|
||||
```shell
|
||||
### only the lines beginning with 'export ' at the first position and containing '=' will be sourced
|
||||
export VNC_RESOLUTION=1024x768
|
||||
export VNC_PW=secret
|
||||
#export DISPLAY=:2
|
||||
#export VNC_COL_DEPTH=32
|
||||
```
|
||||
|
||||
Please note that only the lines beginning with the string 'export ' at the first position and containing the '=' character will be imported.
|
||||
|
||||
By providing the variable values the following rules apply:
|
||||
|
||||
- The value of `ARG_VNC_DISPLAY/VNC_DISPLAY` should include also the leading colon (e.g. `:1`).
|
||||
- The value of `ARG_VNC_PW/VNC_PW` can be empty. It effectively disables the VNC/noVNC password.
|
||||
|
||||
If you want to check, what parameter values have been actually applied, then you can start the container with the parameter `--debug`.
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker run -it -P --rm accetto/debian-vnc-xfce-g3:latest --debug
|
||||
|
||||
### output (excerpt)
|
||||
VNC server started on display ':1' and TCP port '5901'
|
||||
Connect via VNC viewer with 172.17.0.3:5901
|
||||
noVNC started on TCP port '6901'
|
||||
```
|
||||
|
||||
You should be aware, that overriding the VNC/noVNC parameters incorrectly could prevent the container from starting.
|
||||
|
||||
This feature assumes some preliminary knowledge and it is provided for advanced users that already know what they want to achieve.
|
||||
|
||||
For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NOVNC_PORT = 6900 + DISPLAY`).
|
||||
|
||||
You may decide not to follow the conventions. This image allows you to set the parameters differently, but again, you should know, what you are doing.
|
||||
|
||||
Be also aware, that there are differences between the Linux and Windows environments.
|
||||
|
||||
If your session disconnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the **NOVNC_HEARTBEAT=XX** environment variable at startup-time, where **XX** is the number of seconds between [websocket ping/pong](https://github.com/websockets/ws/issues/977) packets.
|
||||
|
||||
## Container user account
|
||||
|
||||
Containers created from this image run under the **application user** (by default `headless:headless`, `1000:1000`), which is a **non-root** user account. However, the application user gets permissions for `sudo`.
|
||||
|
||||
The **application user name** also defines the **home directory name**, which is by default `/home/headless`.
|
||||
|
||||
The default application user's password is `headless`, which is also the default `sudo` password.
|
||||
|
||||
The user's (and `sudo`) password can be changed inside the container by using the `passwd` command. For example, changing the password to `docker`:
|
||||
|
||||
```shell
|
||||
echo 'headless:docker' | sudo chpasswd
|
||||
|
||||
### or also
|
||||
sudo chpasswd <<<"headless:docker"
|
||||
```
|
||||
|
||||
The `sudo` command allows user elevation, so the **application user** can install additional software inside the container.
|
||||
|
||||
The following example shows how to install **vim**:
|
||||
|
||||
```shell
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y vim
|
||||
```
|
||||
|
||||
### Overriding container user parameters
|
||||
|
||||
The user ID, user name, user group ID, user group name and the initial `sudo` password can be overridden during the build time (`docker build`).
|
||||
|
||||
The user ID and the group ID can be overridden also in run time (`docker run`).
|
||||
|
||||
#### Overriding user parameters in build-time
|
||||
|
||||
The build parameters `ARG_HEADLESS_USER_ID`, `ARG_HEADLESS_USER_NAME`, `ARG_HEADLESS_USER_GROUP_ID` and `ARG_HEADLESS_USER_GROUP_NAME` are used during the build time (`docker build`) and they allow to override the related container parameters.
|
||||
|
||||
Their values are persisted in the corresponding environment variables `HEADLESS_USER_ID`, `HEADLESS_USER_NAME`, `HEADLESS_USER_GROUP_ID` and `HEADLESS_USER_GROUP_NAME`.
|
||||
|
||||
The build argument `ARG_SUDO_INITIAL_PW` allows overriding the initial application user's and `sudo` password (which is `headless`). This initial password is not stored into any environment variable, but into a temporary file, which is removed on the first container start. The password can be changed inside the container.
|
||||
|
||||
For example, building an image with the application user name `hairless`, with the primary user group `hairygroup`, the IDs `2002:3003` and the initial password `docker`:
|
||||
|
||||
```shell
|
||||
docker build --build-arg ARG_HEADLESS_USER_NAME=hairless --build-arg ARG_HEADLESS_USER_GROUP_NAME=hairygroup --build-arg ARG_HEADLESS_USER_ID=2002 --build-arg ARG_HEADLESS_USER_GROUP_ID=3003 --build-arg ARG_SUDO_INITIAL_PW=docker ... -t my/image:overriden
|
||||
```
|
||||
|
||||
#### Overriding user parameters in run-time
|
||||
|
||||
Both the user ID and group ID can be overridden also in the run time (`docker run`). It does not apply to the application user name, the group name and the initial password.
|
||||
|
||||
For example, this would override the `user:group` by `2000:3000`:
|
||||
|
||||
```shell
|
||||
docker run --user 2000:3000 ... my/image:overriden
|
||||
```
|
||||
|
||||
#### User permissions and ownership
|
||||
|
||||
The actual application user account and the user group are created by the startup script on the first container start.
|
||||
|
||||
During this one-time task the startup script needs to modify the container files `/etc/passwd` and `/etc/group`. That is why there is the line `chmod 666 /etc/passwd /etc/group` in the Dockerfile (see the `stage_final`). However, the permissions of these two files will be set to the standard value `644` just after creating the user.
|
||||
|
||||
The created user gets permissions for `sudo` and the ownership to the content of the home and startup folders.
|
||||
|
||||
The temporary file `${STARTUPDIR}/.initial_sudo_password` is cleared after creating the user.
|
||||
|
||||
However, note that the initial `sudo` password will still be persisted in the image history. You have to change it inside the container, if you want to keep it really secret.
|
||||
|
||||
There is the test script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
|
||||
#### Other considerations
|
||||
|
||||
Please note that the described configuration will not be done if the startup script `startup.sh` will not be executed.
|
||||
|
||||
Also do not confuse the application user's password with the **VNC password**, because they both have the same default value (`headless`).
|
||||
|
||||
## Running containers in background (detached)
|
||||
|
||||
The following container will keep running in the background and it will listen on an automatically selected TCP port on the host computer:
|
||||
|
||||
```shell
|
||||
docker run -d -P accetto/debian-vnc-xfce-firefox-g3:latest
|
||||
```
|
||||
|
||||
The following container will listen on the host's TCP port **25901**:
|
||||
|
||||
```shell
|
||||
docker run -d -p 25901:5901 accetto/debian-vnc-xfce-firefox-g3:latest
|
||||
```
|
||||
|
||||
The following container will create (or re-use) the local named volume **my\_Downloads** mounted as `/home/headless/Downloads`:
|
||||
|
||||
```shell
|
||||
docker run -d -P -v my_Downloads:/home/headless/Downloads accetto/debian-vnc-xfce-firefox-g3:latest
|
||||
```
|
||||
|
||||
or using the newer syntax with **--mount** flag:
|
||||
|
||||
```shell
|
||||
docker run -d -P --mount source=my_Downloads,target=/home/headless/Downloads accetto/debian-vnc-xfce-firefox-g3:latest
|
||||
```
|
||||
|
||||
## Running containers in foreground (interactively)
|
||||
|
||||
The following container can be used interactively:
|
||||
|
||||
```shell
|
||||
docker run -it --rm accetto/debian-vnc-xfce-firefox-g3:latest bash
|
||||
```
|
||||
|
||||
The opened `bash` session can be used as usual and then closed by entering `^C` (CTRL-C):
|
||||
|
||||
```shell
|
||||
To run a command as administrator (user "root"), use "sudo <command>".
|
||||
See "man sudo_root" for details.
|
||||
|
||||
headless@cf4a4e01d94b:~$ whoami
|
||||
headless
|
||||
headless@cf4a4e01d94b:~$ pwd
|
||||
/home/headless
|
||||
headless@cf4a4e01d94b:~$
|
||||
```
|
||||
|
||||
The container will remove itself.
|
||||
|
||||
## Firefox multi-process
|
||||
|
||||
Firefox multi-process (also known as **Electrolysis** or just **E10S**) can cause heavy crashing in Docker containers if there is not enough shared memory (**Gah. Your tab just crashed.**).
|
||||
|
||||
In Firefox versions till **76.0.1** it has been possible to disable multi-process by setting the environment variable **MOZ_FORCE_DISABLE_E10S**. However, in Firefox **77.0.1** it has caused ugly scrambling of almost all web pages, because they were not decompressed.
|
||||
|
||||
Mozilla has fixed the problem in the next release, but they warned about not supporting the switch in the future. That is why I've decided, that all images with Firefox will use multi-process by default, even if it requires larger shared memory. On the positive side, performance should be higher and Internet browsing should be sand-boxed.
|
||||
|
||||
Please check the older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] for more information and the instructions, how the shared memory size can be set in different scenarios.
|
||||
|
||||
### Setting shared memory size
|
||||
|
||||
Instability of multi-process Firefox is caused by setting the shared memory size too low. Docker assigns only **64MB** by default. Testing on my computers has shown, that using at least **256MB** completely eliminates the problem. However, it could be different on your system.
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size. It's really simple, if you need it for a single container started from the command line.
|
||||
|
||||
For example, the following container will have its shared memory size set to 256MB:
|
||||
|
||||
```shell
|
||||
docker run -d -P --shm-size=256m accetto/debian-vnc-xfce-firefox-g3:latest
|
||||
```
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
## Firefox preferences and the plus features
|
||||
|
||||
Firefox browser supports pre-configuration of user preferences.
|
||||
|
||||
Users can enforce their personal browser preferences if they put them into the `user.js` file and then copy it into the Firefox profile folder. The provided **plus** features make it really easy.
|
||||
|
||||
There is the `/home/headless/firefox.plus` folder containing the `user.js` file and the helper utility `copy_firefox_user_preferences.sh`. It will copy the `user.js` file into one or more existing Firefox profiles. The utility is easy to use, because it is interactive and it will also display the help, if started with the `-h` or `--help` argument.
|
||||
|
||||
To make it even more convenient, there are also desktop launchers for the utility and for the **Firefox Profile Manager**.
|
||||
|
||||
Recommended procedure for taking advantage of the **plus** features is:
|
||||
|
||||
- Start the **Firefox Profile Manager** using the desktop launcher **FF Profile Manager**. Create a new Firefox profile if there is none or you want to add one more. Wait until the profile is created and then start Firefox with it. Starting Firefox is required to create the actual profile content.
|
||||
|
||||
**Hint**: You can also check the **Work offline** check-box before creating the profile.
|
||||
|
||||
The Firefox profiles are created inside the `/home/headless/.mozilla/firefox` folder by default. Note that the `.mozilla` folder is hidden.
|
||||
|
||||
Close the **Profile Manager** by pushing the **Exit** button.
|
||||
|
||||
- Put your personal Firefox preferences into the `user.js` file which is in the `/home/headless/firefox.plus`folder. Check the Firefox documentation (e.g. [Firefox preferences][firefox-doc-preferences]) for more information about the syntax.
|
||||
|
||||
**Hint**: There is also another way. You can first start Firefox, configure it and then copy the content of the `prefs.js` file from the Firefox profile folder into the `user.js` file. Then you can check the content and to keep only the preferences you really want to enforce. It's not a quick task, but you have to do it only once or until you need an update.
|
||||
|
||||
- Start the helper utility using the desktop launcher **Copy FF Preferences**. The utility will allow you to copy the `user.js` file to any of the existing Firefox profiles.
|
||||
|
||||
**Hint**: You preferences will be enforced until you delete the `user.js` file from the Firefox profile folder.
|
||||
|
||||
It is also very easy to build customized images with pre-filled `user.js` files.
|
||||
|
||||
## Startup options and help
|
||||
|
||||
The image supports multiple **start-up options** and **start-up modifiers**. There also also two help modes.
|
||||
|
||||
The following container will print out the short help and then it will remove itself:
|
||||
|
||||
```shell
|
||||
docker run --rm accetto/debian-vnc-xfce-firefox-g3:latest --help
|
||||
```
|
||||
|
||||
Example of the short help text:
|
||||
|
||||
```text
|
||||
Container startup script
|
||||
Usage: /dockerstartup/startup.sh [-v|--version] [-h|--help] [-H|--help-usage] [--(no-)wait] [--(no-)skip-startup] [--(no-)tail-null] [--(no-)tail-vnc] [--(no-)version-sticker] [--(no-)version-sticker-verbose] [--(no-)skip-vnc] [--(no-)skip-novnc] [--(no-)debug] [--(no-)verbose] [--] [<command-1>] ... [<command-n>] ...
|
||||
<command>: Optional command with optional arguments. It is executed during startup.
|
||||
-v, --version: Prints version
|
||||
-h, --help: Prints help
|
||||
-H, --help-usage: Extended container usage help.
|
||||
--wait, --no-wait: Default background execution mode (on by default)
|
||||
--skip-startup, --no-skip-startup: Default foreground execution mode (off by default)
|
||||
--tail-null, --no-tail-null: Alternative background execution mode (off by default)
|
||||
--tail-vnc, --no-tail-vnc: Alternative background execution mode (off by default)
|
||||
--version-sticker, --no-version-sticker: Alternative foreground execution mode (off by default)
|
||||
--version-sticker-verbose, --no-version-sticker-verbose: Alternative foreground execution mode (off by default)
|
||||
--skip-vnc, --no-skip-vnc: Startup process modifier (off by default)
|
||||
--skip-novnc, --no-skip-novnc: Startup process modifier (off by default)
|
||||
--debug, --no-debug: Startup process modifier (off by default)
|
||||
--verbose, --no-verbose: Startup process modifier (off by default)
|
||||
|
||||
Use '-H' or '--help-usage' for extended container usage help.
|
||||
For more information visit https://github.com/accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
The following container will print out the long help and then it will remove itself:
|
||||
|
||||
```shell
|
||||
docker run --rm accetto/debian-vnc-xfce-firefox-g3:latest --help-usage
|
||||
```
|
||||
|
||||
Example of the long help text:
|
||||
|
||||
```text
|
||||
CONTAINER USAGE:
|
||||
docker run [<docker-run-options>] accetto/<image>:<tag> [<startup-options>] [<command>]
|
||||
|
||||
POSITIONAL ARGUMENTS:
|
||||
command
|
||||
Optional command with optional arguments.
|
||||
It will be executed during startup before going waiting, tailing or asleep.
|
||||
It is necessary to use the quotes correctly or the 'bash -c "<command>"' pattern.
|
||||
|
||||
STARTUP OPTIONS:
|
||||
|
||||
--wait, or no options, or unknown option, or empty input
|
||||
Default background execution mode.
|
||||
Starts the VNC and noVNC servers, if available, then executes the command
|
||||
and waits until the VNC server process exits or goes asleep infinitely.
|
||||
Container keeps running in the background.
|
||||
|
||||
--skip-startup
|
||||
Default foreground execution mode.
|
||||
Skips the startup procedure, executes the command and exits.
|
||||
Be aware that the container user generator will be also skipped.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--tail-null
|
||||
Alternative background execution mode.
|
||||
Similar to '--wait', but tails the null device instead of going asleep.
|
||||
Container keeps running in the background.
|
||||
|
||||
--tail-vnc
|
||||
Alternative background execution mode.
|
||||
Similar to '--wait', but tails the VNC log instead of waiting until the VNC process exits.
|
||||
Falls back to '--tail-null' if the VNC server has not been started.
|
||||
Container keeps running in the background.
|
||||
|
||||
--version-sticker
|
||||
Alternative foreground execution mode.
|
||||
Prints out the version sticker info.
|
||||
The VNC server is also started by default, if available, because some applications
|
||||
need a display to report their versions correctly. It can be suppressed by providing
|
||||
also '--skip-vnc'. The '--skip-novnc' option is always enforced automatically.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--version-sticker-verbose
|
||||
Alternative foreground execution mode.
|
||||
Similar to '--version-sticker', but prints out the verbose version sticker info and features list.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--skip-vnc
|
||||
Startup process modifier.
|
||||
If VNC and noVNC startup should be skipped.
|
||||
It also enforces '--skip-novnc'.
|
||||
|
||||
--skip-novnc
|
||||
Startup process modifier.
|
||||
If noVNC startup should be skipped.
|
||||
It is also enforced by '--skip-vnc'.
|
||||
|
||||
--debug
|
||||
Startup process modifier.
|
||||
If additional debugging info should be displayed during startup.
|
||||
It also enforces option '--verbose'.
|
||||
|
||||
--verbose
|
||||
Startup process modifier.
|
||||
If startup progress messages should be displayed.
|
||||
It is also enforced by '--debug'.
|
||||
|
||||
--help-usage, -H
|
||||
Prints out this extended container usage help and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
--help, -h
|
||||
Prints out the short startup script help and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
--version, -v
|
||||
Prints out the version of the startup script and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
Use '-h' or '--help' for short startup script help.
|
||||
Fore more information visit https://github.com/accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
## Issues, Wiki and Discussions
|
||||
|
||||
If you have found a problem or you just have a question, please check the [Issues][this-issues] and the [sibling Wiki][sibling-wiki] first. Please do not overlook the closed issues.
|
||||
|
||||
If you do not find a solution, you can file a new issue. The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
If you have a question or an idea and you don't want to open an issue, you can use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
## Credits
|
||||
|
||||
Credit goes to all the countless people and companies, who contribute to open source community and make so many dreamy things real.
|
||||
|
||||
## Diagrams
|
||||
|
||||
The stage diagram doesn't differ from the [sibling project][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
### Dockerfile.xfce
|
||||
The stage diagram doesn't differ from the sibling project [accetto/github-ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
![Dockerfile.xfce stages][sibling-diagram-dockerfile-stages]
|
||||
|
||||
***
|
||||
|
||||
<!-- GitHub project common -->
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-changelog]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/CHANGELOG.md
|
||||
[this-github]: https://github.com/accetto/debian-vnc-xfce-g3/
|
||||
|
||||
[this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues
|
||||
[this-readme-dockerhub]: https://hub.docker.com/r/accetto/debian-vnc-xfce-firefox-g3
|
||||
[this-readme-project]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-builder-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
[this-readme-local-building-example]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-local-building-example.md
|
||||
|
||||
<!-- Docker image specific -->
|
||||
|
||||
[this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-firefox-g3/
|
||||
|
||||
[this-dockerfile]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce
|
||||
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-firefox-plus.jpg
|
||||
|
||||
<!-- Sibling projects -->
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
[sibling-diagram-dockerfile-stages]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/Dockerfile.xfce.png
|
||||
|
||||
[sibling-wiki-version-stickers]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/Concepts-of-dockerfiles
|
||||
|
||||
<!-- Previous generations -->
|
||||
|
||||
[accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess
|
||||
|
||||
<!-- External links -->
|
||||
|
||||
[docker-debian]: https://hub.docker.com/_/debian/
|
||||
[docker-ubuntu]: https://hub.docker.com/_/ubuntu/
|
||||
|
||||
[docker-doc]: https://docs.docker.com/
|
||||
[docker-doc-managing-data]: https://docs.docker.com/storage/
|
||||
|
||||
[debian-packages-search]: https://packages.debian.org/index
|
||||
|
||||
[jq]: https://stedolan.github.io/jq/
|
||||
[mousepad]: https://github.com/codebrainz/mousepad
|
||||
[nano]: https://www.nano-editor.org/
|
||||
[novnc]: https://github.com/kanaka/noVNC
|
||||
[tigervnc]: http://tigervnc.org
|
||||
[tightvnc]: http://www.tightvnc.com
|
||||
[tini]: https://github.com/krallin/tini
|
||||
[xfce]: http://www.xfce.org
|
||||
|
||||
[firefox]: https://www.mozilla.org
|
||||
[firefox-doc-preferences]: https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences
|
||||
|
||||
<!-- github badges common -->
|
||||
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=release
|
||||
|
||||
[badge-github-release-date]: https://img.shields.io/github/release-date/accetto/debian-vnc-xfce-g3?logo=github
|
||||
|
||||
<!-- docker badges specific -->
|
||||
|
||||
[badge-docker-pulls]: https://badgen.net/docker/pulls/accetto/debian-vnc-xfce-firefox-g3?icon=docker&label=pulls
|
||||
|
||||
[badge-docker-stars]: https://badgen.net/docker/stars/accetto/debian-vnc-xfce-firefox-g3?icon=docker&label=stars
|
||||
|
||||
@@ -2,221 +2,115 @@
|
||||
|
||||
## accetto/debian-vnc-xfce-g3
|
||||
|
||||
[Docker Hub][this-docker] - [Git Hub][this-github] - [Dockerfile][this-dockerfile] - [Full Readme][this-readme-full] - [Changelog][this-changelog] - [Project Readme][this-readme-project]
|
||||
[User Guide][this-user-guide] - [GitHub][this-github] - [Dockerfile][this-dockerfile] - [Readme][this-readme-full] - [Changelog][this-changelog]
|
||||
|
||||
![badge-docker-pulls][badge-docker-pulls]
|
||||
![badge-docker-stars][badge-docker-stars]
|
||||
![badge-github-release][badge-github-release]
|
||||
![badge-github-release-date][badge-github-release-date]
|
||||
|
||||
***
|
||||
|
||||
- [Headless Debian/Xfce container with VNC/noVNC](#headless-debianxfce-container-with-vncnovnc)
|
||||
- [accetto/debian-vnc-xfce-g3](#accettodebian-vnc-xfce-g3)
|
||||
- [Introduction](#introduction)
|
||||
- [TL;DR](#tldr)
|
||||
- [Installing packages](#installing-packages)
|
||||
- [Shared memory size](#shared-memory-size)
|
||||
- [Extending images](#extending-images)
|
||||
- [Building images](#building-images)
|
||||
- [Sharing devices](#sharing-devices)
|
||||
- [Description](#description)
|
||||
- [Image tags](#image-tags)
|
||||
- [More information](#more-information)
|
||||
This Docker Hub repository contains Docker images for headless working.
|
||||
|
||||
***
|
||||
The images are based on [Debian 11][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client.
|
||||
|
||||
### Introduction
|
||||
There is also a similar sibling repository [accetto/ubuntu-vnc-xfce-g3][accetto-dockerhub-ubuntu-vnc-xfce-g3], containing images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
This repository contains resources for building Docker images based on [Debian 11][docker-debian] with [Xfce][xfce] desktop environment and [VNC][tigervnc]/[noVNC][novnc] servers for headless use.
|
||||
This [User guide][this-user-guide] describes the images and how to use them.
|
||||
|
||||
There is also a similar sibling image [accetto/ubuntu-vnc-xfce-g3][accetto-dockerhub-ubuntu-vnc-xfce-g3] based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
The following image tags are regularly built and published on Docker Hub:
|
||||
|
||||
This is the **short README** version for the **Docker Hub**. There is also the [full-length README][this-readme-full] on the **GitHub**.
|
||||
|
||||
### TL;DR
|
||||
|
||||
#### Installing packages
|
||||
|
||||
I try to keep the images slim. Consequently you can encounter missing dependencies while adding more applications yourself. You can track the missing libraries on the [Debian Packages Search][debian-packages-search] page and install them subsequently.
|
||||
|
||||
You can also try to fix it by executing the following (the default `sudo` password is **headless**):
|
||||
|
||||
```shell
|
||||
### apt cache needs to be updated only once
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt --fix-broken install
|
||||
```
|
||||
|
||||
#### Shared memory size
|
||||
|
||||
Note that some applications require larger shared memory than the default 64MB. Using 256MB usually solves crashes or strange behavior.
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size.
|
||||
|
||||
#### Extending images
|
||||
|
||||
The provided example file `Dockerfile.extend` shows how to use the images as the base for your own images.
|
||||
|
||||
Your concrete `Dockerfile` may need more statements, but the concept should be clear.
|
||||
|
||||
The compose file `example.yml` shows how to switch to another non-root user and how to set the VNC password and resolution.
|
||||
|
||||
#### Building images
|
||||
|
||||
The fastest way to build the images:
|
||||
|
||||
```shell
|
||||
### PWD = project root
|
||||
### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc')
|
||||
|
||||
### examples of building and publishing the individual images
|
||||
./builder.sh latest all
|
||||
|
||||
### just building an image, skipping the publishing and the version sticker update
|
||||
./builder.sh latest build
|
||||
|
||||
### examples of building and publishing the images as a group
|
||||
./ci-builder.sh all group latest
|
||||
```
|
||||
|
||||
You can still execute the individual hook scripts as before (see the folder `/docker/hooks/`). However, the provided utilities `builder.sh` and `ci-builder.sh` are more convenient. Before pushing the images to the **Docker Hub** you have to prepare and source the file `secrets.rc` (see `example-secrets.rc`). The script `builder.sh` builds the individual images. The script `ci-builder.sh` can build various groups of images or all of them at once. Check the [builder-utility-readme][this-builder-readme], [local-building-example][this-readme-local-building-example] and [sibling Wiki][sibling-wiki] for more information.
|
||||
|
||||
Note that selected features that are enabled by default can be explicitly disabled via environment variables. This allows to build even smaller images by excluding, for example, `noVNC`. See the [local-building-example][this-readme-local-building-example] for more information.
|
||||
|
||||
#### Sharing devices
|
||||
|
||||
Sharing the display with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
-e DISPLAY=${DISPLAY} \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-g3:latest --skip-vnc
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
Sharing the X11 socket with the host works only on Linux:
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-g3:latest
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
### Description
|
||||
|
||||
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].
|
||||
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- utilities **ping**, **wget**, **sudo** (Debian distribution)
|
||||
- current version of JSON processor [jq][jq]
|
||||
- light-weight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding both the container user and the group
|
||||
- support of **version sticker** (see the [full-length README][this-readme-full] on the **GitHub**)
|
||||
|
||||
The history of notable changes is documented in the [CHANGELOG][this-changelog].
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
### Image tags
|
||||
|
||||
The following image tags are regularly built and published on the **Docker Hub**:
|
||||
<!-- markdownlint-disable MD052 -->
|
||||
|
||||
- `latest` based on `Debian 11`
|
||||
|
||||
![badge_latest_created][badge_latest_created]
|
||||
[![badge_latest_version-sticker][badge_latest_version-sticker]][link_latest_version-sticker-verbose]
|
||||
|
||||
Clicking on the version sticker badge reveals more information about the actual configuration of the image.
|
||||
<!-- markdownlint-enable MD052 -->
|
||||
|
||||
### More information
|
||||
**Hint:** Clicking the version sticker badge reveals more information about the particular build.
|
||||
|
||||
More information about these images can be found in the [full-length README][this-readme-full] file on the GitHub.
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- lightweight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- [sudo][sudo] support
|
||||
- current version of JSON processor [jq][jq]
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding environment variables, VNC parameters, user and group (see [User guide][this-user-guide-using-containers])
|
||||
- support of **version sticker** (see [User guide][this-user-guide-version-sticker])
|
||||
|
||||
The following **TCP** ports are exposed by default:
|
||||
|
||||
- **5901** for access over **VNC** (using VNC viewer)
|
||||
- **6901** for access over [noVNC][novnc] (using web browser)
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
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].
|
||||
|
||||
If you've found a problem or you just have a question, please check the [User guide][this-user-guide], [Issues][this-issues] and [sibling Wiki][sibling-wiki] first.
|
||||
Please do not overlook the closed issues.
|
||||
|
||||
If you do not find a solution, you can file a new issue.
|
||||
The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
If you have a question or an idea and you don't want to open an issue, you can also use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
**Remark:** The [GitHub project][this-github] contains image generators that image users generally don’t need, unless they want to build the images themselves.
|
||||
|
||||
***
|
||||
|
||||
<!-- GitHub project common -->
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-user-guide-version-sticker]: https://accetto.github.io/user-guide-g3/version-sticker/
|
||||
|
||||
[this-user-guide-using-containers]: https://accetto.github.io/user-guide-g3/using-containers/
|
||||
|
||||
[this-changelog]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/CHANGELOG.md
|
||||
|
||||
[this-github]: https://github.com/accetto/debian-vnc-xfce-g3/
|
||||
<!-- [this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues -->
|
||||
|
||||
[this-readme-full]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/xfce/README.md
|
||||
[this-readme-project]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-builder-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
[this-readme-local-building-example]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-local-building-example.md
|
||||
[this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues
|
||||
|
||||
<!-- Docker image specific -->
|
||||
|
||||
[this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-g3/
|
||||
[this-dockerfile]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce
|
||||
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-g3.jpg
|
||||
|
||||
<!-- Sibling projects -->
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-g3-latest.png
|
||||
|
||||
[accetto-dockerhub-ubuntu-vnc-xfce-g3]: https://hub.docker.com/r/accetto/ubuntu-vnc-xfce-g3
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
<!-- Previous generations -->
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
[accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess
|
||||
|
||||
<!-- External links -->
|
||||
|
||||
[docker-debian]: https://hub.docker.com/_/debian/
|
||||
[docker-ubuntu]: https://hub.docker.com/_/ubuntu/
|
||||
|
||||
<!-- [docker-doc]: https://docs.docker.com/ -->
|
||||
<!-- [docker-doc-managing-data]: https://docs.docker.com/storage/ -->
|
||||
|
||||
[debian-packages-search]: https://packages.debian.org/index
|
||||
|
||||
[jq]: https://stedolan.github.io/jq/
|
||||
[mousepad]: https://github.com/codebrainz/mousepad
|
||||
[nano]: https://www.nano-editor.org/
|
||||
[novnc]: https://github.com/kanaka/noVNC
|
||||
[sudo]: https://www.sudo.ws/
|
||||
[tigervnc]: http://tigervnc.org
|
||||
[tini]: https://github.com/krallin/tini
|
||||
[xfce]: http://www.xfce.org
|
||||
|
||||
<!-- github badges common -->
|
||||
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=release
|
||||
|
||||
[badge-github-release-date]: https://img.shields.io/github/release-date/accetto/debian-vnc-xfce-g3?logo=github
|
||||
|
||||
<!-- docker badges specific -->
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=GitHub
|
||||
|
||||
[badge-docker-pulls]: https://badgen.net/docker/pulls/accetto/debian-vnc-xfce-g3?icon=docker&label=pulls
|
||||
|
||||
[badge-docker-stars]: https://badgen.net/docker/stars/accetto/debian-vnc-xfce-g3?icon=docker&label=stars
|
||||
|
||||
<!-- Appendix -->
|
||||
<!-- Appendix will be added by util-readme.sh -->
|
||||
|
||||
@@ -2,98 +2,27 @@
|
||||
|
||||
## accetto/debian-vnc-xfce-g3
|
||||
|
||||
[Docker Hub][this-docker] - [Git Hub][this-github] - [Dockerfile][this-dockerfile] - [Docker Readme][this-readme-dockerhub] - [Changelog][this-changelog] - [Project Readme][this-readme-project]
|
||||
|
||||
![badge-docker-pulls][badge-docker-pulls]
|
||||
![badge-docker-stars][badge-docker-stars]
|
||||
![badge-github-release][badge-github-release]
|
||||
![badge-github-release-date][badge-github-release-date]
|
||||
[User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog]
|
||||
|
||||
***
|
||||
|
||||
- [Headless Debian/Xfce container with VNC/noVNC](#headless-debianxfce-container-with-vncnovnc)
|
||||
- [accetto/debian-vnc-xfce-g3](#accettodebian-vnc-xfce-g3)
|
||||
- [Introduction](#introduction)
|
||||
- [TL;DR](#tldr)
|
||||
- [Installing packages](#installing-packages)
|
||||
- [Shared memory size](#shared-memory-size)
|
||||
- [Extending images](#extending-images)
|
||||
- [Building images](#building-images)
|
||||
- [Sharing devices](#sharing-devices)
|
||||
- [Description](#description)
|
||||
- [Image tags](#image-tags)
|
||||
- [Ports](#ports)
|
||||
- [Volumes](#volumes)
|
||||
- [Version sticker](#version-sticker)
|
||||
- [Using headless containers](#using-headless-containers)
|
||||
- [Overriding environment variables](#overriding-environment-variables)
|
||||
- [Overriding VNC/noVNC parameters](#overriding-vncnovnc-parameters)
|
||||
- [Container user account](#container-user-account)
|
||||
- [Overriding container user parameters](#overriding-container-user-parameters)
|
||||
- [Overriding user parameters in build-time](#overriding-user-parameters-in-build-time)
|
||||
- [Overriding user parameters in run-time](#overriding-user-parameters-in-run-time)
|
||||
- [User permissions and ownership](#user-permissions-and-ownership)
|
||||
- [Other considerations](#other-considerations)
|
||||
- [Running containers in background (detached)](#running-containers-in-background-detached)
|
||||
- [Running containers in foreground (interactively)](#running-containers-in-foreground-interactively)
|
||||
- [Startup options and help](#startup-options-and-help)
|
||||
- [Issues, Wiki and Discussions](#issues-wiki-and-discussions)
|
||||
- [Credits](#credits)
|
||||
- [Diagrams](#diagrams)
|
||||
- [Dockerfile.xfce](#dockerfilexfce)
|
||||
This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-g3][this-docker].
|
||||
|
||||
***
|
||||
There is also a sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
### Introduction
|
||||
This [User guide][this-user-guide] describes the images and how to use them.
|
||||
|
||||
This repository contains resources for building Docker images based on [Debian 11][docker-debian] with [Xfce][xfce] desktop environment and [VNC][tigervnc]/[noVNC][novnc] servers for headless use.
|
||||
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].
|
||||
|
||||
There is also the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing similar images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu].
|
||||
|
||||
### TL;DR
|
||||
|
||||
#### Installing packages
|
||||
|
||||
I try to keep the images slim. Consequently you can encounter missing dependencies while adding more applications yourself. You can track the missing libraries on the [Debian Packages Search][debian-packages-search] page and install them subsequently.
|
||||
|
||||
You can also try to fix it by executing the following (the default `sudo` password is **headless**):
|
||||
|
||||
```shell
|
||||
### apt cache needs to be updated only once
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt --fix-broken install
|
||||
```
|
||||
|
||||
#### Shared memory size
|
||||
|
||||
Note that some applications require larger shared memory than the default 64MB. Using 256MB usually solves crashes or strange behavior.
|
||||
|
||||
You can check the current shared memory size by executing the following command inside the container:
|
||||
|
||||
```shell
|
||||
df -h /dev/shm
|
||||
```
|
||||
|
||||
The older sibling Wiki page [Firefox multi-process][that-wiki-firefox-multiprocess] describes several ways, how to increase the shared memory size.
|
||||
|
||||
#### Extending images
|
||||
|
||||
The provided example file `Dockerfile.extend` shows how to use the images as the base for your own images.
|
||||
|
||||
Your concrete `Dockerfile` may need more statements, but the concept should be clear.
|
||||
|
||||
The compose file `example.yml` shows how to switch to another non-root user and how to set the VNC password and resolution.
|
||||
|
||||
#### Building images
|
||||
|
||||
The fastest way to build the images:
|
||||
### Building images
|
||||
|
||||
```shell
|
||||
### PWD = project root
|
||||
### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc')
|
||||
|
||||
### examples of building and publishing the individual images
|
||||
### examples of building and publishing the individual images
|
||||
./builder.sh latest all
|
||||
|
||||
### just building the image, skipping the publishing and the version sticker update
|
||||
@@ -103,571 +32,52 @@ The fastest way to build the images:
|
||||
./ci-builder.sh all group latest
|
||||
```
|
||||
|
||||
You can still execute the individual hook scripts as before (see the folder `/docker/hooks/`). However, the provided utilities `builder.sh` and `ci-builder.sh` are more convenient. Before pushing the images to the **Docker Hub** you have to prepare and source the file `secrets.rc` (see `example-secrets.rc`). The script `builder.sh` builds the individual images. The script `ci-builder.sh` can build various groups of images or all of them at once. Check the [builder-utility-readme][this-builder-readme], [local-building-example][this-readme-local-building-example] and [sibling Wiki][sibling-wiki] for more information.
|
||||
Refer to the main [README][this-readme] file for more information about the building subject.
|
||||
|
||||
Note that selected features that are enabled by default can be explicitly disabled via environment variables. This allows to build even smaller images by excluding, for example, `noVNC`. See the [local-building-example][this-readme-local-building-example] for more information.
|
||||
### Getting help
|
||||
|
||||
#### Sharing devices
|
||||
If you've found a problem or you just have a question, please check the [User guide][this-user-guide], [Issues][this-issues] and [sibling Wiki][sibling-wiki] first.
|
||||
Please do not overlook the closed issues.
|
||||
|
||||
Sharing the display with the host works only on Linux:
|
||||
If you do not find a solution, you can file a new issue.
|
||||
The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
If you have a question or an idea and you don't want to open an issue, you can also use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
docker run -it -P --rm \
|
||||
-e DISPLAY=${DISPLAY} \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-g3:latest --skip-vnc
|
||||
### Diagrams
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
Diagram of the multi-staged Dockerfile used for building multiple images.
|
||||
|
||||
Sharing the X11 socket with the host works only on Linux:
|
||||
The actual content of a particular image build is controlled by the *feature variables*.
|
||||
|
||||
```shell
|
||||
xhost +local:$(whoami)
|
||||
|
||||
docker run -it -P --rm \
|
||||
--device /dev/dri/card0 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
|
||||
accetto/debian-vnc-xfce-g3:latest
|
||||
|
||||
xhost -local:$(whoami)
|
||||
```
|
||||
|
||||
### Description
|
||||
|
||||
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].
|
||||
|
||||
The main features and components of the images in the default configuration are:
|
||||
|
||||
- utilities **ping**, **wget**, **sudo** (Debian distribution)
|
||||
- current version of JSON processor [jq][jq]
|
||||
- light-weight [Xfce][xfce] desktop environment (Debian distribution)
|
||||
- current version of high-performance [TigerVNC][tigervnc] server and client
|
||||
- current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**)
|
||||
- popular text editor [nano][nano] (Debian distribution)
|
||||
- lite but advanced graphical editor [mousepad][mousepad] (Debian distribution)
|
||||
- current version of [tini][tini] as the entry-point initial process (PID 1)
|
||||
- support for overriding both the container user and the group
|
||||
- support of **version sticker** (see below)
|
||||
|
||||
The history of notable changes is documented in the [CHANGELOG][this-changelog].
|
||||
|
||||
![container-screenshot][this-screenshot-container]
|
||||
|
||||
### Image tags
|
||||
|
||||
The following image tags are regularly built and published on the **Docker Hub**:
|
||||
|
||||
- `latest` based on `Debian 11`
|
||||
|
||||
Clicking on the version sticker badge in the [README on Docker Hub][this-readme-dockerhub] reveals more information about the actual configuration of the image.
|
||||
|
||||
### Ports
|
||||
|
||||
Following **TCP** ports are exposed by default:
|
||||
|
||||
- **5901** is used for access over **VNC**
|
||||
- **6901** is used for access over [noVNC][novnc]
|
||||
|
||||
These default ports and also some other parameters can be overridden several ways (see bellow).
|
||||
|
||||
### Volumes
|
||||
|
||||
The containers do not create or use any external volumes by default.
|
||||
|
||||
Both **named volumes** and **bind mounts** can be used. More about volumes can be found in [Docker documentation][docker-doc] (e.g. [Manage data in Docker][docker-doc-managing-data]).
|
||||
|
||||
### Version sticker
|
||||
|
||||
Version sticker serves multiple purposes that are closer described in the [sibling Wiki][sibling-wiki-version-stickers]. Note that the usage of the version sticker has changed between the generations of images.
|
||||
|
||||
The **short version sticker value** describes the version of the image and it is persisted in its **label** during the build-time. It is also shown as its **badge** in the README file.
|
||||
|
||||
The **verbose version sticker value** is used by the CI builder to decide if the image needs to be refreshed. It describes the actual configuration of the essential components of the image. It can be revealed by clicking on the version sticker badge in the README file.
|
||||
|
||||
The version sticker values are generated by the script `version_sticker.sh`, which is deployed into the startup directory `/dockerstartup`. The script will show a short help if executed with the argument `-h`. There is also a convenient `Version Sticker` launcher on the container desktop.
|
||||
|
||||
## Using headless containers
|
||||
|
||||
There are two ways, how to use the containers created from this image.
|
||||
|
||||
All containers are accessible by a VNC viewer (e.g. [TigerVNC][tigervnc] or [TightVNC][tightvnc]).
|
||||
|
||||
The default `VNC_PORT` value is `5901`. The default `DISPLAY` value is `:1`. The default VNC password (`VNC_PW`) is `headless`.
|
||||
|
||||
The containers that are created from the images built with the **noVNC feature** can be also accessed over [noVNC][noVNC] by any web browser supporting HTML5.
|
||||
|
||||
The default `NOVNC_PORT` value is `6901`. The noVNC password is always identical to the VNC password.
|
||||
|
||||
There are several ways of connecting to headless containers and the possibilities also differ between the Linux and Windows environments, but usually it is done by mapping the VNC/noVNC ports exposed by the container to some free TCP ports on its host system.
|
||||
|
||||
For example, the following command would map the VNC/noVNC ports `5901/6901` of the container to the TCP ports `25901/26901` on the host:
|
||||
|
||||
```shell
|
||||
docker run -p 25901:5901 -p 26901:6901 ...
|
||||
```
|
||||
|
||||
If the container would run on the local computer, then it would be accessible over **VNC** as `localhost:25901` and over **noVNC** as `http://localhost:26901`.
|
||||
|
||||
If it would run on the remote server `mynas`, then it would be accessible over **VNC** as `mynas:25901` and over **noVNC** as `http://mynas:26901`.
|
||||
|
||||
The image offers two [noVNC][novnc] clients - **lite client** and **full client**. Because the connection URL differs slightly in both cases, the container provides a **simple startup page**.
|
||||
|
||||
The startup page offers two hyperlinks for both noVNC clients:
|
||||
|
||||
- **noVNC Lite Client** (`http://mynas:26901/vnc_lite.html`)
|
||||
- **noVNC Full Client** (`http://mynas:26901/vnc.html`)
|
||||
|
||||
It is also possible to provide the password through the links:
|
||||
|
||||
- `http://mynas:26901/vnc_lite.html?password=headless`
|
||||
- `http://mynas:26901/vnc.html?password=headless`
|
||||
|
||||
### Overriding environment variables
|
||||
|
||||
If the environment variable `FEATURES_OVERRIDING_ENVV=1`, which is the case by default, then the container startup script will look for the file `$HOME/.override/.override_envv.rc` and source all the lines that begin with the string 'export ' at the first position and contain the '=' character.
|
||||
|
||||
You can provide the overriding file from outside the container using *bind mounts* or *volumes*.
|
||||
|
||||
This feature allows overriding or adding environment variables at the **container startup-time**.
|
||||
It means, even after the container has already been created.
|
||||
|
||||
You can disable this behavior by setting the variable `FEATURES_OVERRIDING_ENVV` to zero when the container is created or the image is built.
|
||||
|
||||
The lines that have been actually sourced can be reported into the container's log if the startup parameter `--verbose` or `--debug` is provided.
|
||||
|
||||
Look below for the example how to override the VNC/noVNC parameters at the container startup-time.
|
||||
|
||||
### Overriding VNC/noVNC parameters
|
||||
|
||||
The VNC/noVNC parameters are controlled by related environment variables embedded into the image.
|
||||
|
||||
They have the following default values:
|
||||
|
||||
```shell
|
||||
DISPLAY=:1
|
||||
NOVNC_PORT=6901
|
||||
VNC_COL_DEPTH=24
|
||||
VNC_PORT=5901
|
||||
VNC_PW=headless
|
||||
VNC_RESOLUTION=1360x768
|
||||
VNC_VIEW_ONLY=false
|
||||
```
|
||||
|
||||
These environment variables can be overridden several ways.
|
||||
|
||||
**At image build-time** you can embed different default values by using the following build arguments:
|
||||
|
||||
- `ARG_VNC_PW` sets the variable `VNC_PW` (VNV/noVNC password)
|
||||
- `ARG_VNC_DISPLAY` sets the variable `DISPLAY`
|
||||
- `ARG_VNC_PORT` sets the variable `VNC_PORT`
|
||||
- `ARG_VNC_RESOLUTION` sets the variable `VNC_RESOLUTION`
|
||||
- `ARG_VNC_COL_DEPTH` sets the variable `VNC_COL_DEPTH`
|
||||
- `ARG_VNC_VIEW_ONLY` set the variable `VNC_VIEW_ONLY`
|
||||
- `ARG_NOVNC_PORT` sets the variable `NOVNC_PORT`
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker build --build-arg DISPLAY=:2 --build-arg ARG_VNC_PORT=6902 ...
|
||||
```
|
||||
|
||||
**At container creation-time** you can override the environment variable values by using the `docker run -e` option. Please note that in this case you have to use the actual environment variable names, not the build argument names (e.g. `VNC_PORT` instead of `ARG_VNC_PORT`).
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker run -e VNC_PORT=6902 ...
|
||||
```
|
||||
|
||||
**At container startup-time** you can override the VNC/noVNC variables using the feature `FEATURES_OVERRIDING_ENVV' described above.
|
||||
|
||||
For example, the following command would bind the file `my_own_vnc_parameters.rc` from the directory `/home/joe` to the container:
|
||||
|
||||
```shell
|
||||
docker run -v /home/joe/my_own_vnc_parameters.rc:/home/headless/.override/.override_envv.rc
|
||||
```
|
||||
|
||||
The content of the file should be similar to the provided example file `example-override-envv.rc`:
|
||||
|
||||
```shell
|
||||
### only the lines beginning with 'export ' at the first position and containing '=' will be sourced
|
||||
export VNC_RESOLUTION=1024x768
|
||||
export VNC_PW=secret
|
||||
#export DISPLAY=:2
|
||||
#export VNC_COL_DEPTH=32
|
||||
```
|
||||
|
||||
Please note that only the lines beginning with the string 'export ' at the first position and containing the '=' character will be imported.
|
||||
|
||||
By providing the variable values the following rules apply:
|
||||
|
||||
- The value of `ARG_VNC_DISPLAY/VNC_DISPLAY` should include also the leading colon (e.g. `:1`).
|
||||
- The value of `ARG_VNC_PW/VNC_PW` can be empty. It effectively disables the VNC/noVNC password.
|
||||
|
||||
If you want to check, what parameter values have been actually applied, then you can start the container with the parameter `--debug`.
|
||||
|
||||
For example:
|
||||
|
||||
```shell
|
||||
docker run -it -P --rm accetto/debian-vnc-xfce-g3:latest --debug
|
||||
|
||||
### output (excerpt)
|
||||
VNC server started on display ':1' and TCP port '5901'
|
||||
Connect via VNC viewer with 172.17.0.3:5901
|
||||
noVNC started on TCP port '6901'
|
||||
```
|
||||
|
||||
You should be aware, that overriding the VNC/noVNC parameters incorrectly could prevent the container from starting.
|
||||
|
||||
This feature assumes some preliminary knowledge and it is provided for advanced users that already know what they want to achieve.
|
||||
|
||||
For example, by default there is a relation between the `DISPLAY` and `VNC_PORT` values. Generally the convention `VNC_PORT = 5900 + DISPLAY` is followed (similarly `NOVNC_PORT = 6900 + DISPLAY`).
|
||||
|
||||
You may decide not to follow the conventions. This image allows you to set the parameters differently, but again, you should know, what you are doing.
|
||||
|
||||
Be also aware, that there are differences between the Linux and Windows environments.
|
||||
|
||||
If your session disconnects, it might be related to a network equipment (load-balancer, reverse proxy, ...) dropping the websocket session for inactivity (more info [here](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout) and [here](https://nginx.org/en/docs/http/websocket.html) for nginx). In such case, try defining the **NOVNC_HEARTBEAT=XX** environment variable at startup-time, where **XX** is the number of seconds between [websocket ping/pong](https://github.com/websockets/ws/issues/977) packets.
|
||||
|
||||
## Container user account
|
||||
|
||||
Containers created from this image run under the **application user** (by default `headless:headless`, `1000:1000`), which is a **non-root** user account. However, the application user gets permissions for `sudo`.
|
||||
|
||||
The **application user name** also defines the **home directory name**, which is by default `/home/headless`.
|
||||
|
||||
The default application user's password is `headless`, which is also the default `sudo` password.
|
||||
|
||||
The user's (and `sudo`) password can be changed inside the container by using the `passwd` command. For example, changing the password to `docker`:
|
||||
|
||||
```shell
|
||||
echo 'headless:docker' | sudo chpasswd
|
||||
|
||||
### or also
|
||||
sudo chpasswd <<<"headless:docker"
|
||||
```
|
||||
|
||||
The `sudo` command allows user elevation, so the **application user** can install additional software inside the container.
|
||||
|
||||
The following example shows how to install **vim**:
|
||||
|
||||
```shell
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y vim
|
||||
```
|
||||
|
||||
### Overriding container user parameters
|
||||
|
||||
The user ID, user name, user group ID, user group name and the initial `sudo` password can be overridden during the build time (`docker build`).
|
||||
|
||||
The user ID and the group ID can be overridden also in run time (`docker run`).
|
||||
|
||||
#### Overriding user parameters in build-time
|
||||
|
||||
The build parameters `ARG_HEADLESS_USER_ID`, `ARG_HEADLESS_USER_NAME`, `ARG_HEADLESS_USER_GROUP_ID` and `ARG_HEADLESS_USER_GROUP_NAME` are used during the build time (`docker build`) and they allow to override the related container parameters.
|
||||
|
||||
Their values are persisted in the corresponding environment variables `HEADLESS_USER_ID`, `HEADLESS_USER_NAME`, `HEADLESS_USER_GROUP_ID` and `HEADLESS_USER_GROUP_NAME`.
|
||||
|
||||
The build argument `ARG_SUDO_INITIAL_PW` allows overriding the initial application user's and `sudo` password (which is `headless`). This initial password is not stored into any environment variable, but into a temporary file, which is removed on the first container start. The password can be changed inside the container.
|
||||
|
||||
For example, building an image with the application user name `hairless`, with the primary user group `hairygroup`, the IDs `2002:3003` and the initial password `docker`:
|
||||
|
||||
```shell
|
||||
docker build --build-arg ARG_HEADLESS_USER_NAME=hairless --build-arg ARG_HEADLESS_USER_GROUP_NAME=hairygroup --build-arg ARG_HEADLESS_USER_ID=2002 --build-arg ARG_HEADLESS_USER_GROUP_ID=3003 --build-arg ARG_SUDO_INITIAL_PW=docker ... -t my/image:overriden
|
||||
```
|
||||
|
||||
#### Overriding user parameters in run-time
|
||||
|
||||
Both the user ID and group ID can be overridden also in the run time (`docker run`). It does not apply to the application user name, the group name and the initial password.
|
||||
|
||||
For example, this would override the `user:group` by `2000:3000`:
|
||||
|
||||
```shell
|
||||
docker run --user 2000:3000 ... my/image:overriden
|
||||
```
|
||||
|
||||
#### User permissions and ownership
|
||||
|
||||
The actual application user account and the user group are created by the startup script on the first container start.
|
||||
|
||||
During this one-time task the startup script needs to modify the container files `/etc/passwd` and `/etc/group`. That is why there is the line `chmod 666 /etc/passwd /etc/group` in the Dockerfile (see the `stage_final`). However, the permissions of these two files will be set to the standard value `644` just after creating the user.
|
||||
|
||||
The created user gets permissions for `sudo` and the ownership to the content of the home and startup folders.
|
||||
|
||||
The temporary file `${STARTUPDIR}/.initial_sudo_password` is cleared after creating the user.
|
||||
|
||||
However, note that the initial `sudo` password will still be persisted in the image history. You have to change it inside the container, if you want to keep it really secret.
|
||||
|
||||
There is the test script `~/tests/test-01.sh` that allows quick check of the current permissions.
|
||||
|
||||
#### Other considerations
|
||||
|
||||
Please note that the described configuration will not be done if the startup script `startup.sh` will not be executed.
|
||||
|
||||
Also do not confuse the application user's password with the **VNC password**, because they both have the same default value (`headless`).
|
||||
|
||||
## Running containers in background (detached)
|
||||
|
||||
The following container will keep running in the background and it will listen on an automatically selected TCP port on the host computer:
|
||||
|
||||
```shell
|
||||
docker run -d -P accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
The following container will listen on the host's TCP port **25901**:
|
||||
|
||||
```shell
|
||||
docker run -d -p 25901:5901 accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
The following container will create (or re-use) the local named volume **my\_Downloads** mounted as `/home/headless/Downloads`:
|
||||
|
||||
```shell
|
||||
docker run -d -P -v my_Downloads:/home/headless/Downloads accetto/debian-vnc-xfce-g3:latest
|
||||
```
|
||||
|
||||
or using the newer syntax with **--mount** flag:
|
||||
|
||||
```shell
|
||||
docker run -d -P --mount source=my_Downloads,target=/home/headless/Downloads accetto/debian-vnc-xfce-g3:latest
|
||||
```
|
||||
|
||||
## Running containers in foreground (interactively)
|
||||
|
||||
The following container can be used interactively:
|
||||
|
||||
```shell
|
||||
docker run -it --rm accetto/debian-vnc-xfce-g3:latest bash
|
||||
```
|
||||
|
||||
The opened `bash` session can be used as usual and then closed by entering `^C` (CTRL-C):
|
||||
|
||||
```shell
|
||||
To run a command as administrator (user "root"), use "sudo <command>".
|
||||
See "man sudo_root" for details.
|
||||
|
||||
headless@cf4a4e01d94b:~$ whoami
|
||||
headless
|
||||
headless@cf4a4e01d94b:~$ pwd
|
||||
/home/headless
|
||||
headless@cf4a4e01d94b:~$
|
||||
```
|
||||
|
||||
The container will remove itself.
|
||||
|
||||
## Startup options and help
|
||||
|
||||
The image supports multiple **start-up options** and **start-up modifiers**. There also also two help modes.
|
||||
|
||||
The following container will print out the short help and then it will remove itself:
|
||||
|
||||
```shell
|
||||
docker run --rm accetto/debian-vnc-xfce-g3:latest --help
|
||||
```
|
||||
|
||||
Example of the short help text:
|
||||
|
||||
```text
|
||||
Container startup script
|
||||
Usage: /dockerstartup/startup.sh [-v|--version] [-h|--help] [-H|--help-usage] [--(no-)wait] [--(no-)skip-startup] [--(no-)tail-null] [--(no-)tail-vnc] [--(no-)version-sticker] [--(no-)version-sticker-verbose] [--(no-)skip-vnc] [--(no-)skip-novnc] [--(no-)debug] [--(no-)verbose] [--] [<command-1>] ... [<command-n>] ...
|
||||
<command>: Optional command with optional arguments. It is executed during startup.
|
||||
-v, --version: Prints version
|
||||
-h, --help: Prints help
|
||||
-H, --help-usage: Extended container usage help.
|
||||
--wait, --no-wait: Default background execution mode (on by default)
|
||||
--skip-startup, --no-skip-startup: Default foreground execution mode (off by default)
|
||||
--tail-null, --no-tail-null: Alternative background execution mode (off by default)
|
||||
--tail-vnc, --no-tail-vnc: Alternative background execution mode (off by default)
|
||||
--version-sticker, --no-version-sticker: Alternative foreground execution mode (off by default)
|
||||
--version-sticker-verbose, --no-version-sticker-verbose: Alternative foreground execution mode (off by default)
|
||||
--skip-vnc, --no-skip-vnc: Startup process modifier (off by default)
|
||||
--skip-novnc, --no-skip-novnc: Startup process modifier (off by default)
|
||||
--debug, --no-debug: Startup process modifier (off by default)
|
||||
--verbose, --no-verbose: Startup process modifier (off by default)
|
||||
|
||||
Use '-H' or '--help-usage' for extended container usage help.
|
||||
For more information visit https://github.com/accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
The following container will print out the long help and then it will remove itself:
|
||||
|
||||
```shell
|
||||
docker run --rm accetto/debian-vnc-xfce-g3:latest --help-usage
|
||||
```
|
||||
|
||||
Example of the long help text:
|
||||
|
||||
```text
|
||||
CONTAINER USAGE:
|
||||
docker run [<docker-run-options>] accetto/<image>:<tag> [<startup-options>] [<command>]
|
||||
|
||||
POSITIONAL ARGUMENTS:
|
||||
command
|
||||
Optional command with optional arguments.
|
||||
It will be executed during startup before going waiting, tailing or asleep.
|
||||
It is necessary to use the quotes correctly or the 'bash -c "<command>"' pattern.
|
||||
|
||||
STARTUP OPTIONS:
|
||||
|
||||
--wait, or no options, or unknown option, or empty input
|
||||
Default background execution mode.
|
||||
Starts the VNC and noVNC servers, if available, then executes the command
|
||||
and waits until the VNC server process exits or goes asleep infinitely.
|
||||
Container keeps running in the background.
|
||||
|
||||
--skip-startup
|
||||
Default foreground execution mode.
|
||||
Skips the startup procedure, executes the command and exits.
|
||||
Be aware that the container user generator will be also skipped.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--tail-null
|
||||
Alternative background execution mode.
|
||||
Similar to '--wait', but tails the null device instead of going asleep.
|
||||
Container keeps running in the background.
|
||||
|
||||
--tail-vnc
|
||||
Alternative background execution mode.
|
||||
Similar to '--wait', but tails the VNC log instead of waiting until the VNC process exits.
|
||||
Falls back to '--tail-null' if the VNC server has not been started.
|
||||
Container keeps running in the background.
|
||||
|
||||
--version-sticker
|
||||
Alternative foreground execution mode.
|
||||
Prints out the version sticker info.
|
||||
The VNC server is also started by default, if available, because some applications
|
||||
need a display to report their versions correctly. It can be suppressed by providing
|
||||
also '--skip-vnc'. The '--skip-novnc' option is always enforced automatically.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--version-sticker-verbose
|
||||
Alternative foreground execution mode.
|
||||
Similar to '--version-sticker', but prints out the verbose version sticker info and features list.
|
||||
Container does not keep running in the background.
|
||||
|
||||
--skip-vnc
|
||||
Startup process modifier.
|
||||
If VNC and noVNC startup should be skipped.
|
||||
It also enforces '--skip-novnc'.
|
||||
|
||||
--skip-novnc
|
||||
Startup process modifier.
|
||||
If noVNC startup should be skipped.
|
||||
It is also enforced by '--skip-vnc'.
|
||||
|
||||
--debug
|
||||
Startup process modifier.
|
||||
If additional debugging info should be displayed during startup.
|
||||
It also enforces option '--verbose'.
|
||||
|
||||
--verbose
|
||||
Startup process modifier.
|
||||
If startup progress messages should be displayed.
|
||||
It is also enforced by '--debug'.
|
||||
|
||||
--help-usage, -H
|
||||
Prints out this extended container usage help and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
--help, -h
|
||||
Prints out the short startup script help and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
--version, -v
|
||||
Prints out the version of the startup script and exits.
|
||||
The rest of the input is ignored.
|
||||
|
||||
Use '-h' or '--help' for short startup script help.
|
||||
Fore more information visit https://github.com/accetto/debian-vnc-xfce-g3
|
||||
```
|
||||
|
||||
## Issues, Wiki and Discussions
|
||||
|
||||
If you have found a problem or you just have a question, please check the [Issues][this-issues] and the [sibling Wiki][sibling-wiki] first. Please do not overlook the closed issues.
|
||||
|
||||
If you do not find a solution, you can file a new issue. The better you describe the problem, the bigger the chance it'll be solved soon.
|
||||
|
||||
If you have a question or an idea and you don't want to open an issue, you can use the [sibling Discussions][sibling-discussions].
|
||||
|
||||
## Credits
|
||||
|
||||
Credit goes to all the countless people and companies, who contribute to open source community and make so many dreamy things real.
|
||||
|
||||
## Diagrams
|
||||
|
||||
The stage diagram doesn't differ from the [sibling project][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
### Dockerfile.xfce
|
||||
The stage diagram doesn't differ from the sibling project [accetto/github-ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
![Dockerfile.xfce stages][sibling-diagram-dockerfile-stages]
|
||||
|
||||
***
|
||||
|
||||
<!-- GitHub project common -->
|
||||
[this-user-guide]: https://accetto.github.io/user-guide-g3/
|
||||
|
||||
[this-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-changelog]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/CHANGELOG.md
|
||||
[this-github]: https://github.com/accetto/debian-vnc-xfce-g3/
|
||||
|
||||
[this-issues]: https://github.com/accetto/debian-vnc-xfce-g3/issues
|
||||
[this-readme-dockerhub]: https://hub.docker.com/r/accetto/debian-vnc-xfce-g3
|
||||
[this-readme-project]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/README.md
|
||||
|
||||
[this-builder-readme]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-builder.md
|
||||
[this-readme-local-building-example]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/readme-local-building-example.md
|
||||
|
||||
<!-- Docker image specific -->
|
||||
|
||||
[this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-g3/
|
||||
|
||||
[this-dockerfile]: https://github.com/accetto/debian-vnc-xfce-g3/blob/master/docker/Dockerfile.xfce
|
||||
|
||||
[this-screenshot-container]: https://raw.githubusercontent.com/accetto/debian-vnc-xfce-g3/master/docker/doc/images/debian-vnc-xfce-g3.jpg
|
||||
|
||||
<!-- Sibling projects -->
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3
|
||||
|
||||
[sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki
|
||||
|
||||
[sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions
|
||||
|
||||
[sibling-diagram-dockerfile-stages]: https://raw.githubusercontent.com/accetto/ubuntu-vnc-xfce-g3/master/docker/doc/images/Dockerfile.xfce.png
|
||||
|
||||
[sibling-wiki-version-stickers]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/Concepts-of-dockerfiles
|
||||
|
||||
<!-- Previous generations -->
|
||||
|
||||
[accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/
|
||||
|
||||
[accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce
|
||||
|
||||
[that-wiki-firefox-multiprocess]: https://github.com/accetto/xubuntu-vnc/wiki/Firefox-multiprocess
|
||||
|
||||
<!-- External links -->
|
||||
|
||||
[docker-debian]: https://hub.docker.com/_/debian/
|
||||
[docker-ubuntu]: https://hub.docker.com/_/ubuntu/
|
||||
|
||||
[docker-doc]: https://docs.docker.com/
|
||||
[docker-doc-managing-data]: https://docs.docker.com/storage/
|
||||
|
||||
[debian-packages-search]: https://packages.debian.org/index
|
||||
|
||||
[jq]: https://stedolan.github.io/jq/
|
||||
[mousepad]: https://github.com/codebrainz/mousepad
|
||||
[nano]: https://www.nano-editor.org/
|
||||
[novnc]: https://github.com/kanaka/noVNC
|
||||
[tigervnc]: http://tigervnc.org
|
||||
[tightvnc]: http://www.tightvnc.com
|
||||
[tini]: https://github.com/krallin/tini
|
||||
[xfce]: http://www.xfce.org
|
||||
|
||||
<!-- github badges common -->
|
||||
|
||||
[badge-github-release]: https://badgen.net/github/release/accetto/debian-vnc-xfce-g3?icon=github&label=release
|
||||
|
||||
[badge-github-release-date]: https://img.shields.io/github/release-date/accetto/debian-vnc-xfce-g3?logo=github
|
||||
|
||||
<!-- docker badges specific -->
|
||||
|
||||
[badge-docker-pulls]: https://badgen.net/docker/pulls/accetto/debian-vnc-xfce-g3?icon=docker&label=pulls
|
||||
|
||||
[badge-docker-stars]: https://badgen.net/docker/stars/accetto/debian-vnc-xfce-g3?icon=docker&label=stars
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
|
||||
## Introduction
|
||||
|
||||
This utility script can build and publish individual images. It can also execute the individual hook scripts of the building pipeline (`docker/hooks` folder).
|
||||
This utility script can build and publish individual images.
|
||||
It can also execute the individual hook scripts of the building pipeline (`docker/hooks` folder).
|
||||
|
||||
Common usage pattern:
|
||||
|
||||
@@ -116,9 +117,12 @@ You can also use other ways to set the variables.
|
||||
|
||||
### Ensure `wget` utility
|
||||
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility. It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility.
|
||||
It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
|
||||
On Windows you have generally two choices. You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows. Make sure to update also the `PATH` environment variable appropriately.
|
||||
On Windows you have generally two choices.
|
||||
You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows.
|
||||
Make sure to update also the `PATH` environment variable appropriately.
|
||||
|
||||
## Executing complete pipeline
|
||||
|
||||
@@ -143,7 +147,8 @@ You can skip the publishing to the **Docker Hub** by replacing the command `all`
|
||||
./builder.sh latest all-no-push
|
||||
```
|
||||
|
||||
You can also provide additional parameters for the internally used Docker `build` command. For example:
|
||||
You can also provide additional parameters for the internally used Docker `build` command.
|
||||
For example:
|
||||
|
||||
```shell
|
||||
./builder.sh latest all-no-push --no-cache
|
||||
@@ -152,7 +157,8 @@ You can also provide additional parameters for the internally used Docker `build
|
||||
### docker build --no-cache ...
|
||||
```
|
||||
|
||||
The optional `<docker-cli-options>` are passed only to the `pre_build` hook script, which passes them to the internally used `docker build` command. The `cache` hook script, however, doesn't use any Docker CLI commands.
|
||||
The optional `<docker-cli-options>` are passed only to the `pre_build` hook script, which passes them to the internally used `docker build` command.
|
||||
The `cache` hook script, however, doesn't use any Docker CLI commands.
|
||||
|
||||
## Executing individual pipeline steps
|
||||
|
||||
@@ -179,11 +185,14 @@ The building pipeline consists of the following steps, that can be executed also
|
||||
./builder.sh latest post_push
|
||||
```
|
||||
|
||||
The optional `<docker-cli-options>` are passed to the each individual hook script, which can pass them to the internally used Docker CLI command. The `cache` hook script, however, doesn't use any Docker CLI commands.
|
||||
The optional `<docker-cli-options>` are passed to the each individual hook script, which can pass them to the internally used Docker CLI command.
|
||||
The `cache` hook script, however, doesn't use any Docker CLI commands.
|
||||
|
||||
### What about the 'cache' helper script
|
||||
|
||||
The `cache` hook script has been introduced in the **second version** (G3v2) of the building pipeline in the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3]. It refreshes the local `g3-cache`, which must be always placed inside the Docker build context. The script is also used by the `pre_build` and `build` hook scripts.
|
||||
The `cache` hook script has been introduced in the **second version** (G3v2) of the building pipeline in the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
It refreshes the local `g3-cache`, which must be always placed inside the Docker build context.
|
||||
The script is also used by the `pre_build` and `build` hook scripts.
|
||||
|
||||
The `g3-cache` and the rules for its refreshing are described separately.
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
## Introduction
|
||||
|
||||
This utility script can build and publish sets of images. It can also extract selected information from the building log.
|
||||
This utility script can build and publish sets of images.
|
||||
It can also extract selected information from the building log.
|
||||
|
||||
The common usage pattern
|
||||
|
||||
@@ -70,7 +71,8 @@ The script creates a complete execution log.
|
||||
|
||||
The optional parameter `--no-cache` will be passed to the internally used script `builder.sh`.
|
||||
|
||||
The optional parameter `--log-all` will cause that the script's output will be written into the log file in all cases. Normally the command line errors or the **log processing mode** commands are not logged.
|
||||
The optional parameter `--log-all` will cause that the script's output will be written into the log file in all cases.
|
||||
Normally the command line errors or the **log processing mode** commands are not logged.
|
||||
|
||||
## Preparation
|
||||
|
||||
@@ -147,9 +149,12 @@ You can also use other ways to set the variables.
|
||||
|
||||
### Ensure `wget` utility
|
||||
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility. It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility.
|
||||
It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
|
||||
On Windows you have generally two choices. You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows. Make sure to update also the `PATH` environment variable appropriately.
|
||||
On Windows you have generally two choices.
|
||||
You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows.
|
||||
Make sure to update also the `PATH` environment variable appropriately.
|
||||
|
||||
## Usage modes
|
||||
|
||||
@@ -165,7 +170,8 @@ The **group mode** usage pattern:
|
||||
|
||||
#### Group mode examples
|
||||
|
||||
The image tags can be listed in the command line. For example, all these images will be built independently of each other.
|
||||
The image tags can be listed in the command line.
|
||||
For example, all these images will be built independently of each other.
|
||||
|
||||
```shell
|
||||
./ci-builder.sh all group latest latest-firefox latest-chromium
|
||||
@@ -191,13 +197,16 @@ You can also use one of the **named groups**:
|
||||
|
||||
The **family mode** is intended for efficient building of sets of dependent images.
|
||||
|
||||
**Remark:** Since the version G3v3 of the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] is this mode for advanced use only. The previous images `accetto/ubuntu-vnc-xfce-g3:latest-fugo` and `accetto/ubuntu-vnc-xfce-firefox-g3:latest-plus` that used it are not published any more. The image `accetto/ubuntu-vnc-xfce-firefox-g3:latest-plus` has been renamed to `accetto/ubuntu-vnc-xfce-firefox-g3:latest`.
|
||||
**Remark:** Since the version G3v3 of the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] is this mode for advanced use only.
|
||||
The previous images `accetto/ubuntu-vnc-xfce-g3:latest-fugo` and `accetto/ubuntu-vnc-xfce-firefox-g3:latest-plus` that used it are not published any more.
|
||||
The image `accetto/ubuntu-vnc-xfce-firefox-g3:latest-plus` has been renamed to `accetto/ubuntu-vnc-xfce-firefox-g3:latest`.
|
||||
|
||||
The dependency in this context is meant more technically than conceptually.
|
||||
|
||||
The following example will help to understand the concept.
|
||||
|
||||
This project currently does not include any images that are in such a relation. Therefore it will be explained using the images from the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
This project currently does not include any images that are in such a relation.
|
||||
Therefore it will be explained using the images from the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3].
|
||||
|
||||
The image `accetto/ubuntu-vnc-xfce-firefox-g3:latest-plus` added some additional features to the image `accetto/ubuntu-vnc-xfce-firefox-g3:latest`, but otherwise were both images identical.
|
||||
|
||||
@@ -233,7 +242,8 @@ The following command could also be used, but there would be no benefit comparin
|
||||
./ci-builder.sh all family latest-chromium
|
||||
```
|
||||
|
||||
You can also skip the publishing to the **Docker Hub** by replacing the `all` command by the `all-no-push` one. For example:
|
||||
You can also skip the publishing to the **Docker Hub** by replacing the `all` command by the `all-no-push` one.
|
||||
For example:
|
||||
|
||||
```shell
|
||||
### image 'latest-fugo' will be skipped if the 'latest' image doesn't need a re-build
|
||||
@@ -242,7 +252,8 @@ You can also skip the publishing to the **Docker Hub** by replacing the `all` co
|
||||
|
||||
### Log processing
|
||||
|
||||
The **log processing** mode is intended for evaluating the outcome of the latest image building session. The result are extracted from the **ci-builder log** by `grep` utility.
|
||||
The **log processing** mode is intended for evaluating the outcome of the latest image building session.
|
||||
The result are extracted from the **ci-builder log** by `grep` utility.
|
||||
|
||||
The **log processing mode** usage pattern:
|
||||
|
||||
@@ -273,7 +284,8 @@ Built new 'headless-debian-g3:latest-firefox'.
|
||||
|
||||
#### Stickers command
|
||||
|
||||
The `stickers` command extracts the information about the **version stickers** of the ephemeral helper images that have been built by the `pre_build` hook script. That does not mean that the final persistent images have also been built (and optionally also published).
|
||||
The `stickers` command extracts the information about the **version stickers** of the ephemeral helper images that have been built by the `pre_build` hook script.
|
||||
That does not mean that the final persistent images have also been built (and optionally also published).
|
||||
|
||||
```shell
|
||||
./ci-builder.sh log get stickers
|
||||
|
||||
@@ -21,9 +21,12 @@ You can learn more about the concept on the sibling Wiki page ["Concepts of `g3-
|
||||
|
||||
### Ensure `wget` utility
|
||||
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility. It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility.
|
||||
It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
|
||||
On Windows you have generally two choices. You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows. Make sure to update also the `PATH` environment variable appropriately.
|
||||
On Windows you have generally two choices.
|
||||
You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows.
|
||||
Make sure to update also the `PATH` environment variable appropriately.
|
||||
|
||||
## Local `g3-cache`
|
||||
|
||||
@@ -45,9 +48,11 @@ The same shared `g3-cache` is usually used also by the sibling projects, for exa
|
||||
|
||||
## Helper script `cache`
|
||||
|
||||
Both `g3-caches` are refreshed by the helper script `cache`, which is stored in the folder `docker/hooks/`. Therefore it's sometimes referenced as a hook script.
|
||||
Both `g3-caches` are refreshed by the helper script `cache`, which is stored in the folder `docker/hooks/`.
|
||||
Therefore it's sometimes referenced as a hook script.
|
||||
|
||||
The script is used by the hook scripts `pre_build` and `build`. However, it can be executed also stand-alone.
|
||||
The script is used by the hook scripts `pre_build` and `build`.
|
||||
However, it can be executed also stand-alone.
|
||||
|
||||
**Remark**: The current implementation of the cache refreshing code is not thread safe and it is not intended for parallel building of multiple images.
|
||||
|
||||
|
||||
@@ -105,9 +105,12 @@ You can also use other ways to set the variables.
|
||||
|
||||
### Ensure `wget` utility
|
||||
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility. It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
If you are on Windows, you can encounter the problem of missing `wget` utility.
|
||||
It is used by refreshing the `g3-cache` and it's available on Linux by default.
|
||||
|
||||
On Windows you have generally two choices. You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows. Make sure to update also the `PATH` environment variable appropriately.
|
||||
On Windows you have generally two choices.
|
||||
You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows.
|
||||
Make sure to update also the `PATH` environment variable appropriately.
|
||||
|
||||
## Building pipeline
|
||||
|
||||
@@ -120,11 +123,14 @@ The actual building pipeline consists of the following hook scripts stored in th
|
||||
|
||||
The hook scripts are executed exactly in that order.
|
||||
|
||||
The **second version** (G3v2) of the pipeline introduced in the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] has added also the helper script `cache`, which ist stored in the same folder. It is used by the hook scripts `pre_build` and `build` and it refreshes the local `g3-cache`. It can be also executed stand-alone.
|
||||
The **second version** (G3v2) of the pipeline introduced in the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] has added also the helper script `cache`, which ist stored in the same folder.
|
||||
It is used by the hook scripts `pre_build` and `build` and it refreshes the local `g3-cache`.
|
||||
It can be also executed stand-alone.
|
||||
|
||||
Utilizing the local `g3-cache` brings a significant boost in the building performance and much shorter building times.
|
||||
|
||||
There is also the helper script `util-readme.sh`, stored in the folder `utils/`. This script can be used for preparing the `README` file for the **Docker Hub**.
|
||||
There is also the helper script `util-readme.sh`, stored in the folder `utils/`.
|
||||
This script can be used for preparing the `README` file for the **Docker Hub**.
|
||||
|
||||
## Three ways of building images
|
||||
|
||||
@@ -138,7 +144,9 @@ Since the **second version** (G3v2) of the building pipeline introduced in the s
|
||||
|
||||
### Building and publishing sets of images
|
||||
|
||||
Building and publishing of sets of images is pretty easy. Let's say that we want to refresh the images that feature the Firefox browser. We can do that by executing the following command:
|
||||
Building and publishing of sets of images is pretty easy.
|
||||
Let's say that we want to refresh the images that feature the Firefox browser.
|
||||
We can do that by executing the following command:
|
||||
|
||||
```shell
|
||||
### PWD = project's root directory
|
||||
@@ -159,7 +167,9 @@ You can find more information and examples in the separate `readme` file, descri
|
||||
|
||||
### Building and publishing individual images
|
||||
|
||||
Building and publishing of individual images is also very easy. Let's say we wan to refresh the image `accetto/debian-vnc-xfce-g3:latest`. We could execute the following command:
|
||||
Building and publishing of individual images is also very easy.
|
||||
Let's say we wan to refresh the image `accetto/debian-vnc-xfce-g3:latest`.
|
||||
We could execute the following command:
|
||||
|
||||
```shell
|
||||
### PWD = project's root directory
|
||||
@@ -178,7 +188,8 @@ You can find more information and examples in the separate `readme` file, descri
|
||||
|
||||
### Step-by-step building and publishing
|
||||
|
||||
The building pipeline can executed also step-by-step. The hook scripts in the folder `docker/hooks/` can be executed directly or also by using the utility script `builder.sh`.
|
||||
The building pipeline can executed also step-by-step.
|
||||
The hook scripts in the folder `docker/hooks/` can be executed directly or also by using the utility script `builder.sh`.
|
||||
|
||||
The script `builder.sh` is using the individual hook scripts internally.
|
||||
|
||||
@@ -204,7 +215,9 @@ This step builds the temporary helper image and creates the following temporary
|
||||
- `scrap-version_sticker-verbose_previous.tmp`
|
||||
- `scrap-demand-stop-building`
|
||||
|
||||
The file `scrap-demand-stop-building` is created only if the verbose version sticker hasn't changed since the last time it has been published on the builder repository's **GitHub Gist** and if the environment variable `FORCE_BUILDING` is not set to `1`. **Its presence will block** the next hook script `build` from building a new persistent image. If you want to force the image building, you can delete this file manually.
|
||||
The file `scrap-demand-stop-building` is created only if the verbose version sticker hasn't changed since the last time it has been published on the builder repository's **GitHub Gist** and if the environment variable `FORCE_BUILDING` is not set to `1`.
|
||||
**Its presence will block** the next hook script `build` from building a new persistent image.
|
||||
If you want to force the image building, you can delete this file manually.
|
||||
|
||||
The other option is to set the environment variable `FORCE_BUILDING=1` **before** executing the `pre_build` script.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user