├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── builder.sh ├── ci-builder.sh ├── docker ├── .dockerignore ├── Dockerfile ├── Dockerfile.xfce.nodejs ├── Dockerfile.xfce.nvm ├── Dockerfile.xfce.postman ├── Dockerfile.xfce.python ├── Dockerfile.xfce.vscode ├── README.md ├── doc │ └── images │ │ ├── Dockerfile.xfce.nodejs.png │ │ ├── Dockerfile.xfce.nvm.png │ │ ├── Dockerfile.xfce.png │ │ ├── Dockerfile.xfce.postman.png │ │ ├── Dockerfile.xfce.python-bonus.png │ │ ├── Dockerfile.xfce.python.png │ │ ├── Dockerfile.xfce.vscode.png │ │ ├── animation-headless-coding-nodejs-live.gif │ │ ├── animation-headless-coding-nvm-live.gif │ │ ├── animation-headless-coding-postman-live.gif │ │ ├── animation-headless-coding-python-live.gif │ │ └── animation-headless-coding-vscode-live.gif ├── hooks │ ├── build │ ├── cache │ ├── env.rc │ ├── helper │ ├── post_push │ ├── pre_build │ ├── push │ ├── release_of │ └── util.rc ├── src │ ├── home │ │ └── .bashrc │ ├── tests │ │ └── test-01.sh │ └── xfce-startup │ │ ├── help.rc │ │ ├── parser.rc │ │ ├── set_user_permissions.sh │ │ ├── startup.sh │ │ ├── user_generator.rc │ │ ├── version_of.sh │ │ ├── version_sticker.sh │ │ └── vnc_startup.rc ├── xfce-chromium │ └── src │ │ └── home │ │ ├── Desktop │ │ └── chromium-browser.desktop │ │ └── readme-chromium.md ├── xfce-firefox │ └── src │ │ ├── firefox.plus │ │ ├── home │ │ │ ├── Desktop │ │ │ │ ├── Copy FF Preferences.desktop │ │ │ │ └── FF Profile Manager.desktop │ │ │ └── readme-firefox-plus.md │ │ └── resources │ │ │ ├── accetto.svg │ │ │ ├── copy_firefox_user_preferences.sh │ │ │ └── user.js │ │ └── home │ │ └── Desktop │ │ └── firefox-esr.desktop ├── xfce-nodejs │ ├── README-dockerhub.md │ ├── README.md │ ├── readme-append.template │ └── src │ │ ├── home │ │ ├── readme-angular.md │ │ ├── readme-electron.md │ │ ├── readme-nodejs.md │ │ └── readme-typescript.md │ │ └── samples │ │ ├── electron-test-app │ │ ├── index.html │ │ ├── main.js │ │ ├── package.json │ │ └── readme.md │ │ └── nodejs-test-app │ │ ├── app.js │ │ └── readme.md ├── xfce-nvm │ ├── README-dockerhub.md │ ├── README.md │ └── readme-append.template ├── xfce-postman │ ├── README-dockerhub.md │ ├── README.md │ ├── readme-append.template │ └── src │ │ └── home │ │ ├── Desktop │ │ └── postman.desktop │ │ └── readme-postman-newman.md ├── xfce-python │ ├── README-dockerhub.md │ ├── README.md │ ├── readme-append.template │ └── src │ │ ├── home │ │ └── readme-python.md │ │ └── samples │ │ ├── bottle-test-app │ │ ├── app.py │ │ └── readme.md │ │ ├── flask-test-app │ │ ├── app.py │ │ └── readme.md │ │ ├── kivy-test-app │ │ ├── main.py │ │ └── readme.md │ │ ├── loguru-test-app │ │ ├── main.py │ │ └── readme.md │ │ ├── pyqt-test-app │ │ ├── main.py │ │ └── readme.md │ │ ├── pyside-test-app │ │ ├── main.py │ │ └── readme.md │ │ ├── tkinter-test-app │ │ ├── main.py │ │ └── readme.md │ │ ├── typer-cli-test-app │ │ ├── main.py │ │ └── readme.md │ │ └── wx-test-app │ │ ├── main.py │ │ └── readme.md ├── xfce-vscode │ ├── README-dockerhub.md │ ├── README.md │ ├── readme-append.template │ └── src │ │ ├── home │ │ └── Desktop │ │ │ └── code.desktop │ │ └── vscode │ │ └── data │ │ └── user-data │ │ └── User │ │ ├── keybindings.json │ │ └── settings.json └── xfce │ └── src │ └── home │ ├── Desktop │ └── versionsticker.desktop │ ├── config │ └── xfce4 │ │ ├── terminal │ │ └── terminalrc │ │ └── xfconf │ │ └── xfce-perchannel-xml │ │ ├── keyboard-layout.xml │ │ ├── thunar.xml │ │ └── xfwm4.xml │ └── readme.md ├── examples ├── Dockerfile.extend ├── example-override-envv.rc ├── example-secrets.rc └── example.yml ├── readme-builder.md ├── readme-ci-builder.md ├── readme-g3-cache.md ├── readme-local-building-example.md └── utils ├── readme-util-readme-examples.md └── util-readme.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # GitHub language detection 2 | # linguist-language, linguist-vendored, linguist-documentation, linguist-generated, linguist-detectable 3 | * linguist-documentation=true 4 | Dockerfile linguist-documentation=false 5 | Dockerfile linguist-language=Dockerfile 6 | Dockerfile linguist-detectable=true 7 | 8 | # Set default behaviour, in case users don't have core.autocrlf set. 9 | * text=auto 10 | 11 | # Explicitly declare text files we want to always be normalized and converted 12 | # to native line endings on checkout. 13 | *.c text 14 | *.h text 15 | *.sah text 16 | *.suite text 17 | *.inc text 18 | *.js text 19 | *.json text 20 | 21 | # Declare files that will always have CRLF line endings on checkout. 22 | *.sln text eol=crlf 23 | 24 | # Denote all files that are truly binary and should not be modified. 25 | *.png binary 26 | *.jpg binary 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # blank lines are ignored 2 | # lines starting with '#' are ignored 3 | # starting patterns with '/' disables recursivity 4 | # ending patterns with '/' specifies directories 5 | # starting patterns with '!' negates them 6 | # standard glob patterns (shell patterns) work: 7 | # '*' matches zero oro more characters 8 | # '?' matches a single characters 9 | # '[abc]' matches the characters inside the brackets 10 | # '[0-9]' matches the characters inside the brackets 11 | # '**' matches nested directories (e.g. 'a/**/z') 12 | # recommended files on 'https://github.com/github/gitignore' 13 | 14 | .vscode 15 | .cache* 16 | .g3-cache* 17 | .secret* 18 | .util* 19 | .vscode 20 | scrap* 21 | secret* 22 | TODO* 23 | *.log 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 accetto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /builder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | ### depends on the hook scripts 4 | ### set the environment variables first, e.g. 'source .secrets' 5 | 6 | ### usage: './ [build-options]' 7 | 8 | die() { 9 | local message="${1:-(unknown)}" 10 | local -i code=${2:-1} 11 | local place="${3:-$0}" 12 | 13 | echo -e "EXITING at line "${BASH_LINENO[0]}" in '${place}' with code ${code}: ${message}" >&2 14 | exit ${code} 15 | } 16 | 17 | clear_log() { 18 | 19 | ### just for debugging 20 | # cp -f "${_ci_builder_log}" "${_ci_builder_log}_copy" 21 | 22 | >"${_builder_log}" 23 | echo -e "\n==> EXECUTING @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 24 | } 25 | 26 | show_error() { 27 | 28 | echo -e "\nERROR in ${0}: ${@:-(unknown)}\n" >&2 29 | } 30 | 31 | show_unlogged_help() { 32 | 33 | # help is never logged 34 | exec 1>&- 35 | { 36 | cat < [] 44 | 45 | blend := (((nodejs|nodejs-vscode|nvm|nvm-vscode|postman|python|python-vscode|vscode)[-(chromium|firefox)]))|nodejs-current) 46 | command := (all|all-no-push)|(pre_build|build|push|post_push|cache) 47 | 48 | The (e.g. '--no-cache') are passed to the Docker CLI commands used internally. 49 | 50 | The script creates a complete execution log. 51 | EOT 52 | } >&3 53 | } 54 | 55 | main() { 56 | 57 | if [[ $# -eq 0 ]]; then 58 | 59 | show_unlogged_help 60 | return 0 61 | fi 62 | 63 | if [[ "${1}" == "-h" || "${1}" =~ help ]]; then 64 | 65 | show_unlogged_help 66 | return 0 67 | fi 68 | 69 | local blend=${1} 70 | local cmd=${2} 71 | 72 | if [[ $# -ge 2 ]]; then shift 2; fi 73 | 74 | local -a all_pipeline 75 | local -i exit_code=0 76 | 77 | case "${cmd}" in 78 | 79 | pre_build | build | push | post_push | cache) 80 | 81 | clear_log 82 | "${_build_context}"/hooks/"${cmd}" dev "${blend}" $@ 83 | exit_code=$? 84 | if [[ ${exit_code} -ne 0 ]]; then 85 | die "Hook script '${cmd}' failed with code ${exit_code}." ${exit_code} 86 | fi 87 | ;; 88 | 89 | all | all-no-push) 90 | 91 | clear_log 92 | "${_build_context}"/hooks/pre_build dev "${blend}" $@ 93 | exit_code=$? 94 | if [[ ${exit_code} -ne 0 ]]; then 95 | die "Hook script 'pre_build' failed with code ${exit_code}." ${exit_code} 96 | fi 97 | 98 | if [[ ! -f "${_build_context}"/scrap-demand-stop-building ]]; then 99 | 100 | case "${cmd}" in 101 | all-no-push) all_pipeline=("build") ;; 102 | all) all_pipeline=("build" "push" "post_push") ;; 103 | 104 | *) 105 | show_error "Unknown command: '${cmd}'" 106 | ;; 107 | esac 108 | 109 | for c in ${all_pipeline[@]}; do 110 | 111 | echo 112 | echo "==> ${c} '${blend}'" 113 | echo 114 | 115 | "${_build_context}"/hooks/"${c}" dev "${blend}" $@ 116 | exit_code=$? 117 | if [[ ${exit_code} -ne 0 ]]; then 118 | die "Hook script '${c}' failed with code ${exit_code}." ${exit_code} 119 | fi 120 | done 121 | 122 | echo 123 | case "${cmd}" in 124 | 125 | all-no-push) 126 | echo "==> Built '${blend}'" 127 | ;; 128 | all) 129 | echo "==> Published '${blend}'" 130 | ;; 131 | *) 132 | show_error "Unknown command: '${cmd}'" 133 | ;; 134 | esac 135 | echo 136 | 137 | else 138 | echo 139 | echo "==> No build needed for '${blend}'" 140 | echo 141 | fi 142 | ;; 143 | 144 | *) 145 | show_error "Invalid arguments '${blend}' '${cmd}'" 146 | ;; 147 | esac 148 | 149 | echo -e "\n==> FINISHED @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 150 | } 151 | 152 | declare _build_context="./docker" 153 | 154 | declare _builder_log="scrap_builder.log" 155 | 156 | ### duplicate 'stdout' so we can close it when displaying help 157 | exec 3>&1 158 | 159 | ### main entry point 160 | declare -i __exit_code=0 161 | main $@ 2>&1 | tee -a "${_builder_log}" 162 | __exit_code=${PIPESTATUS[0]} 163 | 164 | exit ${__exit_code} 165 | -------------------------------------------------------------------------------- /docker/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !src 3 | !xfce* 4 | !.g3-cache 5 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # This is just a placeholder. The actual Dockerfile will be set by the hook scripts. 2 | # Having this file allows to keep the default 'Dockerfile' value in the build rules on Docker Hub. 3 | 4 | FROM scratch 5 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # README placeholder 2 | 3 | This is only a README placeholder, which will be replaced by the image deployment workflow. 4 | 5 | Useful links from **this project's** GitHub repository [accetto/headless-coding-g3][this-home]: 6 | 7 | - project [Readme][this-readme], [Changelog][this-changelog], [Issues][this-issues], [sibling Wiki][sibling-wiki] and [sibling Discussions][sibling-discussions] 8 | - images with **Node.js** 9 | - [Readme][this-readme-image-nodejs] file on GitHub 10 | - [image repository][this-dockerhub-image-nodejs] on Docker Hub 11 | - [Dockerfile][this-dockerfile-nodejs] on GitHub 12 | - [Dockerfile stages diagram][this-diagram-dockerfile-stages-nodejs] on GitHub 13 | - images with **Postman** 14 | - [Readme][this-readme-image-postman] file on GitHub 15 | - [image repository][this-dockerhub-image-postman] on Docker Hub 16 | - [Dockerfile][this-dockerfile-postman] on GitHub 17 | - [Dockerfile stages diagram][this-diagram-dockerfile-stages-postman] on GitHub 18 | - images with **Python** 19 | - [Readme][this-readme-image-python] file on GitHub 20 | - [image repository][this-dockerhub-image-python] on Docker Hub 21 | - [Dockerfile][this-dockerfile-python] on GitHub 22 | - [Dockerfile stages diagram][this-diagram-dockerfile-stages-python] on GitHub 23 | - bonus images with **Python** and GUI frameworks 24 | - [Dockerfile][this-dockerfile-python-bonus-gui-frameworks] on GitHub (branch `bonus-images-python-gui-frameworks`) 25 | - [Dockerfile stages diagram][this-diagram-dockerfile-stages-python-bonus] (bonus branch) on GitHub 26 | - images with **Visual Studio Code** 27 | - [Readme][this-readme-image-vscode] file on GitHub 28 | - [image repository][this-dockerhub-image-vscode] on Docker Hub 29 | - [Dockerfile][this-dockerfile-vscode] on GitHub 30 | - [Dockerfile stages diagram][this-diagram-dockerfile-stages-vscode] on GitHub 31 | 32 | *** 33 | 34 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 35 | [this-home]: https://github.com/accetto/headless-coding-g3 36 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 37 | [this-readme]: https://github.com/accetto/headless-coding-g3/blob/master/README.md 38 | 39 | [this-dockerfile-nodejs]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.nodejs 40 | [this-readme-image-nodejs]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-nodejs/README.md 41 | [this-dockerhub-image-nodejs]: https://hub.docker.com/r/accetto/debian-vnc-xfce-nodejs-g3 42 | 43 | [this-dockerfile-postman]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.postman 44 | [this-readme-image-postman]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-postman/README.md 45 | [this-dockerhub-image-postman]: https://hub.docker.com/r/accetto/debian-vnc-xfce-postman-g3 46 | 47 | [this-dockerfile-python]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.python 48 | [this-dockerfile-python-bonus-gui-frameworks]: https://github.com/accetto/headless-coding-g3/blob/bonus-images-python-gui-frameworks/docker/Dockerfile.xfce.python 49 | [this-readme-image-python]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-python/README.md 50 | [this-dockerhub-image-python]: https://hub.docker.com/r/accetto/debian-vnc-xfce-python-g3 51 | 52 | [this-dockerfile-vscode]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.vscode 53 | [this-readme-image-vscode]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-vscode/README.md 54 | [this-dockerhub-image-vscode]: https://hub.docker.com/r/accetto/debian-vnc-xfce-vscode-g3 55 | 56 | [this-diagram-dockerfile-stages-nodejs]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.nodejs.png 57 | [this-diagram-dockerfile-stages-postman]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.postman.png 58 | [this-diagram-dockerfile-stages-python]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.python.png 59 | [this-diagram-dockerfile-stages-python-bonus]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.python-bonus.png 60 | [this-diagram-dockerfile-stages-vscode]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.vscode.png 61 | 62 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 63 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 64 | -------------------------------------------------------------------------------- /docker/doc/images/Dockerfile.xfce.nodejs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/Dockerfile.xfce.nodejs.png -------------------------------------------------------------------------------- /docker/doc/images/Dockerfile.xfce.nvm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/Dockerfile.xfce.nvm.png -------------------------------------------------------------------------------- /docker/doc/images/Dockerfile.xfce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/Dockerfile.xfce.png -------------------------------------------------------------------------------- /docker/doc/images/Dockerfile.xfce.postman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/Dockerfile.xfce.postman.png -------------------------------------------------------------------------------- /docker/doc/images/Dockerfile.xfce.python-bonus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/Dockerfile.xfce.python-bonus.png -------------------------------------------------------------------------------- /docker/doc/images/Dockerfile.xfce.python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/Dockerfile.xfce.python.png -------------------------------------------------------------------------------- /docker/doc/images/Dockerfile.xfce.vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/Dockerfile.xfce.vscode.png -------------------------------------------------------------------------------- /docker/doc/images/animation-headless-coding-nodejs-live.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/animation-headless-coding-nodejs-live.gif -------------------------------------------------------------------------------- /docker/doc/images/animation-headless-coding-nvm-live.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/animation-headless-coding-nvm-live.gif -------------------------------------------------------------------------------- /docker/doc/images/animation-headless-coding-postman-live.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/animation-headless-coding-postman-live.gif -------------------------------------------------------------------------------- /docker/doc/images/animation-headless-coding-python-live.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/animation-headless-coding-python-live.gif -------------------------------------------------------------------------------- /docker/doc/images/animation-headless-coding-vscode-live.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/accetto/headless-coding-g3/2db9ad96c0f1cb14094a1c7aa02d5015aea3553e/docker/doc/images/animation-headless-coding-vscode-live.gif -------------------------------------------------------------------------------- /docker/hooks/helper: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # echo -e "\n==> EXECUTING @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 4 | 5 | declare _mydir=$(dirname $0) 6 | source "${_mydir}"/env.rc 7 | 8 | get_builder_image_name() { 9 | echo "${DOCKER_REPO}:${_deploy_builder_tags[0]}" 10 | } 11 | 12 | get_deployment_image_name() { 13 | echo "${_deploy_repo}:${_deploy_tags[0]}" 14 | } 15 | 16 | main() { 17 | local cmd="${1?Need command}" 18 | 19 | if [[ "${cmd}" == "help" ]]; then 20 | 21 | cat < 26 | 27 | := (any|dev|(or see 'env.rc')) 28 | (any|(or see 'env.rc')) 29 | := (help|--help|-h) 30 | (list-target|list-build-target|list-deploy-target) 31 | (pull|pull-deploy-target|pull-build-target) 32 | EOT 33 | 34 | return 0 35 | fi 36 | 37 | case "${cmd}" in 38 | list | list-targets) 39 | echo "Build target => $(get_builder_image_name)" 40 | echo "Deploy target => $(get_deployment_image_name)" 41 | # echo "Build image: $(get_builder_image_name)" 42 | # echo "Deploy image: $(get_deployment_image_name)" 43 | ;; 44 | 45 | list-build-target) 46 | echo "Build target => $(get_builder_image_name)" 47 | ;; 48 | 49 | list-deploy-target) 50 | echo "Deploy target => $(get_deployment_image_name)" 51 | ;; 52 | 53 | pull | pull-deploy-target) 54 | echo 55 | echo "Pulling deploy targets... $(get_deployment_image_name)" 56 | docker pull "$(get_deployment_image_name)" 57 | ;; 58 | 59 | pull-build-target) 60 | echo 61 | echo "Pulling build targets... $(get_builder_image_name)" 62 | echo docker pull "$(get_builder_image_name)" 63 | ;; 64 | 65 | *) 66 | die "Unknown command '${cmd}'." 67 | ;; 68 | esac 69 | } 70 | 71 | main $@ 72 | 73 | # echo -e "\n==> FINISHED @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 74 | -------------------------------------------------------------------------------- /docker/hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### 2022-09-11 Warning 4 | ### It seems like the README publishing is currently not always working. 5 | ### Some changes on the Docker Hub side seem to be the reason. 6 | ### However, you can always copy the content generated by the utility 7 | ### 'util-readme.sh' ('preview' command) to the Docker Hub manually. 8 | 9 | echo -e "\n==> EXECUTING @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 10 | 11 | declare _mydir=$(dirname $0) 12 | source "${_mydir}"/env.rc 13 | source "${_mydir}"/util.rc 14 | 15 | main() { 16 | ### There is a GitHub Gist containing the endpoints for the badges. 17 | ### Updating the GitHub Gist can be skipped by *not* setting the environment variable GIST_TOKEN. 18 | ### Warning! The value of the GIST_TOKEN is a real secret. 19 | ### The personal access token (PAT) should be created on the GitHub and it requires the 'gist' scope. 20 | 21 | local created 22 | local version_sticker 23 | local version_sticker_verbose 24 | local repo_building="${DOCKER_REPO##*/}" 25 | local repo_deploy="${_deploy_repo##*/}" 26 | local keeper_repo_tag="${_deploy_builder_tags[0]}" 27 | 28 | if [[ ! -f "${_build_context}/${_scrap_demand_stop_building}" ]]; then 29 | 30 | ### essential environment variables must be already set 31 | if [[ -n "${GIST_TOKEN}" && -n "${GIST_ID}" && -n "${DEPLOY_GIST_ID}" ]]; then 32 | 33 | if [[ (-n "${repo_deploy}" && "${repo_deploy}" != "${_prohibited_repo_name}") || \ 34 | ("${FORCE_PUBLISHING_BUILDER_REPO:-0}" == "1" && -n "${repo_building}" && "${repo_building}" != "${_prohibited_repo_name}") ]]; then 35 | 36 | ### get values for badges from the image metadata (labels) - try the builder image first 37 | ensure_image "${DOCKER_REPO}:${keeper_repo_tag}" 38 | if [[ $? -eq 0 ]]; then 39 | 40 | ### builder image found 41 | echo "Getting badge values from builder image '${DOCKER_REPO}:${keeper_repo_tag}'." 42 | 43 | created=$(get_label "${DOCKER_REPO}:${keeper_repo_tag}" "org.opencontainers.image.created") 44 | version_sticker=$(get_label "${DOCKER_REPO}:${keeper_repo_tag}" "any.accetto.version-sticker") 45 | 46 | echo Wait... generating verbose sticker file "'${_build_context}/${_scrap_version_sticker_verbose_current}'" 47 | docker run --rm "${DOCKER_REPO}:${keeper_repo_tag}" --version-sticker-verbose >"${_build_context}/${_scrap_version_sticker_verbose_current}" 48 | 49 | else 50 | echo "Missing builder image '${DOCKER_REPO}:${keeper_repo_tag}'." 51 | 52 | ### try the deployment image instead (e.g. it could be downloaded manually) 53 | ensure_image "${_deploy_repo}:${_deploy_tags[0]}" 54 | if [[ $? -eq 0 ]]; then 55 | 56 | ### deployment image found 57 | echo "Getting badge values from deployment image '${DOCKER_REPO}:${_deploy_tags[0]}'." 58 | 59 | created=$(get_label "${_deploy_repo}:${_deploy_tags[0]}" "org.opencontainers.image.created") 60 | version_sticker=$(get_label "${_deploy_repo}:${_deploy_tags[0]}" "any.accetto.version-sticker") 61 | 62 | echo Wait... generating current verbose sticker file "'${_build_context}/${_scrap_version_sticker_verbose_current}'" 63 | docker run --rm "${_deploy_repo}:${_deploy_tags[0]}" --version-sticker-verbose >"${_build_context}/${_scrap_version_sticker_verbose_current}" 64 | else 65 | ### no suitable image found - unable to update badge endpoints 66 | echo "Missing deployment image '${_deploy_repo}:${_deploy_tags[0]}'." 67 | 68 | echo "Skipping gist update. Unable to get values for badges." 69 | fi 70 | fi 71 | 72 | if [[ -n "${created}" ]]; then 73 | 74 | version_sticker_verbose=$(cat "${_build_context}/${_scrap_version_sticker_verbose_current}") 75 | 76 | # echo 77 | echo "Badge 'created': ${created}" 78 | echo "Badge 'version_sticker': ${version_sticker}" 79 | echo "Badge 'version_sticker_verbose':" 80 | echo "${version_sticker_verbose}" 81 | echo 82 | 83 | ### update badge endpoints in the builder repository gist 84 | for t in "${_deploy_builder_tags[@]}"; do 85 | 86 | echo 87 | echo "Updating builder gists for '${DOCKER_REPO}:${t}'" 88 | 89 | update_gist "${GIST_ID}" "${_gist_key_created}" "${DOCKER_REPO}" "${t}" "${created}" 90 | update_gist "${GIST_ID}" "${_gist_key_version_sticker}" "${DOCKER_REPO}" "${t}" "${version_sticker}" 91 | update_gist "${GIST_ID}" "${_gist_key_version_sticker_verbose}" "${DOCKER_REPO}" "${t}" "${version_sticker_verbose}" 92 | done 93 | fi 94 | else 95 | echo "Skipping builder gist update because of null or prohibited target repositories." 96 | fi 97 | 98 | ### update badge endpoints for all tags in the deployment repository 99 | if [[ -n "${created}" ]]; then 100 | 101 | if [[ -n "${repo_deploy}" && "${repo_deploy}" != "${_prohibited_repo_name}" ]]; then 102 | 103 | for t in "${_deploy_tags[@]}"; do 104 | 105 | ### note that the builder and deployment repositories could be identical 106 | ### in that case skip the tag which has been already published above 107 | if [[ "${DOCKER_REPO}" != "${_deploy_repo}" || "${keeper_repo_tag}" != "${t}" ]]; then 108 | 109 | echo 110 | echo "Updating deployment gists for '${_deploy_repo}:${t}'" 111 | 112 | update_gist "${DEPLOY_GIST_ID}" "${_gist_key_created}" "${_deploy_repo}" "${t}" "${created}" 113 | update_gist "${DEPLOY_GIST_ID}" "${_gist_key_version_sticker}" "${_deploy_repo}" "${t}" "${version_sticker}" 114 | update_gist "${DEPLOY_GIST_ID}" "${_gist_key_version_sticker_verbose}" "${_deploy_repo}" "${t}" "${version_sticker_verbose}" 115 | fi 116 | done 117 | else 118 | echo -e "\nSkipping update of deployment gist because of null or prohibited deployment repository.\n" 119 | fi 120 | fi 121 | else 122 | echo "Skipping gist update. Required variables not set." 123 | fi 124 | fi 125 | 126 | if [[ "${KEEP_HELPER_FILES}" != "1" ]]; then 127 | 128 | echo "Removing helper files" 129 | cleanup_scrap_files 130 | fi 131 | } 132 | 133 | main $@ 134 | 135 | echo -e "\n==> FINISHED @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 136 | -------------------------------------------------------------------------------- /docker/hooks/push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo -e "\n==> EXECUTING @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 4 | 5 | declare _mydir=$(dirname $0) 6 | source "${_mydir}"/env.rc 7 | source "${_mydir}"/util.rc 8 | 9 | deployment_push() { 10 | local target 11 | local repo="${_deploy_repo##*/}" 12 | local keeper_repo_tag="${_deploy_builder_tags[0]}" 13 | local -i exit_code=0 14 | 15 | if [[ -n "${repo}" && "${repo}" != "${_prohibited_repo_name}" ]] ; then 16 | 17 | ### push all target tags into the deployment repository 18 | for t in "${_deploy_tags[@]}" ; do 19 | 20 | ### note that the builder and deployment repositories could be identical 21 | ### in that case skip the tag which has been already published above 22 | if [[ "${DOCKER_REPO}" != "${_deploy_repo}" || "${keeper_repo_tag}" != "${t}" ]] ; then 23 | 24 | target="${_deploy_repo}:${t}" 25 | 26 | echo ; echo "Deploying image '${target}'" 27 | 28 | docker tag "${DOCKER_REPO}:${keeper_repo_tag}" "${target}" 29 | docker push "${target}" 30 | exit_code=$? 31 | docker rmi "${target}" 32 | 33 | if [[ ${exit_code} -ne 0 ]] ; then 34 | docker logout 35 | die "Unable to push image '${target}'" ${exit_code} 36 | fi 37 | fi 38 | done 39 | 40 | else 41 | echo "Skipping deployment repo push because of null or prohibited deployment repository '${repo}'." 42 | fi 43 | } 44 | 45 | main() { 46 | local target 47 | local repo="${DOCKER_REPO##*/}" 48 | local keeper_repo_tag="${_deploy_builder_tags[0]}" 49 | local -i exit_code=0 50 | 51 | if [[ -f "${_build_context}/${_scrap_demand_stop_building}" ]] ; then 52 | echo "Skipping push on demand." 53 | return 0 54 | fi 55 | 56 | ### Docker Hub log-in 57 | if [[ -n "${DOCKERHUB_USERNAME}" && -n "${DOCKERHUB_PASSWORD}" ]] ; then 58 | 59 | echo "Logging-in on Docker Hub" 60 | echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin 61 | 62 | if [[ ! $? ]] ; then 63 | 64 | echo "Docker Hub login failed" 65 | return 1 66 | fi 67 | 68 | else 69 | echo "Push requires Docker Hub login." 70 | echo "However, your environment does not provide required authentication data." 71 | return 1 72 | fi 73 | 74 | ### push images into the builder repository 75 | if [[ "${FORCE_PUBLISHING_BUILDER_REPO:-0}" == "1" ]] ; then 76 | 77 | if [[ -n "${repo}" && "${repo}" != "${_prohibited_repo_name}" ]] ; then 78 | 79 | ### push all target tags into the builder repository 80 | for t in "${_deploy_builder_tags[@]}" ; do 81 | 82 | echo ; echo "Pushing builder image ${DOCKER_REPO}:${t}" 83 | 84 | if [[ "${t}" == "${keeper_repo_tag}" ]] ; then 85 | 86 | # first element is the master repo (a keeper) 87 | docker push "${DOCKER_REPO}:${t}" 88 | exit_code=$? 89 | 90 | if [[ ${exit_code} -ne 0 ]] ; then 91 | docker logout 92 | die "Unable to push image '${DOCKER_REPO}:${t}'" ${exit_code} 93 | fi 94 | else 95 | target="${DOCKER_REPO}:${t}" 96 | 97 | docker tag "${DOCKER_REPO}:${keeper_repo_tag}" "${target}" 98 | docker push "${target}" 99 | exit_code=$? 100 | docker rmi "${target}" 101 | 102 | if [[ ${exit_code} -ne 0 ]] ; then 103 | docker logout 104 | die "Unable to push image '${target}'" ${exit_code} 105 | fi 106 | fi 107 | done 108 | 109 | else 110 | echo "Skipping forced builder repo push because of null or prohibited builder repository '${repo}'." 111 | fi 112 | fi 113 | 114 | ### push images into the deployment repository 115 | deployment_push 116 | 117 | ### Docker Hub log-out 118 | docker logout 119 | } 120 | 121 | main $@ 122 | 123 | echo -e "\n==> FINISHED @$(date -u +'%Y-%m-%d_%H-%M-%S'): ${0} $@\n" 124 | -------------------------------------------------------------------------------- /docker/hooks/release_of: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | main() { 4 | local version="$2" 5 | local result="" 6 | local response="" 7 | local truncateMax=1000 8 | 9 | case "$1" in 10 | 11 | nodejs-current ) 12 | # result=$(wget -qO- \ 13 | # result=$(curl -sLN \ 14 | # https://nodejs.org/en/feed/releases.xml \ 15 | # | grep '\(Current\)' \ 16 | # | sort -rV \ 17 | # | grep -Po -m1 '[0-9.]+' \ 18 | # ) 19 | response=$(curl -sLN https://nodejs.org/en/feed/releases.xml) 20 | if [[ -n "${response}" ]] ; then 21 | result=$(echo "${response}" | grep '\(Current\)' | sort -rV | grep -Po -m1 '[0-9.]+') 22 | fi 23 | ;; 24 | 25 | nodejs-lts ) 26 | # result=$(wget -qO- \ 27 | # result=$(curl -sLN \ 28 | # https://nodejs.org/en/feed/releases.xml \ 29 | # | grep '\(LTS\)' \ 30 | # | sort -rV \ 31 | # | grep -Po -m1 '[0-9.]+' \ 32 | # ) 33 | response=$(curl -sLN https://nodejs.org/en/feed/releases.xml) 34 | if [[ -n "${response}" ]] ; then 35 | result=$(echo "${response}" | grep '\(LTS\)' | sort -rV | grep -Po -m1 '[0-9.]+') 36 | fi 37 | ;; 38 | 39 | nvm ) 40 | # result=$(wget -qO- \ 41 | # result=$(curl -sLN -H "Accept: application/vnd.github.v3+json" \ 42 | # https://api.github.com/repos/nvm-sh/nvm/releases/latest \ 43 | # | grep -m1 "tag_name" \ 44 | # | grep -Po '[0-9.]+' 45 | # ) 46 | response=$(curl -sLN -H "Accept: application/vnd.github.v3+json" \ 47 | https://api.github.com/repos/nvm-sh/nvm/releases/latest \ 48 | ) 49 | if [[ -n "${response}" ]] ; then 50 | result=$(echo "${response}" | grep -m1 "tag_name" | grep -Po '[0-9.]+') 51 | fi 52 | ;; 53 | 54 | postman ) 55 | ### The 'Postman' version is locked to '10.13.6', the last one that still includes 'Scratch Pad'. 56 | ### The last 'Postman' version containing Scratch Pad is '10.13.6'. 57 | ### The first 'Postman' version not containing Scratch Pad is '10.14.2' (since May 15, 2023). 58 | result="10.13.6" 59 | 60 | # result=$(wget -qO- \ 61 | # result=$(curl -sLN -H "Accept: application/vnd.github.v3+json" \ 62 | # "https://dl.pstmn.io/api/version/latest?platform=linux64&channel=stable" \ 63 | # | grep -m1 "version" \ 64 | # | grep -Po '[0-9.]+' 65 | # ) 66 | # response=$(curl -sLN -H "Accept: application/vnd.github.v3+json" \ 67 | # "https://dl.pstmn.io/api/version/latest?platform=linux64&channel=stable") 68 | # if [[ -n "${response}" ]] ; then 69 | # result=$(echo "${response}" | grep -m1 "version" | grep -Po '[0-9.]+') 70 | # fi 71 | ;; 72 | 73 | vscode ) 74 | # result=$(wget -qO- \ 75 | # result=$(curl -sLN -H "Accept: application/vnd.github.v3+json" \ 76 | # https://api.github.com/repos/microsoft/vscode/releases/latest \ 77 | # | grep -m1 "tag_name" \ 78 | # | grep -Po '[0-9.]+' 79 | # ) 80 | response=$(curl -sLN -H "Accept: application/vnd.github.v3+json" \ 81 | https://api.github.com/repos/microsoft/vscode/releases/latest \ 82 | ) 83 | if [[ -n "${response}" ]] ; then 84 | result=$(echo "${response}" | grep -m1 "tag_name" | grep -Po '[0-9.]+') 85 | fi 86 | ;; 87 | 88 | vscode-file ) 89 | # result=$(wget -qO- \ 90 | # result="$(curl -sLNI https://update.code.visualstudio.com/${version:-latest}/linux-x64/stable \ 91 | # | grep -Po -m1 '(?<=location: )[^\r]+' 92 | # )" 93 | # result="${result##*/}" 94 | response=$(curl -sLNI https://update.code.visualstudio.com/${version:-latest}/linux-x64/stable) 95 | if [[ -n "${response}" ]] ; then 96 | result=$(echo ${response} | grep -i -Po -m1 '(?<=Location: )[^\r]+') 97 | fi 98 | result="${result##*/}" 99 | ;; 100 | 101 | 102 | * ) 103 | echo "Exiting '${0}' with code '1' because of unknown key '${1}'" 104 | return 1 105 | ;; 106 | 107 | esac 108 | 109 | if [[ -n "${result}" ]] ; then 110 | 111 | echo "${result}" 112 | else 113 | echo "ERROR: Exiting '${0}' with code '1' because unable to get version of '$1'" 114 | echo "ERROR: Unexpected HTTPS response (truncated to $truncateMax):" 115 | ### don't use quotes here 116 | echo ${response:0:truncateMax} 117 | return 1 118 | fi 119 | } 120 | 121 | main $@ 122 | -------------------------------------------------------------------------------- /docker/hooks/util.rc: -------------------------------------------------------------------------------- 1 | ### prefix for temporary scrap files 2 | declare _scrap_prefix=${SCRAP_PREFIX:-scrap-} 3 | 4 | ### temporary scrap helper files 5 | declare _scrap_version_sticker_current="${_scrap_prefix}version_sticker_current.tmp" 6 | declare _scrap_version_sticker_verbose_current="${_scrap_prefix}version_sticker-verbose_current.tmp" 7 | declare _scrap_version_sticker_verbose_previous="${_scrap_prefix}version_sticker-verbose_previous.tmp" 8 | declare _scrap_demand_stop_building="${_scrap_prefix}demand-stop-building" 9 | 10 | ### gist file keys 11 | declare _gist_key_created="created.json" 12 | declare _gist_key_version_sticker="version-sticker.json" 13 | declare _gist_key_version_sticker_verbose="version-sticker-verbose.txt" 14 | 15 | log() { 16 | ### Function to log messages with timestamps and log levels 17 | 18 | local level="$1" 19 | local message="$2" 20 | echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$level] $message" 21 | } 22 | 23 | validate_gist_token() { 24 | ### Function to check if GIST_TOKEN is set and has valid scope 25 | if [[ -z "${GIST_TOKEN:-}" ]]; then 26 | log "ERROR" "GIST_TOKEN is not set. Skipping gist update." 27 | exit 1 28 | fi 29 | 30 | # Test token scope 31 | local test_result 32 | test_result=$(curl -s -H "Authorization: token ${GIST_TOKEN}" https://api.github.com/rate_limit || echo "invalid") 33 | if [[ "${test_result}" == "invalid" ]]; then 34 | log "ERROR" "Invalid GIST_TOKEN or insufficient permissions." 35 | exit 1 36 | fi 37 | } 38 | 39 | cleanup_scrap_files() { 40 | rm -f "${_build_context}/${_scrap_prefix}"* 41 | } 42 | 43 | encode_json_quotes() { 44 | ### Encode double-quotes for use in JSON 45 | echo "${1//\"/\\\"}" 46 | } 47 | 48 | encode_json_newlines() { 49 | ### Encodes new-lines for use in JSON 50 | echo $(echo -e "${1}" | sed -z 's/\n/\\n/g') 51 | } 52 | 53 | ensure_image() { 54 | ### Checks if the given image exists. 55 | 56 | local image=${1?Need image} 57 | 58 | if [[ -n "$(docker image ls -q ${image})" ]]; then 59 | return 0 60 | else 61 | return 1 62 | fi 63 | } 64 | 65 | ensure_utility() { 66 | ### Checks availability of the given utility. 67 | ### It can be effectively disabled by providing 'enforced_error_code=0'. 68 | 69 | local util_name="${1?Need utility name}" 70 | local enforced_error_code=${2?Need enforced error code} 71 | 72 | if command -v "${util_name}" >/dev/null; then 73 | return 0 74 | else 75 | return ${enforced_error_code} 76 | fi 77 | } 78 | 79 | get_label() { 80 | ### Returning the given label value via the predefined global variable. 81 | 82 | local repotag="$1" 83 | local label="$2" 84 | 85 | echo $(docker inspect "${repotag}" --format='{{ index .Config.Labels "'${label}'" }}') 86 | } 87 | 88 | make_gist_filename() { 89 | ### Returns correctly formatted gist member file name 90 | 91 | local repo="${1?Need repo}" 92 | local tag="${2?Need repo tag}" 93 | local filename="${3?Need file name}" 94 | 95 | echo "$(basename ${repo})"@"${tag}"@"${filename}" 96 | } 97 | 98 | get_gist_file() { 99 | ### Gets the specified file from the secret gist. 100 | 101 | local gist=${1?Need gist ID} 102 | local repo="${2?Need repo}" 103 | local tag="${3?Need repo tag}" 104 | local filename="${4?Need file name}" 105 | local output_file="${5?Need output file}" 106 | 107 | local gist_filename 108 | local result 109 | 110 | gist_filename=$(make_gist_filename "${repo}" "${tag}" "${filename}") 111 | 112 | ### assumption: 'output_file' is the full file name correctly composed by the caller 113 | ### note that the dummy parameter '?$(date +%s)' is added to the URL to avoid caching 114 | # set -x 115 | result=$(curl -s \ 116 | -X GET \ 117 | --write-out "%{http_code}" \ 118 | -o "${output_file}" \ 119 | -H "Accept: application/vnd.github.v3+json" \ 120 | "https://gist.githubusercontent.com/${_owner}/${gist}/raw/${gist_filename}/?$(date +%s)") 121 | # set +x 122 | 123 | if [[ "${result}" == "200" ]]; then 124 | echo "Gist file '${gist_filename}' saved as '${output_file}'." 125 | return 0 126 | elif [[ "${result}" == "404" ]]; then 127 | echo 128 | echo "Gist file '${gist_filename}' not found." 129 | return 0 130 | else 131 | echo "Getting gist file '${gist_filename}' failed: ${result}" 132 | return 2 133 | fi 134 | } 135 | 136 | list_labels() { 137 | ### Listing all image labels. 138 | ### Just debugging support. 139 | 140 | local repotag="$1" 141 | 142 | # docker inspect "${repotag}" --format='{{println}} {{ range $k, $v := .Config.Labels -}} {{ $k }}={{ $v }} {{println}} {{end -}}' 143 | 144 | docker inspect "${repotag}" --format=' 145 | {{ range $k, $v := .Config.Labels -}} 146 | {{ $k }}={{ $v }} 147 | {{end -}}' 148 | } 149 | 150 | update_gist() { 151 | ### Updating the secret GitHub gist containing data (e.g. badge endpoints). 152 | ### 'GIST_TOKEN' secret (PAT) with the 'gist' scope is required 153 | local gist=${1?Need gist ID} 154 | local gist_key="${2?Need gist key}" 155 | local repo="${3?Need repo}" 156 | local tag="${4?Need repo tag}" 157 | local content="${5?Need content}" 158 | 159 | local data 160 | local envelope 161 | local gist_filename 162 | local result 163 | 164 | if [[ -z "${GIST_TOKEN}" ]]; then 165 | 166 | echo "Skipping gist update. Required variables not set." 167 | return 0 168 | fi 169 | 170 | case "${gist_key}" in 171 | "${_gist_key_created}") 172 | 173 | envelope='{"schemaVersion": 1,"label":"created","message":"'${content}'","color":"blue"}' 174 | ;; 175 | 176 | "${_gist_key_version_sticker}") 177 | 178 | envelope='{"schemaVersion": 1,"label":"version sticker","message":"'${content}'","color":"blue"}' 179 | ;; 180 | 181 | "${_gist_key_version_sticker_verbose}") 182 | 183 | envelope="${content}" 184 | ;; 185 | *) 186 | echo "Skipping gist update. Unsupported gist key '${gist_key}'." 187 | return 0 188 | ;; 189 | esac 190 | 191 | gist_filename=$(make_gist_filename "${repo}" "${tag}" "${gist_key}") 192 | 193 | ### encode double-quotes 194 | # envelope="${envelope//\"/\\\"}" 195 | envelope=$(encode_json_quotes "${envelope}") 196 | 197 | ### encode new-lines 198 | # envelope=$( echo "${envelope}" | sed -z 's/\n/\\n/g' ) 199 | ### be careful with quotes! 200 | envelope=$(encode_json_newlines "${envelope}") 201 | 202 | data='{ "files": { "'${gist_filename}'": { "filename": "'${gist_filename}'", "content": "'${envelope}'" } } }' 203 | 204 | echo "Updating gist '${gist_filename}'" 205 | 206 | local max_retries=3 207 | local retry_delay=5 # seconds 208 | 209 | ### required 'GIST_TOKEN' (PAT) scope is 'gist' 210 | 211 | for attempt in $(seq 1 ${max_retries}); do 212 | echo "Attempt ${attempt} of ${max_retries}..." 213 | 214 | result=$(curl -s \ 215 | -X PATCH \ 216 | -o /dev/null \ 217 | --write-out "%{http_code}" \ 218 | -H "Authorization: token ${GIST_TOKEN}" \ 219 | -H "Accept: application/vnd.github.v3+json" \ 220 | https://api.github.com/gists/${gist} \ 221 | -d "${data}") 222 | 223 | if [[ "${result}" == "200" ]]; then 224 | echo "Gist '${gist_filename}' updated successfully on attempt ${attempt}" 225 | return 0 226 | fi 227 | 228 | echo "Attempt '${attempt}' failed with HTTP code: ${result}. Retrying in ${retry_delay} seconds..." 229 | sleep ${retry_delay} 230 | done 231 | 232 | echo "ERROR: Gist update failed after ${max_retries} attempts." 233 | return 1 234 | } 235 | -------------------------------------------------------------------------------- /docker/src/home/.bashrc: -------------------------------------------------------------------------------- 1 | ### some examples of custom aliases 2 | 3 | alias ll="ls -l" 4 | 5 | ### clear terminal window 6 | alias cls='printf "\033c"' 7 | 8 | ### change terminal prompt text 9 | fn_ps1() { 10 | if [ $# -gt 0 ] ; then 11 | ### given value in bold green 12 | PS1="\[\033[01;32m\]$1\[\033[00m\]> " 13 | else 14 | ### basename of the current working directory in bold blue 15 | PS1='\[\033[01;34m\]\W\[\033[00m\]> ' 16 | fi 17 | } 18 | alias ps1='fn_ps1' 19 | -------------------------------------------------------------------------------- /docker/src/tests/test-01.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | main () { 3 | local -a list=() 4 | list+=("id") 5 | list+=("ls -l /etc/passwd /etc/group") 6 | list+=("tail -n2 /etc/passwd") 7 | list+=("tail -n2 /etc/group") 8 | list+=("ls -ld ${STARTUPDIR} /home ${HOME}") 9 | list+=("ls -l ${STARTUPDIR}") 10 | list+=("mkdir -p ${HOME}/new-dir") 11 | list+=("touch ${HOME}/new-file") 12 | list+=("ls -l ${HOME}") 13 | for t in "${list[@]}" ; do 14 | echo -e "+ ${t}" 15 | ${t} 16 | done 17 | } 18 | main | tee test-01.log 19 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/help.rc: -------------------------------------------------------------------------------- 1 | print_usage() { 2 | local readonly github_repo_url="https://github.com/accetto/headless-coding-g3" 3 | 4 | echo " 5 | CONTAINER USAGE: 6 | docker run [] accetto/: [] [] 7 | 8 | POSITIONAL ARGUMENTS: 9 | command 10 | Optional command with optional arguments. 11 | It will be executed during startup before going waiting, tailing or asleep. 12 | It is necessary to use the quotes correctly or the 'bash -c \"\"' pattern. 13 | 14 | STARTUP OPTIONS: 15 | 16 | --wait, or no options, or unknown option, or empty input 17 | Default background execution mode. 18 | Starts the VNC and noVNC servers, if available, then executes the command 19 | and waits until the VNC server process exits or goes asleep infinitely. 20 | Container keeps running in the background. 21 | 22 | --skip-startup 23 | Default foreground execution mode. 24 | Skips the startup procedure, executes the command and exits. 25 | Be aware that the container user generator will be also skipped. 26 | Container does not keep running in the background. 27 | 28 | --tail-null 29 | Alternative background execution mode. 30 | Similar to '--wait', but tails the null device instead of going asleep. 31 | Container keeps running in the background. 32 | 33 | --tail-vnc 34 | Alternative background execution mode. 35 | Similar to '--wait', but tails the VNC log instead of waiting until the VNC process exits. 36 | Falls back to '--tail-null' if the VNC server has not been started. 37 | Container keeps running in the background. 38 | 39 | --version-sticker 40 | Alternative foreground execution mode. 41 | Prints out the version sticker info. 42 | The VNC server is also started by default, if available, because some applications 43 | need a display to report their versions correctly. It can be suppressed by providing 44 | also '--skip-vnc'. The '--skip-novnc' option is always enforced automatically. 45 | Container does not keep running in the background. 46 | 47 | --version-sticker-verbose 48 | Alternative foreground execution mode. 49 | Similar to '--version-sticker', but prints out the verbose version sticker info and features list. 50 | Container does not keep running in the background. 51 | 52 | --skip-vnc 53 | Startup process modifier. 54 | If VNC and noVNC startup should be skipped. 55 | It also enforces '--skip-novnc'. 56 | 57 | --skip-novnc 58 | Startup process modifier. 59 | If noVNC startup should be skipped. 60 | It is also enforced by '--skip-vnc'. 61 | 62 | --debug 63 | Startup process modifier. 64 | If additional debugging info should be displayed during startup. 65 | It also enforces option '--verbose'. 66 | 67 | --verbose 68 | Startup process modifier. 69 | If startup progress messages should be displayed. 70 | It is also enforced by '--debug'. 71 | 72 | --help-usage, -H 73 | Prints out this extended container usage help and exits. 74 | The rest of the input is ignored. 75 | 76 | --help, -h 77 | Prints out the short startup script help and exits. 78 | The rest of the input is ignored. 79 | 80 | --version, -v 81 | Prints out the version of the startup script and exits. 82 | The rest of the input is ignored. 83 | 84 | Use '-h' or '--help' for short startup script help. 85 | Fore more information visit ${github_repo_url} 86 | " 87 | } 88 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/parser.rc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### If using 'accetto/argbash-docker' image, then rebuild as 'argbash parser.rc --strip user-content' 4 | ### Then test it as './startup.sh -v' or './startup.sh -h' or './startup.sh -H' 5 | 6 | # Created by argbash-init v2.8.1 7 | # ARG_VERSION([echo $(basename $0) v20.12.06]) 8 | # ARG_HELP([Container startup script],[Use '-H' or '--help-usage' for extended container usage help.\nFor more information visit https://github.com/accetto/headless-coding-g3]) 9 | # ARG_OPTIONAL_ACTION([help-usage],[H],[Extended container usage help.],[print_usage]) 10 | # 11 | # ARG_POSITIONAL_INF([command],[Optional command with optional arguments. It is executed during startup.]) 12 | # 13 | # ARG_POSITIONAL_DOUBLEDASH([]) 14 | # 15 | # ARG_OPTIONAL_BOOLEAN([wait],[],[Default background execution mode],[on]) 16 | # ARG_OPTIONAL_BOOLEAN([skip-startup],[],[Default foreground execution mode]) 17 | # 18 | # ARG_OPTIONAL_BOOLEAN([tail-null],[],[Alternative background execution mode]) 19 | # ARG_OPTIONAL_BOOLEAN([tail-vnc],[],[Alternative background execution mode]) 20 | # 21 | # ARG_OPTIONAL_BOOLEAN([version-sticker],[],[Alternative foreground execution mode]) 22 | # ARG_OPTIONAL_BOOLEAN([version-sticker-verbose],[],[Alternative foreground execution mode]) 23 | # 24 | # ARG_OPTIONAL_BOOLEAN([skip-vnc],[],[Startup process modifier]) 25 | # ARG_OPTIONAL_BOOLEAN([skip-novnc],[],[Startup process modifier]) 26 | # ARG_OPTIONAL_BOOLEAN([debug],[],[Startup process modifier]) 27 | # ARG_OPTIONAL_BOOLEAN([verbose],[],[Startup process modifier]) 28 | # 29 | # ARGBASH_GO() 30 | # needed because of Argbash --> m4_ignore([ 31 | ### START OF CODE GENERATED BY Argbash v2.8.1 one line above ### 32 | # Argbash is a bash code generator used to get arguments parsing right. 33 | # Argbash is FREE SOFTWARE, see https://argbash.io for more info 34 | 35 | 36 | die() 37 | { 38 | local _ret="${2:-1}" 39 | test "${_PRINT_HELP:-no}" = yes && print_help >&2 40 | echo "$1" >&2 41 | exit "${_ret}" 42 | } 43 | 44 | 45 | begins_with_short_option() 46 | { 47 | local first_option all_short_options='vhH' 48 | first_option="${1:0:1}" 49 | test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0 50 | } 51 | 52 | # THE DEFAULTS INITIALIZATION - POSITIONALS 53 | _positionals=() 54 | _arg_command=() 55 | # THE DEFAULTS INITIALIZATION - OPTIONALS 56 | _arg_wait="on" 57 | _arg_skip_startup="off" 58 | _arg_tail_null="off" 59 | _arg_tail_vnc="off" 60 | _arg_version_sticker="off" 61 | _arg_version_sticker_verbose="off" 62 | _arg_skip_vnc="off" 63 | _arg_skip_novnc="off" 64 | _arg_debug="off" 65 | _arg_verbose="off" 66 | 67 | 68 | print_help() 69 | { 70 | printf '%s\n' "Container startup script" 71 | printf 'Usage: %s [-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] [--] [] ... [] ...\n' "$0" 72 | printf '\t%s\n' ": Optional command with optional arguments. It is executed during startup." 73 | printf '\t%s\n' "-v, --version: Prints version" 74 | printf '\t%s\n' "-h, --help: Prints help" 75 | printf '\t%s\n' "-H, --help-usage: Extended container usage help." 76 | printf '\t%s\n' "--wait, --no-wait: Default background execution mode (on by default)" 77 | printf '\t%s\n' "--skip-startup, --no-skip-startup: Default foreground execution mode (off by default)" 78 | printf '\t%s\n' "--tail-null, --no-tail-null: Alternative background execution mode (off by default)" 79 | printf '\t%s\n' "--tail-vnc, --no-tail-vnc: Alternative background execution mode (off by default)" 80 | printf '\t%s\n' "--version-sticker, --no-version-sticker: Alternative foreground execution mode (off by default)" 81 | printf '\t%s\n' "--version-sticker-verbose, --no-version-sticker-verbose: Alternative foreground execution mode (off by default)" 82 | printf '\t%s\n' "--skip-vnc, --no-skip-vnc: Startup process modifier (off by default)" 83 | printf '\t%s\n' "--skip-novnc, --no-skip-novnc: Startup process modifier (off by default)" 84 | printf '\t%s\n' "--debug, --no-debug: Startup process modifier (off by default)" 85 | printf '\t%s\n' "--verbose, --no-verbose: Startup process modifier (off by default)" 86 | printf '\n%s\n' "Use '-H' or '--help-usage' for extended container usage help. 87 | For more information visit https://github.com/accetto/headless-coding-g3" 88 | } 89 | 90 | 91 | parse_commandline() 92 | { 93 | _positionals_count=0 94 | while test $# -gt 0 95 | do 96 | _key="$1" 97 | if test "$_key" = '--' 98 | then 99 | shift 100 | test $# -gt 0 || break 101 | _positionals+=("$@") 102 | _positionals_count=$((_positionals_count + $#)) 103 | shift $(($# - 1)) 104 | _last_positional="$1" 105 | break 106 | fi 107 | case "$_key" in 108 | -v|--version) 109 | echo $(basename $0) v20.12.06 110 | exit 0 111 | ;; 112 | -v*) 113 | echo $(basename $0) v20.12.06 114 | exit 0 115 | ;; 116 | -h|--help) 117 | print_help 118 | exit 0 119 | ;; 120 | -h*) 121 | print_help 122 | exit 0 123 | ;; 124 | -H|--help-usage) 125 | print_usage 126 | exit 0 127 | ;; 128 | -H*) 129 | print_usage 130 | exit 0 131 | ;; 132 | --no-wait|--wait) 133 | _arg_wait="on" 134 | test "${1:0:5}" = "--no-" && _arg_wait="off" 135 | ;; 136 | --no-skip-startup|--skip-startup) 137 | _arg_skip_startup="on" 138 | test "${1:0:5}" = "--no-" && _arg_skip_startup="off" 139 | ;; 140 | --no-tail-null|--tail-null) 141 | _arg_tail_null="on" 142 | test "${1:0:5}" = "--no-" && _arg_tail_null="off" 143 | ;; 144 | --no-tail-vnc|--tail-vnc) 145 | _arg_tail_vnc="on" 146 | test "${1:0:5}" = "--no-" && _arg_tail_vnc="off" 147 | ;; 148 | --no-version-sticker|--version-sticker) 149 | _arg_version_sticker="on" 150 | test "${1:0:5}" = "--no-" && _arg_version_sticker="off" 151 | ;; 152 | --no-version-sticker-verbose|--version-sticker-verbose) 153 | _arg_version_sticker_verbose="on" 154 | test "${1:0:5}" = "--no-" && _arg_version_sticker_verbose="off" 155 | ;; 156 | --no-skip-vnc|--skip-vnc) 157 | _arg_skip_vnc="on" 158 | test "${1:0:5}" = "--no-" && _arg_skip_vnc="off" 159 | ;; 160 | --no-skip-novnc|--skip-novnc) 161 | _arg_skip_novnc="on" 162 | test "${1:0:5}" = "--no-" && _arg_skip_novnc="off" 163 | ;; 164 | --no-debug|--debug) 165 | _arg_debug="on" 166 | test "${1:0:5}" = "--no-" && _arg_debug="off" 167 | ;; 168 | --no-verbose|--verbose) 169 | _arg_verbose="on" 170 | test "${1:0:5}" = "--no-" && _arg_verbose="off" 171 | ;; 172 | *) 173 | _last_positional="$1" 174 | _positionals+=("$_last_positional") 175 | _positionals_count=$((_positionals_count + 1)) 176 | ;; 177 | esac 178 | shift 179 | done 180 | } 181 | 182 | 183 | assign_positional_args() 184 | { 185 | local _positional_name _shift_for=$1 186 | _positional_names="" 187 | _our_args=$((${#_positionals[@]} - 0)) 188 | for ((ii = 0; ii < _our_args; ii++)) 189 | do 190 | _positional_names="$_positional_names _arg_command[$((ii + 0))]" 191 | done 192 | 193 | shift "$_shift_for" 194 | for _positional_name in ${_positional_names} 195 | do 196 | test $# -gt 0 || break 197 | eval "$_positional_name=\${1}" || die "Error during argument parsing, possibly an Argbash bug." 1 198 | shift 199 | done 200 | } 201 | 202 | parse_commandline "$@" 203 | assign_positional_args 1 "${_positionals[@]}" 204 | 205 | # OTHER STUFF GENERATED BY Argbash 206 | 207 | ### END OF CODE GENERATED BY Argbash (sortof) ### ]) 208 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/set_user_permissions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -e # do not use 3 | #set -u # do not use 4 | 5 | main() { 6 | local verbose="" 7 | 8 | if [[ -n "${DEBUG}" ]] ; then 9 | echo "Current user: $(id -u):$(id -g)" 10 | verbose="-v" 11 | fi 12 | 13 | ### Fix file permissions 14 | for i in "$@" ; do 15 | 16 | if [[ -n "${verbose}" ]] ; then 17 | 18 | echo "Fixing permissions for: ${i}" 19 | fi 20 | 21 | ### set directory permissions 22 | ### recursively, but skipping dot-directories in $HOME 23 | find "$i" -type d -not -path "${HOME}/.*" -exec chmod ${verbose} 755 {} + 24 | 25 | ### set file permissions 26 | ### recursively, but skipping dot-files and dot-directories in $HOME 27 | find "$i" -type f -not -path "${HOME}/.*" -exec chmod ${verbose} 644 {} + 28 | 29 | ### specific file permissions 30 | ### recursively, but skipping dot-directories in $HOME 31 | find "$i"/ -type f -not -path "${HOME}/.*" -name '*.sh' -exec chmod ${verbose} 744 {} + 32 | find "$i"/ -type f -not -path "${HOME}/.*" -name '*.desktop' -exec chmod ${verbose} 744 {} + 33 | done 34 | 35 | ### startup script is special 36 | chmod 755 "${STARTUPDIR}"/startup.sh 37 | } 38 | 39 | main $@ 40 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #set -e ### do not use this 4 | 5 | declare _mydir=$(dirname $0) 6 | 7 | source "${_mydir}"/help.rc 8 | source "${_mydir}"/parser.rc 9 | source "${_mydir}"/user_generator.rc 10 | source "${_mydir}"/vnc_startup.rc 11 | 12 | cleanup () { 13 | local readonly last_pid=$! 14 | 15 | ### also forwarding of shutdown signal 16 | if [[ -n "${last_pid}" || -n "${_wait_pid}" ]] ; then 17 | 18 | if [[ "${last_pid}" != "${_wait_pid}" ]] ; then 19 | 20 | if [[ -n "${_verbose}" ]] ; then 21 | 22 | echo "Killing last background PID '${last_pid}'" 23 | fi 24 | 25 | kill -s SIGTERM "${last_pid}" 26 | fi 27 | 28 | ### kill the PID the container is waiting on 29 | if [[ -n "${_wait_pid}" ]] ; then 30 | 31 | if [[ -n "${_verbose}" ]] ; then 32 | 33 | echo "Killing blocking PID '${_wait_pid}'" 34 | fi 35 | 36 | ### ignore the errors if not alive any more 37 | kill -s SIGTERM "${_wait_pid}" > /dev/null 2>&1 38 | fi 39 | fi 40 | 41 | die "$1" 0 42 | } 43 | 44 | execute_command() { 45 | 46 | if [[ -n "$@" ]] ; then 47 | 48 | if [[ -n "${_verbose}" ]] ; then 49 | 50 | echo "Executing startup command: $@" 51 | fi 52 | 53 | ### use 'eval' not 'exec' 54 | ### note the single space before the command! 55 | eval " $@" 56 | 57 | if [[ $? -ne 0 ]] ; then 58 | 59 | cleanup 60 | fi 61 | fi 62 | } 63 | 64 | envv_override() { 65 | 66 | local envv_override_file="${HOME}"/.override/.override_envv.rc 67 | local tmp="" 68 | 69 | ### only if the file is not empty 70 | if [[ -s "${envv_override_file}" ]] ; then 71 | 72 | tmp=$( mktemp ) 73 | 74 | ### only lines that begin with 'export ' and contain '=' 75 | ( grep -E '^export\s[^=]+[=]{1}' "${envv_override_file}" 2>/dev/null 1>"${tmp}" ) 76 | 77 | if [[ "${_verbose}" == "1" ]] ; then 78 | 79 | echo "Sourcing from file '${envv_override_file}'" 80 | cat "${tmp}" 81 | echo "End of file '${envv_override_file}'" 82 | fi 83 | 84 | source "${tmp}" 85 | rm -f "${tmp}" 86 | fi 87 | } 88 | 89 | main() { 90 | 91 | ### option interdependencies 92 | if [[ "${_arg_verbose}" == "on" || "${_arg_debug}" == "on" ]] ; then 93 | 94 | _verbose=1 95 | fi 96 | 97 | if [[ "${_arg_skip_vnc}" == "on" ]] ; then 98 | 99 | _arg_skip_novnc="on" 100 | fi 101 | 102 | if [[ "${_verbose}" == "1" ]] ; then 103 | 104 | echo -e "\nContainer '$(hostname)' started @$(date -u +'%Y-%m-%d_%H-%M-%S')" 105 | fi 106 | 107 | ### option "--debug" 108 | if [[ "${_arg_debug}" == "on" ]] ; then 109 | 110 | echo "Script: $0" 111 | echo "\${HOME}=${HOME}" 112 | 113 | echo "ls -la /" ; ls -la / 114 | echo "ls -ls /etc/passwd /etc/group" ; ls -ls /etc/passwd /etc/group 115 | echo "ls -la /home" ; ls -la /home 116 | echo "ls -la ${HOME}" ; ls -la "${HOME}" 117 | echo "ls -la ." ; ls -la . 118 | fi 119 | 120 | ### override environment variables only if enabled 121 | if [[ "${FEATURES_OVERRIDING_ENVV}" == "1" ]] ; then 122 | 123 | envv_override 124 | fi 125 | 126 | ### create container user 127 | if [[ -s "${STARTUPDIR}"/.initial_sudo_password ]] ; then 128 | 129 | generate_container_user 130 | fi 131 | 132 | if [[ "$?" != "0" ]] ; then 133 | 134 | echo "ERROR: Unable to generate user '$(id -u):$(id -g)'." 135 | cleanup 136 | fi 137 | 138 | ### options '--version-sticker' and '--version-sticker-verbose' 139 | if [[ "${_arg_version_sticker}" == "on" || "${_arg_version_sticker_verbose}" == "on" ]] ; then 140 | 141 | ### this handles also '--skip-vnc' and '--skip-novnc' options 142 | start_vnc 143 | 144 | ### do not use '_verbose' which can be forced by '--debug' 145 | if [[ "${_arg_version_sticker_verbose}" == "off" ]] ; then 146 | 147 | ### print out default version sticker 148 | "${STARTUPDIR}"/version_sticker.sh 149 | cleanup 150 | 151 | else 152 | ### print out verbose version sticker 153 | ### be sure to use capital '-V' 154 | "${STARTUPDIR}"/version_sticker.sh -f -V 155 | cleanup 156 | fi 157 | fi 158 | 159 | ### options '--tail-vnc' and '--tail-null' 160 | if [[ "${_arg_tail_vnc}" == "on" || ${_arg_tail_null} == "on" ]] ; then 161 | 162 | ### this handles also '--skip-vnc' and '--skip-novnc' options 163 | start_vnc 164 | 165 | ### command array expands to all elements quoted as a whole 166 | execute_command "${_arg_command[*]}" 167 | 168 | ### option '--tail-vnc' and VNC has been started 169 | if [[ ${_arg_tail_vnc} == "on" && -n "${_wait_pid}" ]] ; then 170 | 171 | ### tail the VNC log infinitely 172 | echo "Tailing VNC log '${_vnc_log}'" 173 | tail -f "${_vnc_log}" 174 | cleanup 175 | 176 | else 177 | 178 | ### tail the null device infinitely 179 | if [[ -n $"{_verbose}" ]] ; then 180 | 181 | echo "Tailing '/dev/null'" 182 | fi 183 | 184 | tail -f /dev/null 185 | cleanup 186 | fi 187 | fi 188 | 189 | ### default background execution mode 190 | ### be sure to end all previous branches by calling 'cleanup' 191 | ### option '--wait' is purely because of the parser 192 | 193 | ### this handles also '--skip-vnc' and '--skip-novnc' options 194 | start_vnc 195 | 196 | ### command array expands to all elements quoted as a whole 197 | execute_command "${_arg_command[*]}" 198 | 199 | if [[ -n "${_wait_pid}" ]] ; then 200 | 201 | ### VNC has been started - wait on its PID 202 | wait ${_wait_pid} 203 | else 204 | 205 | ### VNC not started - go asleep infinitely 206 | sleep infinity 207 | fi 208 | } 209 | 210 | ### MAIN ENTRY POINT 211 | 212 | if [[ -z "${DEBUGGER}" ]] ; then 213 | 214 | trap cleanup SIGINT SIGTERM ERR 215 | : ${HOME?} ${STARTUPDIR?} 216 | fi 217 | 218 | declare _novnc_log="${STARTUPDIR}"/novnc.log 219 | declare _verbose="" 220 | declare _vnc_log="${STARTUPDIR}"/vnc.log 221 | declare _wait_pid="" 222 | 223 | ### option '--skip-startup' 224 | if [[ "${_arg_skip_startup}" == "on" ]] ; then 225 | 226 | ### command array expands to all elements quoted as a whole 227 | execute_command "${_arg_command[*]}" 228 | 229 | else 230 | 231 | main $@ 232 | 233 | fi 234 | 235 | cleanup 236 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/user_generator.rc: -------------------------------------------------------------------------------- 1 | generate_container_user() { 2 | 3 | ### Adjusts the '/etc/passwd' and '/etc/group' files to cope with the randomly assigned IDs using 'docker run --user x:y'. 4 | ### Note that this code will be executed only once by the first start-up (see the if-condition and the end of the outer if-block). 5 | 6 | local user_id 7 | local group_id 8 | local headless_user_name 9 | local headless_group_name 10 | 11 | ### note that this block will be executed only once (see the end of the if-block) 12 | if [[ -w /etc/passwd ]] ; then 13 | 14 | user_id="$(id -u)" 15 | group_id="$(id -g)" 16 | headless_user_name="${HEADLESS_USER_NAME}" 17 | headless_group_name="${HEADLESS_USER_GROUP_NAME}" 18 | 19 | ### add the new group if the same GID does not exist yet 20 | if [[ "${group_id}" != "0" && "${group_id}" != "${HEADLESS_USER_GROUP_ID}" ]] ; then 21 | 22 | ### rename the existing 'headless_group_name' into 'g3builder' 23 | if [[ $( grep -c "${headless_group_name}:x:${HEADLESS_USER_GROUP_ID}:" /etc/group ) -ne 0 ]]; then 24 | 25 | cat /etc/group | sed -e "s/^${headless_group_name}:x:${HEADLESS_USER_GROUP_ID}:/g3builder:x:${HEADLESS_USER_GROUP_ID}:/" > /tmp/group 26 | 27 | cp /tmp/group /etc/ 28 | rm /tmp/group 29 | 30 | if [[ -n "${_verbose}" ]] ; then 31 | echo "Default user group '${headless_group_name}(${HEADLESS_USER_GROUP_ID})' renamed into 'g3builder(${HEADLESS_USER_GROUP_ID})' in '/etc/group'" 32 | fi 33 | fi 34 | 35 | ### add the current default user group ID as a new 'headless_group_name' if it does not exist yet 36 | if [[ $( grep -c -E ":x:${group_id}:$" /etc/group ) -eq 0 ]] ; then 37 | 38 | cat /etc/group > /tmp/group 39 | echo "${headless_group_name}:x:${group_id}:" >> /tmp/group 40 | 41 | cp /tmp/group /etc/ 42 | rm /tmp/group 43 | 44 | if [[ -n "${_verbose}" ]] ; then 45 | echo "Default user group '${headless_group_name}(${group_id})' added into '/etc/group'" 46 | fi 47 | fi 48 | fi 49 | 50 | ### user 'root (0)' is always created by default 51 | ### user 'headless_user_name' is created by Dockerfile 52 | if [[ "${user_id}" != "0" && "${user_id}" != "${HEADLESS_USER_ID}" ]] ; then 53 | 54 | ### rename the existing 'headless_user_name' into 'g3builder' 55 | if [[ $( grep -c "${headless_user_name}:x:${HEADLESS_USER_ID}:" /etc/passwd ) -ne 0 ]]; then 56 | 57 | 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 58 | 59 | cp /tmp/passwd /etc/ 60 | rm /tmp/passwd 61 | 62 | if [[ -n "${_verbose}" ]] ; then 63 | 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'" 64 | fi 65 | fi 66 | 67 | ### add the current default user ID as a new 'headless_user_name' if it does not exist yet 68 | if [[ $( grep -c "${headless_user_name}:x:${user_id}:" /etc/passwd ) -eq 0 ]] ; then 69 | 70 | cat /etc/passwd > /tmp/passwd 71 | echo "${headless_user_name}:x:${user_id}:${group_id}:Default:${HOME}:/bin/bash" >> /tmp/passwd 72 | 73 | cp /tmp/passwd /etc/ 74 | rm /tmp/passwd 75 | 76 | if [[ -n "${_verbose}" ]] ; then 77 | echo "Default user '${headless_user_name}(${user_id}:${group_id})' added into '/etc/passwd'" 78 | fi 79 | 80 | ### update the environment variables 81 | export HEADLESS_USER_ID=${user_id} 82 | export HEADLESS_USER_GROUP_ID=${group_id} 83 | fi 84 | fi 85 | 86 | if [[ -s "${STARTUPDIR}"/.initial_sudo_password ]] ; then 87 | 88 | ### make the newly created user the owner of the following folders including their content 89 | cat "${STARTUPDIR}"/.initial_sudo_password | sudo -S chown -R "${user_id}:${group_id}" "${STARTUPDIR}" "${HOME}" 2>/dev/null 90 | 91 | ### set the file permissions of the following to the system default and 92 | ### note that this will also disable this user generator for the future runs (see the outer if-condition above) 93 | cat "${STARTUPDIR}"/.initial_sudo_password | sudo -S chmod 644 /etc/passwd /etc/group 2>/dev/null 94 | 95 | ### remove the file containing the initial sudo password 96 | ### be aware that the initial sudo password is still part of the Docker image (see the image history and ARG_SUDO_PW) 97 | ### however, you can change it afterwards inside the container 98 | cat "${STARTUPDIR}"/.initial_sudo_password | sudo -S echo -n "" > "${STARTUPDIR}"/.initial_sudo_password 99 | fi 100 | fi 101 | } 102 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/version_of.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cSpell:disable 4 | 5 | case "$1" in 6 | angular | angular-cli | angularcli | ng ) 7 | ### source example: Angular CLI: 8.3.2 8 | echo $(ng --version 2>/dev/null | grep -Po -m1 '(?<=Angular CLI:\s)[0-9.]+') 9 | ;; 10 | chromium | chromium-browser) 11 | ### source example: Chromium 115.0.5790.170 built on Debian 12.1, running on Debian 12.1 12 | echo $(chromium --version 2>/dev/null | grep -Po -m1 '(?<=Chromium\s)[0-9.]+') 13 | ;; 14 | code | vsc | vscode | visual-studio-code | visualstudiocode ) 15 | ### source example: 1.37.1 16 | echo $(code --version 2>/dev/null | grep -Po -m1 '^[0-9.]+$') 17 | ;; 18 | curl ) 19 | ### source example: curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3 20 | echo $(curl --version 2>/dev/null | grep -Po -m1 '(?<=curl\s)[0-9.]+') 21 | ;; 22 | dconf-editor ) 23 | ### source example: dconf-editor 3.36.0 24 | echo $(dconf-editor --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 25 | ;; 26 | debian ) 27 | ### source example: 11 (bullseye) 28 | # echo $(cat /etc/os-release 2>/dev/null | grep -Po -m1 '(?<=VERSION\=")[0-9.]+') 29 | ### source example: 11.6 30 | echo $(cat /etc/debian_version 2>/dev/null | grep -Po -m1 '^[0-9.]+$') 31 | ;; 32 | drawio | drawio-desktop ) 33 | ### source example: 12.2.2 34 | echo $(drawio --no-sandbox --version 2>/dev/null | grep -Po -m1 '^[0-9.]+$') 35 | ;; 36 | fakeroot ) 37 | ### source example: fakeroot version 1.22 38 | echo $(fakeroot --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 39 | ;; 40 | firefox ) 41 | ### source example: Mozilla Firefox 68.0.2 42 | echo $(firefox -v 2>/dev/null | grep -Po -m1 '(?<=Firefox\s)[0-9a-zA-Z.-]+') 43 | ;; 44 | gimp ) 45 | ### source example: GNU Image Manipulation Program version 2.8.22 46 | echo $(gimp --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 47 | ;; 48 | gdebi ) 49 | ### source example: 0.9.5.7+nmu2 50 | echo $(gdebi --version 2>/dev/null | grep -Po -m1 '^[0-9.]+') 51 | ;; 52 | git ) 53 | ### source example: git version 2.17.1 54 | echo $(git --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 55 | ;; 56 | gpg ) 57 | ### source example: gpg (GnuPG) 2.2.19 58 | echo $(gpg --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 59 | ;; 60 | heroku | heroku-cli | herokucli ) 61 | ### source sample: heroku/7.29.0 linux-x64 node-v11.14.0 62 | echo $(heroku --version 2>/dev/null | grep -Po -m1 '(?<=heroku/)[0-9.]+') 63 | ;; 64 | inkscape ) 65 | ### Inkscape requires display! 66 | ### source sample: Inkscape 0.92.3 (2405546, 2018-03-11) 67 | echo $(inkscape --version 2>/dev/null | grep -Po -m1 '(?<=Inkscape\s)[0-9.]+') 68 | ;; 69 | jq ) 70 | ### source sample: jq-1.5-1-a5b5cbe 71 | echo $(jq --version 2>/dev/null | grep -Po -m1 '(?<=jq\-)[0-9.]+') 72 | ;; 73 | mousepad ) 74 | ### Mousepad requires display! 75 | ### source example: Mousepad 0.4.0 76 | echo $(mousepad --version 2>/dev/null | grep -Po -m1 '(?<=Mousepad\s)[0-9.]+') 77 | ;; 78 | nano ) 79 | ### source example: GNU nano, version 4.8 80 | echo $(nano --version 2>/dev/null | grep -Po -m1 '(?<=version\s)[0-9.]+') 81 | ;; 82 | nodejs | node-js | node ) 83 | ### source example: v10.16.3 84 | echo $(node --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 85 | ;; 86 | novnc | no-vnc ) 87 | ### source example: 1.1.0 88 | #echo $(cat "${NOVNC_HOME}"/VERSION 2>/dev/null | grep -Po '^[0-9.]+$') 89 | echo $(cat "${NOVNC_HOME}"/package.json 2>/dev/null | grep -Po -m1 '(?<=\s"version":\s")[0-9.]+') 90 | ;; 91 | npm ) 92 | ### source example: 6.9.0 93 | echo $(npm --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 94 | ;; 95 | nvm ) 96 | ### source example: 0.39.5 97 | if [ -f "${HOME}/.nvm/nvm.sh" ] ; then 98 | \. "${HOME}"/.nvm/nvm.sh && echo $(nvm --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 99 | fi 100 | ;; 101 | postman ) 102 | # jq -r '.version' /opt/Postman/app/resources/app/package.json 103 | if [[ -n "$(which postman)" && -n "$(which jq)" ]] ; then 104 | jq -r '.version' "${POSTMAN_PATH}"/Postman/app/resources/app/package.json 2>/dev/null 105 | fi 106 | ;; 107 | psql | postgresql | postgre-sql | postgre ) 108 | ### source example: psql (PostgreSQL) 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) 109 | echo $(psql --version 2>/dev/null | grep -Po -m1 '(?<=psql \(PostgreSQL\)\s)[0-9.]+') 110 | ;; 111 | python ) 112 | ### source example: Python 3.8.5 113 | echo $(python --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 114 | ;; 115 | python-pip ) 116 | ### source example: pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) 117 | echo $(python -m pip --version 2>/dev/null | grep -Po -m1 '(?<=pip\s)[0-9.]+') 118 | ;; 119 | python3 ) 120 | ### source example: Python 3.8.5 121 | echo $(python3 --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 122 | ;; 123 | python3-pip ) 124 | ### source example: pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) 125 | echo $(python3 -m pip --version 2>/dev/null | grep -Po -m1 '(?<=pip\s)[0-9.]+') 126 | ;; 127 | ristretto ) 128 | ### source example: ristretto 0.8.2 129 | echo $(ristretto --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 130 | ;; 131 | rpm ) 132 | ### source example: RPM version 4.14.1 133 | echo $(rpm --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 134 | ;; 135 | tigervnc | tiger-vnc | vncserver | vnc-server | vnc ) 136 | ### till TigerVNC 1.10.1 137 | ### source example: Xvnc TigerVNC 1.9.0 - built Jul 16 2018 14:18:04 138 | # echo $(vncserver -version 2>/dev/null | grep -Po '(?<=Xvnc TigerVNC\s)[0-9.]+') 139 | ### since TigerVNC 1.11.0 (it's coming out on the stderr stream!) 140 | ### source example: Xvnc TigerVNC 1.11.0 - built Sep 8 2020 12:27:03 141 | echo $(Xvnc -version 2>&1 | grep -Po -m1 '(?<=Xvnc TigerVNC\s)[0-9.]+') 142 | ;; 143 | tsc | typescript | type-script ) 144 | ### source example: Version 3.6.2 145 | echo $(tsc --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 146 | ;; 147 | ubuntu | xubuntu ) 148 | ### source example: Ubuntu 18.04.3 LTS 149 | echo $(cat /etc/os-release 2>/dev/null | grep -Po -m1 '(?<=VERSION\=")[0-9.]+') 150 | ;; 151 | vim ) 152 | ### source example: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41) 153 | echo $(vim --version 2>/dev/null | grep -Po -m1 '(?<=VIM - Vi IMproved\s)[0-9.]+') 154 | ;; 155 | websockify ) 156 | ### source example: 0.8.0 157 | echo $(cat "${NOVNC_HOME}"/utils/websockify/CHANGES.txt 2>/dev/null | grep -Po -m1 '^[0-9.]+') 158 | ;; 159 | xfce4-screenshooter | screenshooter | screenshot ) 160 | ### source example: xfce4-screenshooter 1.8.2 161 | echo $(xfce4-screenshooter --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') 162 | ;; 163 | esac 164 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/version_sticker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### resolve also symlinks 4 | _current_dir="$(dirname "$(readlink -f "$0")")" 5 | 6 | debian=$("${_current_dir}/version_of.sh" debian) 7 | ubuntu=$("${_current_dir}/version_of.sh" ubuntu) 8 | chromium=$("${STARTUPDIR}/version_of.sh" chromium) 9 | firefox=$("${STARTUPDIR}/version_of.sh" firefox) 10 | nodejs=$("${STARTUPDIR}/version_of.sh" nodejs) 11 | npm=$("${STARTUPDIR}/version_of.sh" npm) 12 | nvm=$("${STARTUPDIR}/version_of.sh" nvm) 13 | postman=$("${STARTUPDIR}/version_of.sh" postman) 14 | vscode=$("${STARTUPDIR}/version_of.sh" vscode) 15 | 16 | python=$("${STARTUPDIR}/version_of.sh" python) 17 | if [[ -n "${python}" ]] ; then python_pip=$("${STARTUPDIR}/version_of.sh" python-pip) ; fi 18 | 19 | main() { 20 | local key 21 | 22 | if [[ $# -gt 0 ]] ; then 23 | 24 | while [[ $# -gt 0 ]] ; do 25 | 26 | key="$1" 27 | 28 | if [[ "${key}" = '--' ]] ; then 29 | 30 | shift 31 | fi 32 | 33 | case "${key}" in 34 | 35 | -h ) 36 | echo "Usage: version_sticker [-h] [-v] [-V] [-f]" 37 | echo "-h help" 38 | echo "-v short version sticker" 39 | echo "-V verbose version sticker" 40 | echo "-f features" 41 | ;; 42 | 43 | -f ) 44 | env | grep "FEATURES_" | sort 45 | ;; 46 | 47 | -v ) 48 | if [[ -n "${chromium}" ]] ; then echo "Chromium ${chromium}" ; fi 49 | if [[ -n "${firefox}" ]] ; then echo "Firefox ${firefox}" ; fi 50 | if [[ -n "${nodejs}" ]] ; then echo "Node.js ${nodejs}" ; fi 51 | if [[ -n "${npm}" ]] ; then echo "npm ${npm}" ; fi 52 | if [[ -n "${nvm}" ]] ; then echo "nvm ${nvm}" ; fi 53 | if [[ -n "${postman}" ]] ; then echo "Postman ${postman}" ; fi 54 | if [[ -n "${python}" ]] ; then echo "Python ${python}" ; fi 55 | if [[ -n "${python_pip}" ]] ; then echo "python-pip ${python_pip}" ; fi 56 | 57 | if [[ -n "${debian}" ]] ; then 58 | echo "Debian ${debian}" 59 | elif [[ -n "${ubuntu}" ]] ; then 60 | echo "Ubuntu ${ubuntu}" 61 | fi 62 | 63 | if [[ -n "${vscode}" ]] ; then echo "VSCode ${vscode}" ; fi 64 | ;; 65 | 66 | -V ) 67 | if [[ -n "${chromium}" ]] ; then echo "Chromium ${chromium}" ; fi 68 | 69 | version=$("${_current_dir}/version_of.sh" curl) 70 | if [[ -n "${version}" ]] ; then echo "curl ${version}" ; fi 71 | 72 | # version=$("${_current_dir}/version_of.sh" dconf-editor) 73 | # if [[ -n "${version}" ]] ; then echo "dconf-editor ${version}" ; fi 74 | 75 | version=$("${_current_dir}/version_of.sh" fakeroot) 76 | if [[ -n "${version}" ]] ; then echo "fakeroot ${version}" ; fi 77 | 78 | if [[ -n "${firefox}" ]] ; then echo "Firefox ${firefox}" ; fi 79 | 80 | # version=$("${_current_dir}/version_of.sh" gdebi) 81 | # if [[ -n "${version}" ]] ; then echo "gdebi ${version}" ; fi 82 | 83 | version=$("${_current_dir}/version_of.sh" git) 84 | if [[ -n "${version}" ]] ; then echo "git ${version}" ; fi 85 | 86 | version=$("${_current_dir}/version_of.sh" gpg) 87 | if [[ -n "${version}" ]] ; then echo "gpg ${version}" ; fi 88 | 89 | version=$("${_current_dir}/version_of.sh" jq) 90 | if [[ -n "${version}" ]] ; then echo "jq ${version}" ; fi 91 | 92 | version=$("${_current_dir}/version_of.sh" mousepad) 93 | if [[ -n "${version}" ]] ; then echo "Mousepad ${version}" ; fi 94 | 95 | version=$("${_current_dir}/version_of.sh" nano) 96 | if [[ -n "${version}" ]] ; then echo "nano ${version}" ; fi 97 | 98 | if [[ -n "${nodejs}" ]] ; then echo "Node.js ${nodejs}" ; fi 99 | 100 | version=$("${_current_dir}/version_of.sh" novnc) 101 | if [[ -n "${version}" ]] ; then echo "noVNC ${version}" ; fi 102 | 103 | if [[ -n "${npm}" ]] ; then echo "npm ${npm}" ; fi 104 | 105 | if [[ -n "${nvm}" ]] ; then echo "nvm ${nvm}" ; fi 106 | 107 | if [[ -n "${postman}" ]] ; then echo "Postman ${postman}" ; fi 108 | 109 | version=$("${_current_dir}/version_of.sh" python3) 110 | if [[ -n "${version}" ]] ; then echo "Python ${version}" ; fi 111 | 112 | if [[ -n "${python_pip}" ]] ; then echo "python-pip ${python_pip}" ; fi 113 | 114 | version=$("${_current_dir}/version_of.sh" ristretto) 115 | if [[ -n "${version}" ]] ; then echo "Ristretto ${version}" ; fi 116 | 117 | version=$("${_current_dir}/version_of.sh" rpm) 118 | if [[ -n "${version}" ]] ; then echo "rpm ${version}" ; fi 119 | 120 | version=$("${_current_dir}/version_of.sh" screenshooter) 121 | if [[ -n "${version}" ]] ; then echo "Screenshooter ${version}" ; fi 122 | 123 | version=$("${_current_dir}/version_of.sh" tigervnc) 124 | if [[ -n "${version}" ]] ; then echo "TigerVNC ${version}" ; fi 125 | 126 | if [[ -n "${debian}" ]] ; then 127 | echo "Debian ${debian}" 128 | elif [[ -n "${ubuntu}" ]] ; then 129 | echo "Ubuntu ${ubuntu}" 130 | fi 131 | 132 | if [[ -n "${vscode}" ]] ; then echo "VSCode ${vscode}" ; fi 133 | 134 | version=$("${_current_dir}/version_of.sh" websockify) 135 | if [[ -n "${version}" ]] ; then echo "websockify ${version}" ; fi 136 | ;; 137 | esac 138 | shift 139 | done 140 | else 141 | if [[ -n "${debian}" ]] ; then 142 | sticker="debian${debian}" 143 | elif [[ -n "${ubuntu}" ]] ; then 144 | sticker="ubuntu$ubuntu" 145 | fi 146 | 147 | ### Warning, 'nvm' must come before 'nodejs'! 148 | if [[ -n "${nvm}" ]] ; then 149 | 150 | sticker="${sticker}"-"nvm${nvm}" 151 | 152 | elif [[ -n "${nodejs}" ]] ; then 153 | 154 | sticker="${sticker}"-"nodejs${nodejs}"-"npm${npm}" 155 | 156 | elif [[ -n "${python}" ]] ; then 157 | 158 | sticker="${sticker}"-"python${python}"-"pip${python_pip}" 159 | fi 160 | 161 | if [[ -n "${postman}" ]] ; then 162 | 163 | sticker="${sticker}"-"postman${postman}" 164 | fi 165 | 166 | if [[ -n "${vscode}" ]] ; then 167 | 168 | sticker="${sticker}"-"code${vscode}" 169 | fi 170 | 171 | if [[ -n "${chromium}" ]] ; then 172 | 173 | sticker="${sticker}-chromium${chromium}" 174 | 175 | elif [[ -n "${firefox}" ]] ; then 176 | 177 | sticker="${sticker}-firefox${firefox}" 178 | fi 179 | 180 | echo "${sticker}" 181 | fi 182 | } 183 | 184 | main $@ 185 | -------------------------------------------------------------------------------- /docker/src/xfce-startup/vnc_startup.rc: -------------------------------------------------------------------------------- 1 | start_vnc () { 2 | local vnc_ip 3 | local passwd_path 4 | local xinit_pid 5 | 6 | ### option '--skip-vnc' 7 | if [[ "${_arg_skip_vnc}" == "on" ]] ; then 8 | 9 | if [[ -n "${_verbose}" ]] ; then 10 | 11 | echo "INFO: VNC/noVNC startup skipped as requested." 12 | fi 13 | 14 | return 0 15 | fi 16 | 17 | if [[ -z "$(which vncserver)" ]] ; then 18 | 19 | if [[ -n "${_verbose}" ]] ; then 20 | echo "WARNING: No 'vncserver' is available." 21 | fi 22 | 23 | return 0 24 | fi 25 | 26 | ### VNC requirements 27 | ### VNC password not enforced any more, so it can be set to an empty string by 'docker run -e VNC_PW=""'. 28 | ### If you still want to enforce it, bring the following line back: 29 | ### || [[ -z "${VNC_PW}" ]] \ 30 | if [[ -z "${DISPLAY}" \ 31 | || -z "${VNC_PORT}" \ 32 | || -z "${VNC_COL_DEPTH}" \ 33 | || -z "${VNC_RESOLUTION}" ]] ; then 34 | 35 | # cleanup "ERROR: Not all required environment variables are set: DISPLAY, VNC_PORT, VNC_PW, VNC_COL_DEPTH, VNC_RESOLUTION" 36 | cleanup "ERROR: Not all required environment variables are set: DISPLAY, VNC_PORT, VNC_COL_DEPTH, VNC_RESOLUTION" 37 | fi 38 | 39 | passwd_path="${HOME}"/.vnc/passwd 40 | 41 | if [[ ! -d "${HOME}"/.vnc ]] ; then 42 | 43 | mkdir "${HOME}"/.vnc 44 | fi 45 | 46 | if [[ "${VNC_VIEW_ONLY,,}" == "true" ]] ; then 47 | 48 | if [[ -n "${_verbose}" ]] ; then 49 | 50 | echo "Starting VNC server in view-only mode" 51 | fi 52 | 53 | ### create random pw to prevent access 54 | echo $(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 20) | vncpasswd -f > "${passwd_path}" 55 | fi 56 | 57 | echo "${VNC_PW}" | vncpasswd -f > "${passwd_path}" 58 | chmod 600 "${passwd_path}" 59 | 60 | ### create VNC configuration file 61 | echo " 62 | rfbport=${VNC_PORT} 63 | depth=${VNC_COL_DEPTH} 64 | geometry=${VNC_RESOLUTION} 65 | " > "${HOME}"/.vnc/config 66 | 67 | ### get container IP address 68 | vnc_ip=$(hostname -i) 69 | 70 | ### removing old VNC locks to be a re-attachable container 71 | xinit_pid="$(pidof xinit)" 72 | 73 | if [[ -n "${xinit_pid}" ]] ; then 74 | 75 | if [[ -n "${_verbose}" ]] ; then 76 | echo "Killing xinit PID ${xinit_pid}" 77 | fi 78 | 79 | ### ignore the errors if not alive any more 80 | kill "${xinit_pid}" > /dev/null 2>&1 81 | fi 82 | if [[ -n $(compgen -G /tmp/.X*-lock) || -n $(compgen -G /tmp/.X11-unix) ]] ; then 83 | 84 | if [[ -n "${_verbose}" ]] ; then 85 | 86 | echo "Removing old VNC locks to be a re-attachable container" 87 | fi 88 | 89 | rm -rfv /tmp/.X*-lock /tmp/.X11-unix &> "${_vnc_log}" 90 | fi 91 | 92 | if [[ -n "${_verbose}" ]] ; then 93 | 94 | echo "Starting VNC" 95 | echo "vncserver ${DISPLAY} &> ${_vnc_log}" 96 | fi 97 | 98 | ### VNC startup (in the background) 99 | vncserver "${DISPLAY}" &> "${_vnc_log}" & 100 | 101 | ### container will wait on this VNC server PID 102 | _wait_pid=$! 103 | 104 | if [[ -n "${_verbose}" ]] ; then 105 | 106 | echo "VNC server started on display '${DISPLAY}' and TCP port '${VNC_PORT}'" 107 | echo "Connect via VNC viewer with ${vnc_ip}:${VNC_PORT}" 108 | fi 109 | 110 | ### option '--skip-novnc' 111 | if [[ "${_arg_skip_novnc}" == "off" ]] ; then 112 | 113 | ### noVNC is not necessarily installed 114 | if [[ -n "${NOVNC_HOME}" || -d "${NOVNC_HOME}/utils/websockify" ]] ; then 115 | 116 | ### noVNC requirements 117 | if [[ -n "${NOVNC_PORT}" ]] ; then 118 | 119 | if [[ -n "${_verbose}" ]] ; then 120 | 121 | echo "Starting noVNC" 122 | echo "${NOVNC_HOME}/utils/novnc_proxy --vnc localhost:${VNC_PORT} --listen ${NOVNC_PORT} ${NOVNC_HEARTBEAT:+--heartbeat ${NOVNC_HEARTBEAT}} &> ${_novnc_log}" 123 | fi 124 | 125 | ### noVNC startup (in the background) 126 | "${NOVNC_HOME}"/utils/novnc_proxy \ 127 | --vnc localhost:${VNC_PORT} \ 128 | --listen ${NOVNC_PORT} \ 129 | ${NOVNC_HEARTBEAT:+--heartbeat ${NOVNC_HEARTBEAT}} \ 130 | &> "${_novnc_log}" & 131 | 132 | if [[ -n "${_verbose}" ]] ; then 133 | 134 | echo "noVNC started on TCP port '${NOVNC_PORT}' ${NOVNC_HEARTBEAT:+with heartbeat ${NOVNC_HEARTBEAT} seconds}" 135 | echo "Connect via web browser" 136 | fi 137 | else 138 | cleanup "ERROR: Environment variable 'NOVNC_PORT' is not set." 139 | fi 140 | else 141 | if [[ -n "${_verbose}" ]] ; then 142 | 143 | echo "WARNING: noVNC is not available." 144 | fi 145 | fi 146 | else 147 | if [[ -n "${_verbose}" ]] ; then 148 | 149 | echo "INFO: noVNC startup skipped as requested." 150 | fi 151 | fi 152 | } 153 | -------------------------------------------------------------------------------- /docker/xfce-chromium/src/home/readme-chromium.md: -------------------------------------------------------------------------------- 1 | # Readme `Chromium` 2 | 3 | Note that `Chromium Browser` in this container runs in `--no-sandbox` mode. 4 | You should be aware of the implications. 5 | The browser is intended for testing and development. 6 | -------------------------------------------------------------------------------- /docker/xfce-firefox/src/firefox.plus/home/Desktop/Copy FF Preferences.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=Copy FF Preferences 5 | Comment=Copy user.js into Firefox profiles 6 | Icon=accetto 7 | Path= 8 | Terminal=true 9 | StartupNotify=true 10 | GenericName=Copy FF Preferences 11 | Exec=${HOME}/firefox.plus/copy_firefox_user_preferences.sh 12 | -------------------------------------------------------------------------------- /docker/xfce-firefox/src/firefox.plus/home/Desktop/FF Profile Manager.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=FF Profile Manager 5 | Comment=Open Firefox Profile Manager 6 | Exec=firefox -P 7 | Icon=accetto 8 | Path= 9 | Terminal=false 10 | StartupNotify=true 11 | -------------------------------------------------------------------------------- /docker/xfce-firefox/src/firefox.plus/home/readme-firefox-plus.md: -------------------------------------------------------------------------------- 1 | # Readme `firefox-plus` 2 | 3 | The **Firefox Plus** feature script `copy_firefox_user_preferences.sh` allows copying pre-configured user preferences into existing Firefox profiles easily. The script is stored in the folder `${HOME}/firefox.plus`. Check the page **How to use pre-configured Firefox preferences** in [this Wiki](https://github.com/accetto/ubuntu-vnc-xfce-firefox-plus/wiki/How-to#how-to-use-pre-configured-firefox-preferences) for more information. 4 | -------------------------------------------------------------------------------- /docker/xfce-firefox/src/firefox.plus/resources/accetto.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 23 | 25 | image/svg+xml 26 | 28 | 29 | 30 | 31 | 32 | 34 | 54 | 116 | 117 | -------------------------------------------------------------------------------- /docker/xfce-firefox/src/firefox.plus/resources/copy_firefox_user_preferences.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ### @accetto (https://github.com/accetto) (https://hub.docker.com/u/accetto/) 3 | 4 | # ARG_OPTIONAL_SINGLE([source],[s],[Source folder (where 'user.js' is).],[${HOME}/firefox.plus]) 5 | # ARG_OPTIONAL_SINGLE([target],[t],[Target folder (where Firefox profiles are).],[${HOME}/.mozilla/firefox]) 6 | # ARG_VERSION([echo $0 v19.06.18]) 7 | # ARG_HELP([Copy 'user.js' into existing Firefox profiles]) 8 | # ARGBASH_GO() 9 | # needed because of Argbash --> m4_ignore([ 10 | ### START OF CODE GENERATED BY Argbash v2.8.0 one line above ### 11 | # Argbash is a bash code generator used to get arguments parsing right. 12 | # Argbash is FREE SOFTWARE, see https://argbash.io for more info 13 | 14 | 15 | die() 16 | { 17 | local _ret=$2 18 | test -n "$_ret" || _ret=1 19 | test "$_PRINT_HELP" = yes && print_help >&2 20 | echo "$1" >&2 21 | exit ${_ret} 22 | } 23 | 24 | 25 | begins_with_short_option() 26 | { 27 | local first_option all_short_options='stvh' 28 | first_option="${1:0:1}" 29 | test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0 30 | } 31 | 32 | # THE DEFAULTS INITIALIZATION - OPTIONALS 33 | _arg_source="${HOME}/firefox.plus" 34 | _arg_target="${HOME}/.mozilla/firefox" 35 | 36 | 37 | print_help() 38 | { 39 | printf '%s\n' "Copy 'user.js' into existing Firefox profiles" 40 | printf 'Usage: %s [-s|--source ] [-t|--target ] [-v|--version] [-h|--help]\n' "$0" 41 | printf '\t%s\n' "-s, --source: Source folder (where 'user.js' is). (default: '${HOME}/firefox.plus')" 42 | printf '\t%s\n' "-t, --target: Target folder (where Firefox profiles are). (default: '${HOME}/.mozilla/firefox')" 43 | printf '\t%s\n' "-v, --version: Prints version" 44 | printf '\t%s\n' "-h, --help: Prints help" 45 | } 46 | 47 | 48 | parse_commandline() 49 | { 50 | while test $# -gt 0 51 | do 52 | _key="$1" 53 | case "$_key" in 54 | -s|--source) 55 | test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1 56 | _arg_source="$2" 57 | shift 58 | ;; 59 | --source=*) 60 | _arg_source="${_key##--source=}" 61 | ;; 62 | -s*) 63 | _arg_source="${_key##-s}" 64 | ;; 65 | -t|--target) 66 | test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1 67 | _arg_target="$2" 68 | shift 69 | ;; 70 | --target=*) 71 | _arg_target="${_key##--target=}" 72 | ;; 73 | -t*) 74 | _arg_target="${_key##-t}" 75 | ;; 76 | -v|--version) 77 | echo $0 v19.06.18 78 | exit 0 79 | ;; 80 | -v*) 81 | echo $0 v19.06.18 82 | exit 0 83 | ;; 84 | -h|--help) 85 | print_help 86 | exit 0 87 | ;; 88 | -h*) 89 | print_help 90 | exit 0 91 | ;; 92 | *) 93 | _PRINT_HELP=yes die "FATAL ERROR: Got an unexpected argument '$1'" 1 94 | ;; 95 | esac 96 | shift 97 | done 98 | } 99 | 100 | parse_commandline "$@" 101 | 102 | # OTHER STUFF GENERATED BY Argbash 103 | 104 | ### END OF CODE GENERATED BY Argbash (sortof) ### ]) 105 | # [ <-- needed because of Argbash 106 | 107 | _counter=0 108 | _file_userjs="user.js" 109 | _file_profilesini="profiles.ini" 110 | _full_userjs="" 111 | _full_profilesini="" 112 | _input="" 113 | _line=0 114 | _mark="" 115 | _oldIFS="" 116 | declare -a _list 117 | 118 | # LOCAL_DEBUG=true 119 | 120 | [[ $LOCAL_DEBUG ]] && _arg_source="." 121 | [[ $LOCAL_DEBUG ]] && _arg_target="../.mozilla/firefox" 122 | 123 | fn_die() 124 | { 125 | local _ret=$2 126 | test -n "$_ret" || _ret=1 127 | test "$_PRINT_HELP" = yes && print_help >&2 128 | echo "$1" >&2 129 | read -rp $"Press any key to close this window" -n1 _input 130 | exit ${_ret} 131 | } 132 | 133 | ### source and target folders must be provided 134 | # : ${_arg_source?} ${_arg_target?} 135 | [[ ! ${_arg_source} ]] && fn_die "Source path must be provided!" 136 | [[ ! ${_arg_target} ]] && fn_die "Target path must be provided!" 137 | 138 | _full_userjs="${_arg_source}/${_file_userjs}" 139 | _full_profilesini="${_arg_target}/${_file_profilesini}" 140 | 141 | ### source folder must contain 'user.js' 142 | [[ -f "${_full_userjs}" ]] && echo "File '${_full_userjs}' found." || fn_die "File '${_full_userjs}' not found!" 143 | 144 | ### target folder must contain 'profiles.ini' 145 | [[ -f ${_full_profilesini} ]] && echo "File '${_full_profilesini}' found." || fn_die "File '${_full_profilesini}' not found!" 146 | 147 | ### only profiles in 'profiles.ini' will be processed, get their count 148 | _counter=$( grep -c -E '^Path=' "${_full_profilesini}" ) 149 | 150 | if [[ $_counter -gt 0 ]] ; then 151 | 152 | ### extract profile folder names from 'profiles.ini' into the array 153 | ### be aware that user profile names/folders can contain spaces 154 | _oldIFS=$IFS 155 | IFS=$'\x0A'$'\x0D' 156 | _list=( $( grep -E '^Path=' "${_full_profilesini}" | sed -E -e 's/^Path=//' ) ) 157 | IFS=$_oldIFS 158 | 159 | echo "Following profiles found in '${_file_profilesini}' ('+|-' means with/without '${_file_userjs}'):" 160 | _counter=0 161 | for p in "${_list[@]}" ; do 162 | _counter=$((${_counter}+1)) 163 | [[ $(ls "${_arg_target}/$p/${_file_userjs}" 2>/dev/null) ]] && _mark=" + " || _mark=" - " 164 | printf ' %s %s %s\n' "$_counter" "$_mark" "$p" 165 | done 166 | 167 | ### user interaction 168 | read -rp $"Into which profile to copy '${_file_userjs}' (line number or 'all')? " _input 169 | _input=$(echo ${_input,,} | grep -i -E "^[0-9]+$|^all$") 170 | [[ ! ${_input} ]] && fn_die "INTERRUPTED: Line number or 'all' required!" 171 | if [[ "${_input,,}" != "all" ]] ; then 172 | 173 | ### line number has been provided 174 | _line=${_input} 175 | [[ ${_line} -lt 1 || ${_line} -gt ${_counter} ]] && fn_die "Line number must be from the interval [1..${_counter}]!" 176 | _line=$((${_line}-1)) 177 | 178 | ### copy 'user.js' into the selected profile folder 179 | cp -v "${_full_userjs}" "${_arg_target}/${_list[${_line}]}/" 180 | 181 | else 182 | # 'all' has been provided 183 | ### copy 'user.js' into all profiles not containing it yet 184 | for p in "${_list[@]}" ; do 185 | cp -v "${_full_userjs}" "${_arg_target}/$p/" 186 | done 187 | fi 188 | 189 | fn_die "SUCCESS." 0 190 | else 191 | echo "No profiles found in '${_full_profilesini}'." 192 | fi 193 | 194 | fn_die "" 0 195 | 196 | # ] <-- needed because of Argbash 197 | -------------------------------------------------------------------------------- /docker/xfce-firefox/src/firefox.plus/resources/user.js: -------------------------------------------------------------------------------- 1 | // Add the preferences you want to force here. 2 | // They will be forced for each session, but only in profiles containing this file. 3 | 4 | // Disable WebRTC leaks as explained in https://ipleak.net/#webrtcleak 5 | // Be aware that this has impact on some applications, e.g. some messengers. 6 | // user_pref("media.peerconnection.enabled", false); 7 | -------------------------------------------------------------------------------- /docker/xfce-firefox/src/home/Desktop/firefox-esr.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Firefox ESR 3 | Name[bg]=Firefox ESR 4 | Name[ca]=Firefox ESR 5 | Name[cs]=Firefox ESR 6 | Name[el]=Firefox ESR 7 | Name[es]=Firefox ESR 8 | Name[fa]=Firefox ESR 9 | Name[fi]=Firefox ESR 10 | Name[fr]=Firefox ESR 11 | Name[hu]=Firefox ESR 12 | Name[it]=Firefox ESR 13 | Name[ja]=Firefox ESR 14 | Name[ko]=Firefox ESR 15 | Name[nb]=Firefox ESR 16 | Name[nl]=Firefox ESR 17 | Name[nn]=Firefox ESR 18 | Name[no]=Firefox ESR 19 | Name[pl]=Firefox ESR 20 | Name[pt]=Firefox ESR 21 | Name[pt_BR]=Firefox ESR 22 | Name[ru]=Firefox ESR 23 | Name[sk]=Firefox ESR 24 | Name[sv]=Firefox ESR 25 | Comment=Browse the World Wide Web 26 | Comment[bg]=Сърфиране в Мрежата 27 | Comment[ca]=Navegueu per el web 28 | Comment[cs]=Prohlížení stránek World Wide Webu 29 | Comment[de]=Im Internet surfen 30 | Comment[el]=Περιηγηθείτε στον παγκόσμιο ιστό 31 | Comment[es]=Navegue por la web 32 | Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید 33 | Comment[fi]=Selaa Internetin WWW-sivuja 34 | Comment[fr]=Navigue sur Internet 35 | Comment[hu]=A világháló böngészése 36 | Comment[it]=Esplora il web 37 | Comment[ja]=ウェブを閲覧します 38 | Comment[ko]=웹을 돌아 다닙니다 39 | Comment[nb]=Surf på nettet 40 | Comment[nl]=Verken het internet 41 | Comment[nn]=Surf på nettet 42 | Comment[no]=Surf på nettet 43 | Comment[pl]=Przeglądanie stron WWW 44 | Comment[pt]=Navegue na Internet 45 | Comment[pt_BR]=Navegue na Internet 46 | Comment[ru]=Обозреватель Всемирной Паутины 47 | Comment[sk]=Prehliadanie internetu 48 | Comment[sv]=Surfa på webben 49 | GenericName=Web Browser 50 | GenericName[bg]=Интернет браузър 51 | GenericName[ca]=Navegador web 52 | GenericName[cs]=Webový prohlížeč 53 | GenericName[de]=Webbrowser 54 | GenericName[el]=Περιηγητής ιστού 55 | GenericName[es]=Navegador web 56 | GenericName[fa]=مرورگر اینترنتی 57 | GenericName[fi]=WWW-selain 58 | GenericName[fr]=Navigateur Web 59 | GenericName[hu]=Webböngésző 60 | GenericName[it]=Browser Web 61 | GenericName[ja]=ウェブ・ブラウザ 62 | GenericName[ko]=웹 브라우저 63 | GenericName[nb]=Nettleser 64 | GenericName[nl]=Webbrowser 65 | GenericName[nn]=Nettlesar 66 | GenericName[no]=Nettleser 67 | GenericName[pl]=Przeglądarka WWW 68 | GenericName[pt]=Navegador Web 69 | GenericName[pt_BR]=Navegador Web 70 | GenericName[ru]=Интернет-браузер 71 | GenericName[sk]=Internetový prehliadač 72 | GenericName[sv]=Webbläsare 73 | X-GNOME-FullName=Firefox ESR Web Browser 74 | X-GNOME-FullName[bg]=Интернет браузър (Firefox ESR) 75 | X-GNOME-FullName[ca]=Navegador web Firefox ESR 76 | X-GNOME-FullName[cs]=Firefox ESR Webový prohlížeč 77 | X-GNOME-FullName[el]=Περιηγήτης Ιστού Firefox ESR 78 | X-GNOME-FullName[es]=Navegador web Firefox ESR 79 | X-GNOME-FullName[fa]=مرورگر اینترنتی Firefox ESR 80 | X-GNOME-FullName[fi]=Firefox ESR-selain 81 | X-GNOME-FullName[fr]=Navigateur Web Firefox ESR 82 | X-GNOME-FullName[hu]=Firefox ESR webböngésző 83 | X-GNOME-FullName[it]=Firefox ESR Browser Web 84 | X-GNOME-FullName[ja]=Firefox ESR ウェブ・ブラウザ 85 | X-GNOME-FullName[ko]=Firefox ESR 웹 브라우저 86 | X-GNOME-FullName[nb]=Firefox ESR Nettleser 87 | X-GNOME-FullName[nl]=Firefox ESR webbrowser 88 | X-GNOME-FullName[nn]=Firefox ESR Nettlesar 89 | X-GNOME-FullName[no]=Firefox ESR Nettleser 90 | X-GNOME-FullName[pl]=Przeglądarka WWW Firefox ESR 91 | X-GNOME-FullName[pt]=Firefox ESR Navegador Web 92 | X-GNOME-FullName[pt_BR]=Navegador Web Firefox ESR 93 | X-GNOME-FullName[ru]=Интернет-браузер Firefox ESR 94 | X-GNOME-FullName[sk]=Internetový prehliadač Firefox ESR 95 | X-GNOME-FullName[sv]=Webbläsaren Firefox ESR 96 | Exec=/usr/lib/firefox-esr/firefox-esr %u 97 | Terminal=false 98 | X-MultipleArgs=false 99 | Type=Application 100 | Icon=firefox-esr 101 | Categories=Network;WebBrowser; 102 | MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https; 103 | StartupWMClass=Firefox-esr 104 | StartupNotify=true 105 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/README-dockerhub.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC for `Node.js` development 2 | 3 | ## accetto/debian-vnc-xfce-nodejs-g3 4 | 5 | [User Guide][this-user-guide] - [GitHub][this-github] - [Dockerfile][this-dockerfile] - [Readme][this-readme-full] - [Changelog][this-changelog] 6 | 7 | 8 | ![badge-github-release][badge-github-release]` ` 9 | ![badge-docker-pulls][badge-docker-pulls]` ` 10 | ![badge-docker-stars][badge-docker-stars] 11 | 12 | *** 13 | 14 | This Docker Hub repository contains Docker images for headless working with the free open-source JavaScript runtime environment [Node.js][nodejs] and its package installer [npm][npm]. 15 | 16 | The images are based on the current [Debian 12][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. 17 | 18 | The free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable] and the popular web browsers [Chromium][chromium] or [Firefox][firefox] are also included. 19 | 20 | Adding more tools like [TypeScript][typescript], [Angular][angular] or [Electron][electron] usually requires only a single or just a few commands. 21 | The instructions are in the provided README files and some simple test applications are also already included. 22 | 23 | This [User guide][this-user-guide] describes the images and how to use them. 24 | 25 | The related [GitHub project][this-github] contains image generators that image users generally don’t need, unless they want to build the images themselves. 26 | 27 | ### Sharing Visual Studio Code profiles 28 | 29 | You can share *portable* `Visual Studio Code` profiles using *volumes* if you build your `compose` file similar to this: 30 | 31 | ```yaml 32 | volumes: 33 | ### The volume should be prepared beforehand, otherwise 34 | ### it would be removed with the service. 35 | some-shared-vscode-profile-volume: 36 | external: true 37 | 38 | services: 39 | some-vscode-service: 40 | .... 41 | volumes: 42 | - type: volume 43 | source: some-shared-vscode-profile-volume: 44 | target: /home/headless/.vscode-portable/code/data/user-data/User 45 | - type: volume 46 | source: some-shared-vscode-profile-volume: 47 | target: /home/headless/.vscode-portable/code/data/extensions 48 | ``` 49 | 50 | Be aware, that if you don't prepare the volume beforehand, it will be removed with the service. 51 | Read more about [Docker volumes][doc-docker-volumes] and [Compose volumes][doc-compose-volumes] in the official documentation. 52 | 53 | ### Tags 54 | 55 | The following image tags are regularly built and published on Docker Hub: 56 | 57 | 58 | 59 | - `latest` implements VNC and noVNC 60 | 61 | ![badge_latest_created][badge_latest_created]` ` 62 | [![badge_latest_version-sticker][badge_latest_version-sticker]][link_latest_version-sticker-verbose] 63 | 64 | - `chromium` adds [Chromium Browser][chromium] 65 | 66 | ![badge_chromium_created][badge_chromium_created]` ` 67 | [![badge_chromium_version-sticker][badge_chromium_version-sticker]][link_chromium_version-sticker-verbose] 68 | 69 | - `vscode` adds [portable][vscode-portable] [Visual Studio Code][vscode] 70 | 71 | ![badge_vscode_created][badge_vscode_created]` ` 72 | [![badge_vscode_version-sticker][badge_vscode_version-sticker]][link_vscode_version-sticker-verbose] 73 | 74 | - `vscode-chromium` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Chromium Browser][chromium] 75 | 76 | ![badge_vscode-chromium_created][badge_vscode-chromium_created]` ` 77 | [![badge_vscode-chromium_version-sticker][badge_vscode-chromium_version-sticker]][link_vscode-chromium_version-sticker-verbose] 78 | 79 | - `vscode-firefox` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Firefox][firefox] 80 | 81 | ![badge_vscode-firefox_created][badge_vscode-firefox_created]` ` 82 | [![badge_vscode-firefox_version-sticker][badge_vscode-firefox_version-sticker]][link_vscode-firefox_version-sticker-verbose] 83 | 84 | - `current` with [Node.js][nodejs] `Current`, implements VNC and noVNC 85 | 86 | ![badge_current_created][badge_current_created]` ` 87 | [![badge_current_version-sticker][badge_current_version-sticker]][link_current_version-sticker-verbose] 88 | 89 | 90 | 91 | **Hint:** Clicking the version sticker badge reveals more information about the particular build. 92 | 93 | ### Features 94 | 95 | The main features and components of the images in the default configuration are: 96 | 97 | - lightweight [Xfce][xfce] desktop environment (Debian distribution) 98 | - [sudo][sudo] support 99 | - utilities [curl][curl] and [git][git] (Debian distribution) 100 | - current version of JSON processor [jq][jq] 101 | - current version of high-performance [TigerVNC][tigervnc] server and client 102 | - current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**) 103 | - popular text editor [nano][nano] (Debian distribution) 104 | - lite but advanced graphical editor [mousepad][mousepad] (Debian distribution) 105 | - current version of [tini][tini] as the entry-point initial process (PID 1) 106 | - support for overriding environment variables, VNC parameters, user and group (see [User guide][this-user-guide-using-containers]) 107 | - support of **version sticker** (see [User guide][this-user-guide-version-sticker]) 108 | - current version of [Chromium Browser][chromium] open-source web browser (Debian distribution) 109 | - 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]) 110 | - current version of free open-source JavaScript runtime environment [Node.js][nodejs] with [npm][npm] (`LTS` or `current`) 111 | - current version of free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable] 112 | 113 | The following **TCP** ports are exposed by default: 114 | 115 | - **5901** for access over **VNC** (using VNC viewer) 116 | - **6901** for access over [noVNC][novnc] (using web browser) 117 | 118 | ![container-screenshot][this-screenshot-container] 119 | 120 | ### Remarks 121 | 122 | This is the **third generation** (G3) of my headless images. 123 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 124 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 125 | 126 | Note that the portable `Visual Studio Code` does not support automatic updates. 127 | However, manual updating is really easy. 128 | Visit the official [Portable Mode][vscode-portable] page for more information. 129 | 130 | Alternatively you can pull or build an updated `accetto` image containing the new `Visual Studio Code` version. 131 | 132 | ### Getting help 133 | 134 | 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. 135 | Please do not overlook the closed issues. 136 | 137 | If you do not find a solution, you can file a new issue. 138 | The better you describe the problem, the bigger the chance it'll be solved soon. 139 | 140 | 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]. 141 | 142 | *** 143 | 144 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 145 | 146 | [this-user-guide-version-sticker]: https://accetto.github.io/user-guide-g3/version-sticker/ 147 | 148 | [this-user-guide-using-containers]: https://accetto.github.io/user-guide-g3/using-containers/ 149 | 150 | [this-user-guide-firefox-plus]: https://accetto.github.io/user-guide-g3/firefox-plus/ 151 | 152 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 153 | 154 | [this-github]: https://github.com/accetto/headless-coding-g3/ 155 | 156 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 157 | 158 | [this-readme-full]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-nodejs/README.md 159 | 160 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 161 | 162 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 163 | 164 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.nodejs 165 | 166 | [this-screenshot-container]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/animation-headless-coding-nodejs-live.gif 167 | 168 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 169 | 170 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 171 | 172 | [docker-debian]: https://hub.docker.com/_/debian/ 173 | 174 | [doc-docker-volumes]: https://docs.docker.com/storage/volumes/ 175 | [doc-compose-volumes]: https://docs.docker.com/compose/compose-file/07-volumes/ 176 | 177 | [angular]: https://angular.io/ 178 | [chromium]: https://www.chromium.org/Home 179 | [curl]: http://manpages.ubuntu.com/manpages/bionic/man1/curl.1.html 180 | [electron]: https://www.electronjs.org/ 181 | [firefox]: https://www.mozilla.org 182 | [git]: https://git-scm.com/ 183 | [nodejs]: https://www.nodejs.org/ 184 | [jq]: https://stedolan.github.io/jq/ 185 | [mousepad]: https://github.com/codebrainz/mousepad 186 | [nano]: https://www.nano-editor.org/ 187 | [novnc]: https://github.com/kanaka/noVNC 188 | [npm]: https://www.npmjs.com/ 189 | [sudo]: https://www.sudo.ws/ 190 | [tigervnc]: http://tigervnc.org 191 | [tini]: https://github.com/krallin/tini 192 | [typescript]: https://www.typescriptlang.org/ 193 | [vscode]: https://code.visualstudio.com/ 194 | [vscode-portable]: https://code.visualstudio.com/docs/editor/portable 195 | [xfce]: http://www.xfce.org 196 | 197 | [badge-github-release]: https://img.shields.io/github/v/release/accetto/headless-coding-g3 198 | 199 | [badge-docker-pulls]: https://img.shields.io/docker/pulls/accetto/debian-vnc-xfce-nodejs-g3 200 | 201 | [badge-docker-stars]: https://img.shields.io/docker/stars/accetto/debian-vnc-xfce-nodejs-g3 202 | 203 | 204 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/README.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC for `Node.js` development 2 | 3 | ## accetto/debian-vnc-xfce-nodejs-g3 4 | 5 | [User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog] 6 | 7 | *** 8 | 9 | This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-nodejs-g3][this-docker]. 10 | 11 | This [User guide][this-user-guide] describes the images and how to use them. 12 | 13 | ### Building images 14 | 15 | ```shell 16 | ### PWD = project root 17 | ### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc') 18 | 19 | ### examples of building and publishing the individual images 20 | ./builder.sh nodejs all 21 | ./builder.sh nodejs-chromium all 22 | ./builder.sh nodejs-vscode all 23 | ./builder.sh nodejs-vscode-chromium all 24 | ./builder.sh nodejs-vscode-firefox all 25 | ./builder.sh nodejs-current all 26 | 27 | ### just building the image, skipping the publishing and the version sticker update 28 | ./builder.sh nodejs build 29 | 30 | ### examples of building and publishing the images as a group 31 | ./ci-builder.sh all group nodejs nodejs-current nodejs-vscode-chromium 32 | 33 | ### or all the images featuring Node.js 34 | ./ci-builder.sh all group complete-nodejs 35 | ``` 36 | 37 | Refer to the main [README][this-readme] file for more information about the building subject. 38 | 39 | ### Remarks 40 | 41 | This is a sibling project to the project [accetto/debian-vnc-xfce-g3][accetto-github-debian-vnc-xfce-g3]. 42 | 43 | There is also another sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu]. 44 | 45 | This is the **third generation** (G3) of my headless images. 46 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 47 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 48 | 49 | ### Getting help 50 | 51 | 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. 52 | Please do not overlook the closed issues. 53 | 54 | If you do not find a solution, you can file a new issue. 55 | The better you describe the problem, the bigger the chance it'll be solved soon. 56 | 57 | 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]. 58 | 59 | ### Diagrams 60 | 61 | Diagram of the multi-staged Dockerfile used for building multiple images. 62 | 63 | The actual content of a particular image build is controlled by the *feature variables*. 64 | 65 | ![Dockerfile.xfce.nodejs stages][this-diagram-dockerfile-stages-nodejs] 66 | 67 | *** 68 | 69 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 70 | 71 | [this-readme]: https://github.com/accetto/headless-coding-g3/blob/master/README.md 72 | 73 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 74 | 75 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 76 | 77 | [accetto-github-debian-vnc-xfce-g3]: https://github.com/accetto/debian-vnc-xfce-g3 78 | 79 | [accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3 80 | 81 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 82 | 83 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 84 | 85 | [this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-nodejs-g3/ 86 | 87 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.nodejs 88 | 89 | [this-diagram-dockerfile-stages-nodejs]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.nodejs.png 90 | 91 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 92 | 93 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 94 | 95 | [docker-ubuntu]: https://hub.docker.com/_/ubuntu/ 96 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/readme-append.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | [badge_latest_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@created.json 7 | 8 | [badge_latest_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker.json 9 | 10 | [link_latest_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker-verbose.txt 11 | 12 | 13 | 14 | [badge_chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@created.json 15 | 16 | [badge_chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker.json 17 | 18 | [link_chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker-verbose.txt 19 | 20 | 21 | 22 | [badge_vscode_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@created.json 23 | 24 | [badge_vscode_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@version-sticker.json 25 | 26 | [link_vscode_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@version-sticker-verbose.txt 27 | 28 | 29 | 30 | [badge_vscode-chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@created.json 31 | 32 | [badge_vscode-chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@version-sticker.json 33 | 34 | [link_vscode-chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@version-sticker-verbose.txt 35 | 36 | 37 | 38 | [badge_vscode-firefox_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@created.json 39 | 40 | [badge_vscode-firefox_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@version-sticker.json 41 | 42 | [link_vscode-firefox_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@version-sticker-verbose.txt 43 | 44 | 45 | 46 | [badge_current_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@current@created.json 47 | 48 | [badge_current_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@current@version-sticker.json 49 | 50 | [link_current_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@current@version-sticker-verbose.txt 51 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/home/readme-angular.md: -------------------------------------------------------------------------------- 1 | # Readme `Angular` 2 | 3 | This Docker image **does not** come with any pre-installed `Angular` version by intention. That allows you to choose the version and the way of installation that suite you best. 4 | 5 | Everything else you need is already included. 6 | 7 | You can install `Angular` globally by: 8 | 9 | ```shell 10 | npm install -g @angular/cli 11 | ``` 12 | 13 | You can check the current `Angular` version by: 14 | 15 | ```shell 16 | ng --version 17 | ``` 18 | 19 | You can start by following the [Angular Documentation](https://angular.io/docs). 20 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/home/readme-electron.md: -------------------------------------------------------------------------------- 1 | # Readme `electron` 2 | 3 | This Docker image **does not** come with any pre-installed `electron` version by intention. That allows you to choose the version and the way of installation that suite you best. 4 | 5 | Everything else you need is already included. There is also a simple application in the folder `/srv/samples/electron-test-app/`. You can test it including the packaging and installing the result package, all inside the container. 6 | 7 | You can start by following the [Electron Quick Start Guide](https://www.electronjs.org/docs/tutorial/quick-start). 8 | 9 | ## Prerequisites 10 | 11 | Please make sure that you are using an image that includes also **Chromium** web browser. Pick one of the images that includes the word `chromium` in its tag. 12 | 13 | Updating `npm` is not required, because the image usually already includes the up-to-date version, but you may decide to do so: 14 | 15 | ```shell 16 | npm install -g npm 17 | ``` 18 | 19 | ## Installing `electron` 20 | 21 | You can install `electron` globally or locally for a particular project. Local installation is usually the better choice. 22 | 23 | Example of installing `electron` in the project `electron-test-app`: 24 | 25 | ```shell 26 | cd /srv/samples/electron-test-app/ 27 | npm install --save-dev electron 28 | ``` 29 | 30 | Example of installing `electron` globally: 31 | 32 | ```shell 33 | npm install -g electron 34 | ``` 35 | 36 | ## Starting `electron` applications 37 | 38 | Note that all `electron` applications inside the container must be started with the option `--no-sandbox`. 39 | 40 | The sample application `electron-test-app` is already prepared for that, as it can be seen in its `package.json` file: 41 | 42 | ```json 43 | "scripts": { 44 | "start": "electron --no-sandbox .", 45 | "test": "echo \"Error: no test specified\" && exit 1" 46 | }, 47 | ``` 48 | 49 | The sample application can be then started by: 50 | 51 | ```shell 52 | npm start 53 | ``` 54 | 55 | You also need to add `--no-sandbox` to the desktop launchers. For example: 56 | 57 | ```shell 58 | ### Edit Launcher / Command 59 | electron-test-app --no-sandbox %U 60 | ``` 61 | 62 | ## Packaging `electron` applications 63 | 64 | If you want to package your application inside the container, 65 | you should install `electron` locally inside the project directory. 66 | 67 | You also need to install some additional utilities, that are not included by default, to keep the image slimmer: 68 | 69 | ```shell 70 | sudo apt-get update 71 | sudo apt-get -y install fakeroot rpm 72 | ``` 73 | 74 | There are several ways of creating application packages, but if you follow the example from [Electron Quick Start Guide](https://www.electronjs.org/docs/tutorial/quick-start), you need to install `Electron Forge`: 75 | 76 | ```shell 77 | npx @electron-forge/cli import 78 | ``` 79 | 80 | Then you can package the application: 81 | 82 | ```shell 83 | npm run make 84 | ``` 85 | 86 | The result `deb` and `rpm` packages will be stored into the sub-folders of the `/srv/samples/electron-test-app/out/make/` directory. 87 | 88 | ## Installing `electron` packages 89 | 90 | Before installing the application packages inside the container you have to update the `apt-get` cache: 91 | 92 | ```shell 93 | sudo apt-get update 94 | ``` 95 | 96 | Then you can install the `deb` package using `gdebi`: 97 | 98 | ```shell 99 | cd /srv/samples/electron-test-app/out/make/deb/x64/ 100 | sudo apt-get install -y ./electron-test-app_1.0.0_amd64.deb 101 | ``` 102 | 103 | The application launcher **electron-test-app** will be created in the `Accessories` group. Drag-and-drop it onto the desktop. Then right click it, choose `Edit Launcher` and add the `--no-sandbox` option to the launcher command. After saving it you can start the application with the launcher. 104 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/home/readme-nodejs.md: -------------------------------------------------------------------------------- 1 | # Readme `Node.js` 2 | 3 | ## Updating `npm` 4 | 5 | You can update `npm` by: 6 | 7 | ```shell 8 | npm install -g npm 9 | ``` 10 | 11 | You can check the current versions by: 12 | 13 | ```shell 14 | node -v 15 | npm -v 16 | npx -v 17 | ``` 18 | 19 | ## What next 20 | 21 | There is a sample application `nodejs-test-app` in `/srv/samples`. You can try it following the [Node.js Guides](https://nodejs.org/en/docs/guides/). 22 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/home/readme-typescript.md: -------------------------------------------------------------------------------- 1 | # Readme `TypeScript` 2 | 3 | This Docker image **does not** come with any pre-installed `TypeScript` version by intention. That allows you to choose the version and the way of installation that suite you best. 4 | 5 | Everything else you need is already included. 6 | 7 | You can install `TypeScript` globally by: 8 | 9 | ```shell 10 | npm install -g typescript 11 | ``` 12 | 13 | You can also install `TypeScript` locally for a particular project by: 14 | 15 | ```shell 16 | npm install --save-dev typescript 17 | ``` 18 | 19 | You can check the current `TypeScript` version by: 20 | 21 | ```shell 22 | tsc --version 23 | 24 | ### or also 25 | tsc -v 26 | ``` 27 | 28 | You can start by following the [TypeScript Documentation](https://www.typescriptlang.org/docs/). 29 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/samples/electron-test-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World! 6 | 7 | 8 | 9 |

Hello World!

10 |

11 | We are using node , 12 | Chrome , 13 | and Electron . 14 |

15 | 16 | 17 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/samples/electron-test-app/main.js: -------------------------------------------------------------------------------- 1 | const { app, BrowserWindow } = require('electron') 2 | 3 | function createWindow () { 4 | const win = new BrowserWindow({ 5 | width: 800, 6 | height: 600, 7 | webPreferences: { 8 | nodeIntegration: true 9 | } 10 | }) 11 | 12 | win.loadFile('index.html') 13 | } 14 | 15 | app.whenReady().then(createWindow) 16 | 17 | app.on('window-all-closed', () => { 18 | if (process.platform !== 'darwin') { 19 | app.quit() 20 | } 21 | }) 22 | 23 | app.on('activate', () => { 24 | if (BrowserWindow.getAllWindows().length === 0) { 25 | createWindow() 26 | } 27 | }) 28 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/samples/electron-test-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-test-app", 3 | "version": "1.0.0", 4 | "description": "Electron Test App", 5 | "main": "main.js", 6 | "scripts": { 7 | "start": "electron --no-sandbox .", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "Tester", 12 | "license": "ISC", 13 | "devDependencies": { 14 | "electron": ">=15.5.5" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/samples/electron-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `electron-test-app` 2 | 3 | ## Prerequisites 4 | 5 | Please make sure that you are using an image that includes also **Chromium** web browser. Pick one of the images that includes the word `chromium` in its tag. 6 | 7 | ## Installing `electron` 8 | 9 | First install `electron` locally: 10 | 11 | ```shell 12 | cd /usr/src/electron-test-app/ 13 | npm install --save-dev electron 14 | ``` 15 | 16 | ## Starting test application 17 | 18 | The test application can be started by: 19 | 20 | ```shell 21 | npm start 22 | ``` 23 | 24 | Note that all `electron` applications inside the container must be started with the option `--no-sandbox`. 25 | 26 | The sample application `electron-test-app` is already prepared for that, as it can be seen in its `package.json` file: 27 | 28 | ```json 29 | "scripts": { 30 | "start": "electron --no-sandbox .", 31 | "test": "echo \"Error: no test specified\" && exit 1" 32 | }, 33 | ``` 34 | 35 | If you also want to package applications inside the container, then check the file `readme-electron.md` in the home directory first. 36 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/samples/nodejs-test-app/app.js: -------------------------------------------------------------------------------- 1 | const http = require('http'); 2 | 3 | const hostname = '0.0.0.0'; 4 | const port = process.env.NODEJS_PORT; 5 | 6 | const server = http.createServer((req, res) => { 7 | res.statusCode = 200; 8 | res.setHeader('Content-Type', 'text/plain'); 9 | res.end('Hello from Node.js in Docker container\n'); 10 | }); 11 | 12 | server.listen(port, hostname, () => { 13 | console.log(`Server running at http://${hostname}:${port}/`); 14 | }); 15 | -------------------------------------------------------------------------------- /docker/xfce-nodejs/src/samples/nodejs-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `nodejs-test-app` 2 | 3 | First start the application from terminal: 4 | 5 | ```shell 6 | node app.js 7 | 8 | ### output 9 | Server running at http://0.0.0.0:3000/ 10 | ``` 11 | 12 | Navigate to the application from a web browser inside the container: 13 | 14 | ```text 15 | localhost:3000 16 | ``` 17 | 18 | The application can be stopped by entering `^c` (CTRL-C) in the terminal window. 19 | 20 | For using the application from outside the container you have to: 21 | 22 | - Ensure that the container exposes the TCP port `3000` (`Dockerfile` must contain `EXPOSE 3000`) 23 | 24 | - Bind a free TCP port on the host to the container's port `3000` (use `-P` with `docker run`) 25 | -------------------------------------------------------------------------------- /docker/xfce-nvm/README.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC and `NVM` for `Node.js` development 2 | 3 | ## accetto/debian-vnc-xfce-nvm-g3 4 | 5 | [User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog] 6 | 7 | *** 8 | 9 | This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-nvm-g3][this-docker]. 10 | 11 | This [User guide][this-user-guide] describes the images and how to use them. 12 | 13 | ### Building images 14 | 15 | ```shell 16 | ### PWD = project root 17 | ### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc') 18 | 19 | ### examples of building and publishing the individual images 20 | ./builder.sh nvm all 21 | ./builder.sh nvm-chromium all 22 | ./builder.sh nvm-vscode all 23 | ./builder.sh nvm-vscode-chromium all 24 | ./builder.sh nvm-vscode-firefox all 25 | 26 | ### just building the image, skipping the publishing and the version sticker update 27 | ./builder.sh nvm build 28 | 29 | ### examples of building and publishing the images as a group 30 | ./ci-builder.sh all group nvm nvm-vscode-chromium 31 | 32 | ### or all the images featuring NVM 33 | ./ci-builder.sh all group complete-nvm 34 | ``` 35 | 36 | Refer to the main [README][this-readme] file for more information about the building subject. 37 | 38 | ### Remarks 39 | 40 | This is a sibling project to the project [accetto/debian-vnc-xfce-g3][accetto-github-debian-vnc-xfce-g3]. 41 | 42 | There is also another sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu]. 43 | 44 | This is the **third generation** (G3) of my headless images. 45 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 46 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 47 | 48 | ### Getting help 49 | 50 | 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. 51 | Please do not overlook the closed issues. 52 | 53 | If you do not find a solution, you can file a new issue. 54 | The better you describe the problem, the bigger the chance it'll be solved soon. 55 | 56 | 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]. 57 | 58 | ### Diagrams 59 | 60 | Diagram of the multi-staged Dockerfile used for building multiple images. 61 | 62 | The actual content of a particular image build is controlled by the *feature variables*. 63 | 64 | ![Dockerfile.xfce.nvm stages][this-diagram-dockerfile-stages-nvm] 65 | 66 | *** 67 | 68 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 69 | 70 | [this-readme]: https://github.com/accetto/headless-coding-g3/blob/master/README.md 71 | 72 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 73 | 74 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 75 | 76 | [accetto-github-debian-vnc-xfce-g3]: https://github.com/accetto/debian-vnc-xfce-g3 77 | 78 | [accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3 79 | 80 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 81 | 82 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 83 | 84 | [this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-nvm-g3/ 85 | 86 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.nvm 87 | 88 | [this-diagram-dockerfile-stages-nvm]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.nvm.png 89 | 90 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 91 | 92 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 93 | 94 | [docker-ubuntu]: https://hub.docker.com/_/ubuntu/ 95 | -------------------------------------------------------------------------------- /docker/xfce-nvm/readme-append.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | [badge_latest_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@created.json 7 | 8 | [badge_latest_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker.json 9 | 10 | [link_latest_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker-verbose.txt 11 | 12 | 13 | 14 | [badge_chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@created.json 15 | 16 | [badge_chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker.json 17 | 18 | [link_chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker-verbose.txt 19 | 20 | 21 | 22 | [badge_vscode_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@created.json 23 | 24 | [badge_vscode_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@version-sticker.json 25 | 26 | [link_vscode_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@version-sticker-verbose.txt 27 | 28 | 29 | 30 | [badge_vscode-chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@created.json 31 | 32 | [badge_vscode-chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@version-sticker.json 33 | 34 | [link_vscode-chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@version-sticker-verbose.txt 35 | 36 | 37 | 38 | [badge_vscode-firefox_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@created.json 39 | 40 | [badge_vscode-firefox_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@version-sticker.json 41 | 42 | [link_vscode-firefox_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@version-sticker-verbose.txt 43 | -------------------------------------------------------------------------------- /docker/xfce-postman/README-dockerhub.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC and Postman desktop app 2 | 3 | ## accetto/debian-vnc-xfce-postman-g3 4 | 5 | [User Guide][this-user-guide] - [GitHub][this-github] - [Dockerfile][this-dockerfile] - [Readme][this-readme-full] - [Changelog][this-changelog] 6 | 7 | 8 | ![badge-github-release][badge-github-release]` ` 9 | ![badge-docker-pulls][badge-docker-pulls]` ` 10 | ![badge-docker-stars][badge-docker-stars] 11 | 12 | *** 13 | 14 | This Docker Hub repository contains Docker images for headless working with the [Postman][postman] desktop application. 15 | 16 | The images are based on the current [Debian 12][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. 17 | 18 | The popular web browsers [Chromium][chromium] or [Firefox][firefox] are also included. 19 | 20 | Adding more tools like, for example, [Newman][newman] usually requires only a single or just a few commands. The instructions are in the [provided README file][this-readme-postman-newman]. 21 | 22 | This [User guide][this-user-guide] describes the images and how to use them. 23 | 24 | The related [GitHub project][this-github] contains image generators that image users generally don’t need, unless they want to build the images themselves. 25 | 26 | ### Remarks 27 | 28 | The Postman company has decided to remove the `Scratch Pad` from the `Postman App` as of May 15, 2023. 29 | 30 | Therefore will these images always contain the `Postman App` version `10.13.6`, which is the last version still including the `Scratch Pad` and supporting off-line usage. 31 | 32 | Note that you would need to block the `Postman App` from updating itself. 33 | 34 | You can do it by blocking the auto-updater downloads by adding the following part to your compose configuration: 35 | 36 | ```yaml 37 | extra_hosts: 38 | - "dl.pstmn.io=127.0.0.1" 39 | ``` 40 | 41 | Alternatively you can add the following line to the file `/etc/hosts` in the container: 42 | 43 | ```text 44 | 127.0.0.1 dl.pstmn.io 45 | ``` 46 | 47 | ### Tags 48 | 49 | The following image tags are regularly built and published on Docker Hub: 50 | 51 | 52 | - `latest` implements VNC and noVNC 53 | 54 | ![badge_latest_created][badge_latest_created]` ` 55 | [![badge_latest_version-sticker][badge_latest_version-sticker]][link_latest_version-sticker-verbose] 56 | 57 | - `chromium` adds [Chromium Browser][chromium] 58 | 59 | ![badge_chromium_created][badge_chromium_created]` ` 60 | [![badge_chromium_version-sticker][badge_chromium_version-sticker]][link_chromium_version-sticker-verbose] 61 | 62 | - `firefox` adds [Firefox][firefox] 63 | 64 | ![badge_firefox_created][badge_firefox_created]` ` 65 | [![badge_firefox_version-sticker][badge_firefox_version-sticker]][link_firefox_version-sticker-verbose] 66 | 67 | 68 | 69 | **Hint:** Clicking the version sticker badge reveals more information about the particular build. 70 | 71 | ### Features 72 | 73 | The main features and components of the images in the default configuration are: 74 | 75 | - lightweight [Xfce][xfce] desktop environment (Debian distribution) 76 | - [sudo][sudo] support 77 | - utilities [curl][curl] and [git][git] (Debian distribution) 78 | - current version of JSON processor [jq][jq] 79 | - current version of high-performance [TigerVNC][tigervnc] server and client 80 | - current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**) 81 | - popular text editor [nano][nano] (Debian distribution) 82 | - lite but advanced graphical editor [mousepad][mousepad] (Debian distribution) 83 | - current version of [tini][tini] as the entry-point initial process (PID 1) 84 | - support for overriding environment variables, VNC parameters, user and group (see [User guide][this-user-guide-using-containers]) 85 | - support of **version sticker** (see [User guide][this-user-guide-version-sticker]) 86 | - current version of [Chromium Browser][chromium] open-source web browser (Debian distribution) 87 | - 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]) 88 | - [Postman App][postman] desktop application (version `10.13.6`, the last one still including `Scratch Pad`) 89 | 90 | The following **TCP** ports are exposed by default: 91 | 92 | - **5901** for access over **VNC** (using VNC viewer) 93 | - **6901** for access over [noVNC][novnc] (using web browser) 94 | 95 | ![container-screenshot][this-screenshot-container] 96 | 97 | This is the **third generation** (G3) of my headless images. 98 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 99 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 100 | 101 | ### Getting help 102 | 103 | 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. 104 | Please do not overlook the closed issues. 105 | 106 | If you do not find a solution, you can file a new issue. 107 | The better you describe the problem, the bigger the chance it'll be solved soon. 108 | 109 | 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]. 110 | 111 | *** 112 | 113 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 114 | 115 | [this-user-guide-version-sticker]: https://accetto.github.io/user-guide-g3/version-sticker/ 116 | 117 | [this-user-guide-using-containers]: https://accetto.github.io/user-guide-g3/using-containers/ 118 | 119 | [this-user-guide-firefox-plus]: https://accetto.github.io/user-guide-g3/firefox-plus/ 120 | 121 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 122 | [this-github]: https://github.com/accetto/headless-coding-g3/ 123 | 124 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 125 | 126 | [this-readme-full]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-postman/README.md 127 | 128 | [this-readme-postman-newman]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-postman/src/home/readme-postman-newman.md 129 | 130 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 131 | 132 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 133 | 134 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.postman 135 | 136 | [this-screenshot-container]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/animation-headless-coding-postman-live.gif 137 | 138 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 139 | 140 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 141 | 142 | [docker-debian]: https://hub.docker.com/_/debian/ 143 | 144 | [chromium]: https://www.chromium.org/Home 145 | [curl]: http://manpages.ubuntu.com/manpages/bionic/man1/curl.1.html 146 | [firefox]: https://www.mozilla.org 147 | [git]: https://git-scm.com/ 148 | [jq]: https://stedolan.github.io/jq/ 149 | [mousepad]: https://github.com/codebrainz/mousepad 150 | [nano]: https://www.nano-editor.org/ 151 | [newman]: https://github.com/postmanlabs/newman 152 | [novnc]: https://github.com/kanaka/noVNC 153 | [postman]: https://www.postman.com/downloads/ 154 | [sudo]: https://www.sudo.ws/ 155 | [tigervnc]: http://tigervnc.org 156 | [tini]: https://github.com/krallin/tini 157 | [xfce]: http://www.xfce.org 158 | 159 | [badge-github-release]: https://img.shields.io/github/v/release/accetto/headless-coding-g3 160 | 161 | [badge-docker-pulls]: https://img.shields.io/docker/pulls/accetto/debian-vnc-xfce-postman-g3 162 | 163 | [badge-docker-stars]: https://img.shields.io/docker/stars/accetto/debian-vnc-xfce-postman-g3 164 | 165 | 166 | -------------------------------------------------------------------------------- /docker/xfce-postman/README.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC and Postman desktop app 2 | 3 | ## accetto/debian-vnc-xfce-postman-g3 4 | 5 | [User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog] 6 | 7 | *** 8 | 9 | This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-postman-g3][this-docker]. 10 | 11 | This [User guide][this-user-guide] describes the images and how to use them. 12 | 13 | ### Building images 14 | 15 | ```shell 16 | ### PWD = project root 17 | ### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc') 18 | 19 | ### examples of building and publishing the individual images 20 | ./builder.sh postman all 21 | ./builder.sh postman-chromium all 22 | ./builder.sh postman-firefox all 23 | 24 | ### just building the image, skipping the publishing and the version sticker update 25 | ./builder.sh postman build 26 | 27 | ### examples of building and publishing the images as a group 28 | ./ci-builder.sh all group postman postman-chromium 29 | 30 | ### or all the images featuring the Postman 31 | ./ci-builder.sh all group complete-postman 32 | ``` 33 | 34 | Refer to the main [README][this-readme] file for more information about the building subject. 35 | 36 | ### Remarks 37 | 38 | This is a sibling project to the project [accetto/debian-vnc-xfce-g3][accetto-github-debian-vnc-xfce-g3]. 39 | 40 | There is also another sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu]. 41 | 42 | This is the **third generation** (G3) of my headless images. 43 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 44 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 45 | 46 | ### Getting help 47 | 48 | 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. 49 | Please do not overlook the closed issues. 50 | 51 | If you do not find a solution, you can file a new issue. 52 | The better you describe the problem, the bigger the chance it'll be solved soon. 53 | 54 | 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]. 55 | 56 | ### Diagrams 57 | 58 | Diagram of the multi-staged Dockerfile used for building multiple images. 59 | 60 | The actual content of a particular image build is controlled by the *feature variables*. 61 | 62 | ![Dockerfile.xfce.postman stages][this-diagram-dockerfile-stages-postman] 63 | 64 | *** 65 | 66 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 67 | 68 | [this-readme]: https://github.com/accetto/headless-coding-g3/blob/master/README.md 69 | 70 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 71 | 72 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 73 | 74 | [accetto-github-debian-vnc-xfce-g3]: https://github.com/accetto/debian-vnc-xfce-g3 75 | 76 | [accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3 77 | 78 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 79 | 80 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 81 | 82 | [this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-postman-g3/ 83 | 84 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.postman 85 | 86 | [this-diagram-dockerfile-stages-postman]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.postman.png 87 | 88 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 89 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 90 | 91 | [docker-ubuntu]: https://hub.docker.com/_/ubuntu/ 92 | -------------------------------------------------------------------------------- /docker/xfce-postman/readme-append.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | [badge_latest_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@created.json 7 | 8 | [badge_latest_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker.json 9 | 10 | [link_latest_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker-verbose.txt 11 | 12 | 13 | 14 | [badge_chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@created.json 15 | 16 | [badge_chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker.json 17 | 18 | [link_chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker-verbose.txt 19 | 20 | 21 | 22 | [badge_firefox_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@firefox@created.json 23 | 24 | [badge_firefox_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@firefox@version-sticker.json 25 | 26 | [link_firefox_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@firefox@version-sticker-verbose.txt 27 | -------------------------------------------------------------------------------- /docker/xfce-postman/src/home/Desktop/postman.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Postman 4 | Icon=/opt/Postman/app/resources/app/assets/icon.png 5 | Exec="/opt/Postman/Postman" 6 | Comment=Postman GUI 7 | Categories=Development;Code; 8 | -------------------------------------------------------------------------------- /docker/xfce-postman/src/home/readme-postman-newman.md: -------------------------------------------------------------------------------- 1 | # Readme `Postman` and `Newman` 2 | 3 | There is a command-line collection runner for `Postman` called `Newman`. It is an open-source `Node.js` application and it is available as an `npm` package. 4 | 5 | This Docker image **does not** come with any pre-installed `Newman` version by intention. That allows keeping the image slimmer. However, you can install `Newman` easily if you need it. 6 | 7 | ## Installing `Newman` 8 | 9 | First you have to install `Node.js` and `npm`: 10 | 11 | ```shell 12 | sudo apt-get update 13 | sudo apt-get -y install nodejs npm 14 | ``` 15 | 16 | Then you can install the Newman package globally: 17 | 18 | ```shell 19 | sudo npm -g install newman 20 | ``` 21 | 22 | You can check the versions by 23 | 24 | ```shell 25 | node -v 26 | npm -v 27 | npx -v 28 | newman -v 29 | ``` 30 | 31 | ## What next 32 | 33 | You can start by visiting the [Postman Learning Center](https://learning.postman.com/docs/getting-started/introduction/) and reading the article about [using Newman](https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/). You can also check the [Newman project on GitHub](https://github.com/postmanlabs/newman). 34 | -------------------------------------------------------------------------------- /docker/xfce-python/README.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC for `Python` development 2 | 3 | ## accetto/debian-vnc-xfce-python-g3 4 | 5 | [User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog] 6 | 7 | *** 8 | 9 | This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-python-g3][this-docker]. 10 | 11 | This [User guide][this-user-guide] describes the images and how to use them. 12 | 13 | ### Building images 14 | 15 | ```shell 16 | ### PWD = project root 17 | ### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc') 18 | 19 | ### examples of building and publishing the individual images 20 | ./builder.sh python all 21 | ./builder.sh python-chromium all 22 | ./builder.sh python-vscode all 23 | ./builder.sh python-vscode-chromium all 24 | ./builder.sh python-vscode-firefox all 25 | 26 | ### just building the image, skipping the publishing and the version sticker update 27 | ./builder.sh python build 28 | 29 | ### examples of building and publishing the images as a group 30 | ./ci-builder.sh all group python python-chromium python-vscode-chromium 31 | 32 | ### or all the images featuring Python 33 | ./ci-builder.sh all group complete-python 34 | ``` 35 | 36 | Refer to the main [README][this-readme] file for more information about the building subject. 37 | 38 | ### Remarks 39 | 40 | The [python-readme][this-readme-python] describes how to install additional Python modules and GUI frameworks. 41 | 42 | The container folder `$HOME/projects/samples/` already contains the following simple applications for testing: 43 | 44 | - loguru-test-app 45 | - typer-cli-test-app 46 | - tkinter-test-app 47 | - wx-test-app 48 | - pyqt-test-app 49 | - pyside-test-app 50 | - kivy-test-app 51 | 52 | There is also the branch `bonus-images-python-gui-frameworks`, which allows building images already including the most popular Python GUI frameworks (see above). 53 | Those images could be occasionally pushed to Docker Hub, but there will be no effort to do it regularly. 54 | However, you can built them yourself any time. 55 | 56 | This is a sibling project to the project [accetto/debian-vnc-xfce-g3][accetto-github-debian-vnc-xfce-g3]. 57 | 58 | There is also another sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu]. 59 | 60 | This is the **third generation** (G3) of my headless images. 61 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 62 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 63 | 64 | ### Getting help 65 | 66 | 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. 67 | Please do not overlook the closed issues. 68 | 69 | If you do not find a solution, you can file a new issue. 70 | The better you describe the problem, the bigger the chance it'll be solved soon. 71 | 72 | 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]. 73 | 74 | ### Diagrams 75 | 76 | Diagrams of the multi-staged Dockerfiles used for building multiple images. 77 | 78 | The actual content of a particular image build is controlled by the *feature variables*. 79 | 80 | ![Dockerfile.xfce.python stages][this-diagram-dockerfile-stages-python] 81 | 82 | ![Dockerfile.xfce.python (bonus) stages][this-diagram-dockerfile-stages-python-bonus] 83 | 84 | *** 85 | 86 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 87 | 88 | [this-readme]: https://github.com/accetto/headless-coding-g3/blob/master/README.md 89 | 90 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 91 | 92 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 93 | 94 | [this-readme-python]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-python/src/home/readme-python.md 95 | 96 | [accetto-github-debian-vnc-xfce-g3]: https://github.com/accetto/debian-vnc-xfce-g3 97 | 98 | [accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3 99 | 100 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 101 | 102 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 103 | 104 | [this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-python-g3/ 105 | 106 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.python 107 | 108 | [this-diagram-dockerfile-stages-python]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.python.png 109 | 110 | [this-diagram-dockerfile-stages-python-bonus]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.python-bonus.png 111 | 112 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 113 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 114 | 115 | [docker-ubuntu]: https://hub.docker.com/_/ubuntu/ 116 | -------------------------------------------------------------------------------- /docker/xfce-python/readme-append.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | [badge_latest_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@created.json 7 | 8 | [badge_latest_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker.json 9 | 10 | [link_latest_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker-verbose.txt 11 | 12 | 13 | 14 | [badge_chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@created.json 15 | 16 | [badge_chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker.json 17 | 18 | [link_chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker-verbose.txt 19 | 20 | 21 | 22 | [badge_vscode_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@created.json 23 | 24 | [badge_vscode_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@version-sticker.json 25 | 26 | [link_vscode_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode@version-sticker-verbose.txt 27 | 28 | 29 | 30 | [badge_vscode-chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@created.json 31 | 32 | [badge_vscode-chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@version-sticker.json 33 | 34 | [link_vscode-chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-chromium@version-sticker-verbose.txt 35 | 36 | 37 | 38 | [badge_vscode-firefox_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@created.json 39 | 40 | [badge_vscode-firefox_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@version-sticker.json 41 | 42 | [link_vscode-firefox_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@vscode-firefox@version-sticker-verbose.txt 43 | -------------------------------------------------------------------------------- /docker/xfce-python/src/home/readme-python.md: -------------------------------------------------------------------------------- 1 | # Readme `Python` 2 | 3 | This Docker image comes with only a few Python modules installed by intention. That allows you to choose the modules and the way of installation that suite you best. 4 | 5 | ## Updating `pip` and setup tools 6 | 7 | You can update pip and the related setup tools by: 8 | 9 | ```shell 10 | python -m pip install --upgrade pip setuptools wheel 11 | ``` 12 | 13 | ## Installing libraries and Python modules 14 | 15 | Additional libraries and some Python modules can be installed by `apt-get`, for example: 16 | 17 | ```shell 18 | ### apt cache needs to be refreshed only once 19 | sudo apt-get update 20 | 21 | ### numerical python library 22 | sudo apt-get install python3-numpy 23 | ``` 24 | 25 | Other Python modules can be installed by `pip`, for example: 26 | 27 | ```shell 28 | ### framework for easy logging 29 | pip install loguru 30 | 31 | ### framework for building CLI applications 32 | pip install typer 33 | 34 | ### or also 35 | ### python -m pip install loguru 36 | ### python -m pip install typer 37 | ``` 38 | 39 | You can also check the [Loguru documentation](https://github.com/Delgan/loguru) and the [Typer documentation](https://typer.tiangolo.com). 40 | 41 | ## Installing web frameworks 42 | 43 | The simple test applications can be found in `/srv/samples/`. 44 | 45 | **Hint**: It is recommended to use an image that includes also **Chromium** or **Firefox** web browser. Then you can test your web application inside the container. 46 | 47 | ### Flask 48 | 49 | The `Flask` web framework can be installed by: 50 | 51 | ```shell 52 | pip install flask 53 | ``` 54 | 55 | You can start by checking the [Flask documentation](https://palletsprojects.com/p/flask/). 56 | 57 | ### Bottle 58 | 59 | The `Bottle` web framework can be installed by: 60 | 61 | ```shell 62 | pip install bottle 63 | ``` 64 | 65 | You can start by checking the [Bottle documentation](https://bottlepy.org/). 66 | 67 | ## Installing GUI frameworks 68 | 69 | The following GUI frameworks are mutually exclusive and you need only one of them. The simple test applications can be found in `/srv/samples/`. 70 | 71 | Before installing any of the following frameworks you have to refresh the `apt` cache first: 72 | 73 | ```shell 74 | ### apt cache needs to be refreshed only once 75 | sudo apt-get update 76 | ``` 77 | 78 | ### Tkinter 79 | 80 | Installing `Tkinter`: 81 | 82 | ```shell 83 | ### install Tkinter 84 | sudo apt-get -y install python3-tk 85 | 86 | ### optional check: built-in test should open a window 87 | ### python -m tkinter 88 | ``` 89 | 90 | You can start by checking the [Tkinter documentation](https://docs.python.org/3/library/tkinter.html). 91 | 92 | ### wxPython 93 | 94 | Installing `wxPython`: 95 | 96 | ```shell 97 | ### install required libraries 98 | sudo apt-get -y install libsdl2-2.0-0 libxtst6 99 | 100 | ### install wxPython 101 | pip install -U \ 102 | -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 \ 103 | wxPython 104 | ``` 105 | 106 | You can start by checking the [wxPython documentation](https://wxpython.org/). 107 | 108 | ### PyQt5 109 | 110 | Installing `PyQt5`: 111 | 112 | ```shell 113 | ### install required libraries 114 | sudo apt-get -y install libqt5gui5 115 | 116 | ### install PyQt5 117 | pip install pyqt5 118 | 119 | ### optional: QtDesigner and other tools 120 | sudo apt-get -y install qttools5-dev-tools 121 | ``` 122 | 123 | You can start by checking the [PyQt5 documentation](https://riverbankcomputing.com/static/Docs/PyQt5). 124 | 125 | ### Qt for Python (PySide2 and PySide6) 126 | 127 | Installing `PySide2`: 128 | 129 | ```shell 130 | ### install required libraries 131 | sudo apt-get -y install libqt5gui5 132 | 133 | ### install PySide2 134 | pip install pyside2 135 | 136 | ### optional: QtDesigner and other tools 137 | sudo apt-get -y install qttools5-dev-tools 138 | ``` 139 | 140 | Installing `PySide6`: 141 | 142 | ```shell 143 | ### install required libraries 144 | sudo apt-get -y install libqt5gui5 libopengl0 145 | 146 | ### install PySide6 147 | pip install pyside6 148 | ``` 149 | 150 | You can start by checking the [Qt for Python documentation](https://doc.qt.io/qtforpython) and also the part about [Porting Applications from PySide2 to PySide6](https://doc.qt.io/qtforpython/porting_from2.html). 151 | 152 | ### Kivy 153 | 154 | Installing `Kivy`: 155 | 156 | ```shell 157 | ### install required libraries 158 | sudo apt-get -y install libgl1 libmtdev1 159 | 160 | ### install Kivy 161 | pip install kivy[base] 162 | 163 | ### optional: Kivy examples 164 | ### /home/headless/.local/share/kivy-examples/ 165 | pip install kivy_examples 166 | ``` 167 | 168 | You can start by checking the [Kivy documentation](https://kivy.org/doc/stable). 169 | 170 | ## What next 171 | 172 | You can start by checking the [Python Documentation](https://www.python.org/doc/). 173 | 174 | There are also some sample applications in `/srv/samples/`. 175 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/bottle-test-app/app.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run, template 2 | 3 | @route('/hello/') 4 | def index(name): 5 | return template('Hello {{name}}!', name=name) 6 | 7 | run(host='localhost', port=8080) 8 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/bottle-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `bottle-test-app` 2 | 3 | This is a very simple web application for testing the `Bottle` web framework. 4 | 5 | ## Prerequisites 6 | 7 | First install `Bottle`: 8 | 9 | ```shell 10 | pip install bottle 11 | ``` 12 | 13 | **Hint**: It is recommended to use an image that includes also **Chromium** or **Firefox** web browser. Then you can test your web application all inside the container. 14 | 15 | ## Starting test application 16 | 17 | The test application can be started by: 18 | 19 | ```shell 20 | ### PWD = /srv/samples/bottle-test-app 21 | python app.py 22 | ``` 23 | 24 | Then navigate the local web browser (inside the container) to the URL `http://localhost:8080/hello/world`. 25 | 26 | ## What next 27 | 28 | You can start by checking the [Bottle documentation](https://bottlepy.org/). 29 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/flask-test-app/app.py: -------------------------------------------------------------------------------- 1 | # save this as app.py 2 | from flask import Flask, escape, request 3 | 4 | app = Flask(__name__) 5 | 6 | @app.route('/') 7 | def hello(): 8 | name = request.args.get("name", "World") 9 | return f'Hello, {escape(name)}!' 10 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/flask-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `flask-test-app` 2 | 3 | This is a very simple web application for testing the `Flask` web framework. 4 | 5 | ## Prerequisites 6 | 7 | First install `Flask`: 8 | 9 | ```shell 10 | pip install flask 11 | ``` 12 | 13 | **Hint**: It is recommended to use an image that includes also **Chromium** or **Firefox** web browser. Then you can test your web application all inside the container. 14 | 15 | ## Starting test application 16 | 17 | The test application can be started by: 18 | 19 | ```shell 20 | ### PWD = /srv/samples/flask-test-app 21 | flask run 22 | ``` 23 | 24 | Then navigate the local web browser (inside the container) to the URL `http://localhost:5000`. 25 | 26 | ## What next 27 | 28 | You can start by checking the [Flask documentation](https://flask.palletsprojects.com/). 29 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/kivy-test-app/main.py: -------------------------------------------------------------------------------- 1 | import kivy 2 | 3 | # replace with your current kivy version ! 4 | kivy.require('2.0.0') 5 | 6 | from kivy.app import App 7 | from kivy.uix.button import Button 8 | 9 | 10 | class MyApp(App): 11 | 12 | def build(self): 13 | return Button(text='Hello World') 14 | 15 | 16 | if __name__ == '__main__': 17 | MyApp().run() 18 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/kivy-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `kivy-test-app` 2 | 3 | This is a very simple test application for the Python GUI framework `Kivy`. 4 | 5 | It is taken from the examples provided by `Kivy` (`kivy-examples/guide/quickstart`). The installation is described in the file `readme-python.md` in the home directory. 6 | 7 | ## Prerequisites 8 | 9 | First ensure that `Kivy` is correctly installed. The installation is described in the file `readme-python.md` in the home directory. 10 | 11 | ## Starting test application 12 | 13 | This test application should open a simple window: 14 | 15 | ```shell 16 | ### PWD = /srv/samples/kivy-test-app 17 | python main.py 18 | ``` 19 | 20 | ## What next 21 | 22 | You can start by checking the [Kivy documentation](https://kivy.org/doc/stable). 23 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/loguru-test-app/main.py: -------------------------------------------------------------------------------- 1 | from loguru import logger 2 | 3 | logger.info ("Hello, World!") 4 | logger.warning ("Warning, World!") 5 | logger.error ("Error, World!") 6 | logger.debug ("Debug, World!") 7 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/loguru-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `loguru-test-app` 2 | 3 | This is a very simple CLI application for testing the Python module `loguru`. 4 | 5 | ## Prerequisites 6 | 7 | First install `loguru`: 8 | 9 | ```shell 10 | pip install loguru 11 | ``` 12 | 13 | ## Starting test application 14 | 15 | The test application can be started by: 16 | 17 | ```shell 18 | ### PWD = /srv/samples/loguru-test-app 19 | python main.py 20 | ``` 21 | 22 | ## What next 23 | 24 | You can start by checking the [Loguru documentation](https://github.com/Delgan/loguru). 25 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/pyqt-test-app/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from PyQt5.QtWidgets import QApplication, QWidget 3 | 4 | app = QApplication(sys.argv) 5 | 6 | root = QWidget() 7 | 8 | root.resize(320, 240) 9 | root.setWindowTitle("Hello, World!") 10 | root.show() 11 | 12 | sys.exit(app.exec_()) 13 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/pyqt-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `pyqt-test-app` 2 | 3 | This is a very simple test application for the Python GUI framework `PyQt5`. 4 | 5 | ## Prerequisites 6 | 7 | First ensure that `PyQt5` is correctly installed. The installation is described in the file `readme-python.md` in the home directory. 8 | 9 | ## Starting test application 10 | 11 | This test application should open a simple window: 12 | 13 | ```shell 14 | ### PWD = /srv/samples/pqt-test-app 15 | python main.py 16 | ``` 17 | 18 | ## What next 19 | 20 | You can start by checking the [PyQt5 documentation](https://riverbankcomputing.com/static/Docs/PyQt5). 21 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/pyside-test-app/main.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | ### enable the correct framework version 4 | from PySide2 import QtCore, QtWidgets 5 | # from PySide6 import QtCore, QtWidgets 6 | 7 | app = QtWidgets.QApplication(sys.argv) 8 | 9 | mywindow = QtWidgets.QWidget() 10 | mywindow.resize(320, 240) 11 | mywindow.setWindowTitle('Hello, World!') 12 | 13 | mylabel = QtWidgets.QLabel(mywindow) 14 | mylabel.setText('Hello, World!') 15 | mylabel.setGeometry(QtCore.QRect(200, 200, 200, 200)) 16 | 17 | mywindow.show() 18 | 19 | sys.exit(app.exec_()) 20 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/pyside-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `pyside-test-app` 2 | 3 | This is a very simple test application for the Python GUI frameworks `PySide2` and `PySide6`. 4 | 5 | ## Prerequisites 6 | 7 | First ensure that `PySide2` or `PySide6` is correctly installed. The installation is described in the file `readme-python.md` in the home directory. 8 | 9 | ## Starting test application 10 | 11 | Before starting the application enable the correct framework version in the source file `main.py`: 12 | 13 | ```python 14 | ### enable the correct framework version 15 | from PySide2 import QtCore, QtWidgets 16 | # from PySide6 import QtCore, QtWidgets 17 | ``` 18 | 19 | The application should open a simple window: 20 | 21 | ```shell 22 | ### PWD = /srv/samples/pyside-test-app 23 | python main.py 24 | ``` 25 | 26 | ## What next 27 | 28 | You can start by checking the [Qt for Python documentation](https://doc.qt.io/qtforpython). 29 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/tkinter-test-app/main.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | 3 | class Application(tk.Frame): 4 | def __init__(self, master=None): 5 | super(Application, self).__init__(master=None) 6 | self.master = master 7 | self.pack() 8 | self.create_widgets() 9 | 10 | def create_widgets(self): 11 | self.hi_there = tk.Button(self) 12 | self.hi_there["text"] = "Hello World\n(click me)" 13 | self.hi_there["command"] = self.say_hi 14 | self.hi_there.pack(side="top") 15 | 16 | self.quit = tk.Button(self, text="QUIT", fg="red", command=self.master.destroy) 17 | self.quit.pack(side="bottom") 18 | 19 | def say_hi(self): 20 | print("hi there, everyone!") 21 | 22 | root = tk.Tk() 23 | app = Application(master=root) 24 | app.mainloop() 25 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/tkinter-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `tkinter-test-app` 2 | 3 | This is a very simple test application for the Python GUI framework `Tkinter` (Tk interface). 4 | 5 | ## Prerequisites 6 | 7 | First ensure that `Tkinter` is correctly installed. The installation is described in the file `readme-python.md` in the home directory. 8 | 9 | ## Starting test application 10 | 11 | This test application should open a simple window: 12 | 13 | ```shell 14 | ### PWD = /srv/samples/tkinter-test-app 15 | python main.py 16 | ``` 17 | 18 | ## What next 19 | 20 | You can start by checking the [Tkinter documentation](https://docs.python.org/3/library/tkinter.html). 21 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/typer-cli-test-app/main.py: -------------------------------------------------------------------------------- 1 | import typer 2 | 3 | app = typer.Typer() 4 | 5 | @app.command() 6 | def hello(name: str): 7 | print(f"Hello {name}") 8 | 9 | @app.command() 10 | def goodbye(): 11 | print("Goodbye") 12 | 13 | if __name__ == "__main__": 14 | app() 15 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/typer-cli-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `typer-cli-test-app` 2 | 3 | This is a very simple CLI application for testing the Python module `typer`. 4 | 5 | ## Prerequisites 6 | 7 | First install `typer`: 8 | 9 | ```shell 10 | pip install typer 11 | ``` 12 | 13 | ## Starting test application 14 | 15 | The test application can be started by: 16 | 17 | ```shell 18 | ### PWD = /srv/samples/typer-cli-test-app 19 | python main.py hello Joe 20 | ``` 21 | 22 | ## What next 23 | 24 | You can start by checking the [Typer documentation](https://typer.tiangolo.com). 25 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/wx-test-app/main.py: -------------------------------------------------------------------------------- 1 | import wx 2 | 3 | app = wx.App() 4 | 5 | frm = wx.Frame(None, title="Hello World") 6 | frm.Show() 7 | 8 | app.MainLoop() 9 | -------------------------------------------------------------------------------- /docker/xfce-python/src/samples/wx-test-app/readme.md: -------------------------------------------------------------------------------- 1 | # Readme `wx-test-app` 2 | 3 | This is a very simple test application for the Python GUI framework `wxPython`. 4 | 5 | ## Prerequisites 6 | 7 | First ensure that `Tkinter` is correctly installed. The installation is described in the file `readme-python.md` in the home directory. 8 | 9 | ## Starting test application 10 | 11 | This test application should open a simple window: 12 | 13 | ```shell 14 | ### PWD = /srv/samples/wx-test-app 15 | python main.py 16 | ``` 17 | 18 | ## What next 19 | 20 | You can start by checking the [wxPython documentation](https://wxpython.org/). 21 | -------------------------------------------------------------------------------- /docker/xfce-vscode/README-dockerhub.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC and and Visual Studio Code 2 | 3 | ## accetto/debian-vnc-xfce-vscode-g3 4 | 5 | [User Guide][this-user-guide] - [GitHub][this-github] - [Dockerfile][this-dockerfile] - [Readme][this-readme-full] - [Changelog][this-changelog] 6 | 7 | 8 | ![badge-github-release][badge-github-release]` ` 9 | ![badge-docker-pulls][badge-docker-pulls]` ` 10 | ![badge-docker-stars][badge-docker-stars] 11 | 12 | *** 13 | 14 | This Docker Hub repository contains Docker images for headless working with the the free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable]. 15 | 16 | The images are based on the current [Debian 12][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. 17 | 18 | The popular web browsers [Chromium][chromium] or [Firefox][firefox] are also included. 19 | 20 | This [User guide][this-user-guide] describes the images and how to use them. 21 | 22 | The related [GitHub project][this-github] contains image generators that image users generally don’t need, unless they want to build the images themselves. 23 | 24 | ### Sharing Visual Studio Code profiles 25 | 26 | You can share *portable* `Visual Studio Code` profiles using *volumes* if you build your `compose` file similar to this: 27 | 28 | ```yaml 29 | volumes: 30 | ### The volume should be prepared beforehand, otherwise 31 | ### it would be removed with the service. 32 | some-shared-vscode-profile-volume: 33 | external: true 34 | 35 | services: 36 | some-vscode-service: 37 | .... 38 | volumes: 39 | - type: volume 40 | source: some-shared-vscode-profile-volume: 41 | target: /home/headless/.vscode-portable/code/data/user-data/User 42 | - type: volume 43 | source: some-shared-vscode-profile-volume: 44 | target: /home/headless/.vscode-portable/code/data/extensions 45 | ``` 46 | 47 | Be aware, that if you don't prepare the volume beforehand, it will be removed with the service. 48 | Read more about [Docker volumes][doc-docker-volumes] and [Compose volumes][doc-compose-volumes] in the official documentation. 49 | 50 | ### Tags 51 | 52 | The following image tags are regularly built and published on Docker Hub: 53 | 54 | 55 | 56 | - `latest` implements VNC and noVNC 57 | 58 | ![badge_latest_created][badge_latest_created]` ` 59 | [![badge_latest_version-sticker][badge_latest_version-sticker]][link_latest_version-sticker-verbose] 60 | 61 | - `chromium` adds [Chromium Browser][chromium] 62 | 63 | ![badge_chromium_created][badge_chromium_created]` ` 64 | [![badge_chromium_version-sticker][badge_chromium_version-sticker]][link_chromium_version-sticker-verbose] 65 | 66 | - `firefox` adds [Firefox][firefox] 67 | 68 | ![badge_firefox_created][badge_firefox_created]` ` 69 | [![badge_firefox_version-sticker][badge_firefox_version-sticker]][link_firefox_version-sticker-verbose] 70 | 71 | **Hint:** Clicking the version sticker badge reveals more information about the particular build. 72 | 73 | ### Features 74 | 75 | The main features and components of the images in the default configuration are: 76 | 77 | - lightweight [Xfce][xfce] desktop environment (Debian distribution) 78 | - [sudo][sudo] support 79 | - utilities [curl][curl] and [git][git] (Debian distribution) 80 | - current version of JSON processor [jq][jq] 81 | - current version of high-performance [TigerVNC][tigervnc] server and client 82 | - current version of [noVNC][novnc] HTML5 clients (full and lite) (TCP port **6901**) 83 | - popular text editor [nano][nano] (Debian distribution) 84 | - lite but advanced graphical editor [mousepad][mousepad] (Debian distribution) 85 | - current version of [tini][tini] as the entry-point initial process (PID 1) 86 | - support for overriding environment variables, VNC parameters, user and group (see [User guide][this-user-guide-using-containers]) 87 | - support of **version sticker** (see [User guide][this-user-guide-version-sticker]) 88 | - current version of [Chromium Browser][chromium] open-source web browser (Debian distribution) 89 | - 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]) 90 | - current version of free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable] 91 | 92 | The following **TCP** ports are exposed by default: 93 | 94 | - **5901** for access over **VNC** (using VNC viewer) 95 | - **6901** for access over [noVNC][novnc] (using web browser) 96 | 97 | ![container-screenshot][this-screenshot-container] 98 | 99 | ### Remarks 100 | 101 | This is the **third generation** (G3) of my headless images. 102 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 103 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 104 | 105 | Note that the portable `Visual Studio Code` does not support automatic updates. 106 | However, manual updating is really easy. 107 | Visit the official [Portable Mode][vscode-portable] page for more information. 108 | 109 | Alternatively you can pull or build an updated `accetto` image containing the new `Visual Studio Code` version. 110 | 111 | ### Getting help 112 | 113 | 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. 114 | Please do not overlook the closed issues. 115 | 116 | If you do not find a solution, you can file a new issue. 117 | The better you describe the problem, the bigger the chance it'll be solved soon. 118 | 119 | 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]. 120 | 121 | *** 122 | 123 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 124 | 125 | [this-user-guide-version-sticker]: https://accetto.github.io/user-guide-g3/version-sticker/ 126 | 127 | [this-user-guide-using-containers]: https://accetto.github.io/user-guide-g3/using-containers/ 128 | 129 | [this-user-guide-firefox-plus]: https://accetto.github.io/user-guide-g3/firefox-plus/ 130 | 131 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 132 | [this-github]: https://github.com/accetto/headless-coding-g3/ 133 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 134 | 135 | [this-readme-full]: https://github.com/accetto/headless-coding-g3/blob/master/docker/xfce-vscode/README.md 136 | 137 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 138 | 139 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 140 | 141 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.vscode 142 | 143 | [this-screenshot-container]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/animation-headless-coding-vscode-live.gif 144 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 145 | 146 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 147 | 148 | [docker-debian]: https://hub.docker.com/_/debian/ 149 | 150 | [doc-docker-volumes]: https://docs.docker.com/storage/volumes/ 151 | [doc-compose-volumes]: https://docs.docker.com/compose/compose-file/07-volumes/ 152 | 153 | [chromium]: https://www.chromium.org/Home 154 | [curl]: http://manpages.ubuntu.com/manpages/bionic/man1/curl.1.html 155 | [firefox]: https://www.mozilla.org 156 | [git]: https://git-scm.com/ 157 | [jq]: https://stedolan.github.io/jq/ 158 | [mousepad]: https://github.com/codebrainz/mousepad 159 | [nano]: https://www.nano-editor.org/ 160 | [novnc]: https://github.com/kanaka/noVNC 161 | [tigervnc]: http://tigervnc.org 162 | [tini]: https://github.com/krallin/tini 163 | [sudo]: https://www.sudo.ws/ 164 | [vscode]: https://code.visualstudio.com/ 165 | [vscode-portable]: https://code.visualstudio.com/docs/editor/portable 166 | [xfce]: http://www.xfce.org 167 | 168 | [badge-github-release]: https://img.shields.io/github/v/release/accetto/headless-coding-g3 169 | 170 | [badge-docker-pulls]: https://img.shields.io/docker/pulls/accetto/debian-vnc-xfce-vscode-g3 171 | 172 | [badge-docker-stars]: https://img.shields.io/docker/stars/accetto/debian-vnc-xfce-vscode-g3 173 | 174 | 175 | -------------------------------------------------------------------------------- /docker/xfce-vscode/README.md: -------------------------------------------------------------------------------- 1 | # Headless Debian/Xfce container with VNC/noVNC and Visual Studio Code 2 | 3 | ## accetto/debian-vnc-xfce-vscode-g3 4 | 5 | [User Guide][this-user-guide] - [Docker Hub][this-docker] - [Dockerfile][this-dockerfile] - [Readme][this-readme] - [Changelog][this-changelog] 6 | 7 | *** 8 | 9 | This GitHub project folder contains resources used by building Debian images available on Docker Hub in the repository [accetto/debian-vnc-xfce-vscode-g3][this-docker]. 10 | 11 | This [User guide][this-user-guide] describes the images and how to use them. 12 | 13 | ### Building images 14 | 15 | ```shell 16 | ### PWD = project root 17 | ### prepare and source the 'secrets.rc' file first (see 'example-secrets.rc') 18 | 19 | ### examples of building and publishing the individual images 20 | ./builder.sh vscode all 21 | ./builder.sh vscode-chromium all 22 | ./builder.sh vscode-firefox all 23 | 24 | ### just building the image, skipping the publishing and the version sticker update 25 | ./builder.sh vscode build 26 | 27 | ### examples of building and publishing the images as a group 28 | ./ci-builder.sh all group vscode vscode-chromium 29 | 30 | ### or all the images featuring the Visual Studio Code 31 | ./ci-builder.sh all group complete-vscode 32 | ``` 33 | 34 | Refer to the main [README][this-readme] file for more information about the building subject. 35 | 36 | ### Remarks 37 | 38 | This is a sibling project to the project [accetto/debian-vnc-xfce-g3][accetto-github-debian-vnc-xfce-g3]. 39 | 40 | There is also another sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] containing images based on [Ubuntu 22.04 LTS and 20.04 LTS][docker-ubuntu]. 41 | 42 | This is the **third generation** (G3) of my headless images. 43 | The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. 44 | The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. 45 | 46 | ### Getting help 47 | 48 | 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. 49 | Please do not overlook the closed issues. 50 | 51 | If you do not find a solution, you can file a new issue. 52 | The better you describe the problem, the bigger the chance it'll be solved soon. 53 | 54 | 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]. 55 | 56 | ### Diagrams 57 | 58 | Diagram of the multi-staged Dockerfile used for building multiple images. 59 | 60 | The actual content of a particular image build is controlled by the *feature variables*. 61 | 62 | ![Dockerfile.xfce.vscode stages][this-diagram-dockerfile-stages-vscode] 63 | 64 | *** 65 | 66 | [this-user-guide]: https://accetto.github.io/user-guide-g3/ 67 | 68 | [this-readme]: https://github.com/accetto/headless-coding-g3/blob/master/README.md 69 | 70 | [this-changelog]: https://github.com/accetto/headless-coding-g3/blob/master/CHANGELOG.md 71 | 72 | [this-issues]: https://github.com/accetto/headless-coding-g3/issues 73 | 74 | [accetto-github-debian-vnc-xfce-g3]: https://github.com/accetto/debian-vnc-xfce-g3 75 | 76 | [accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3 77 | 78 | [sibling-discussions]: https://github.com/accetto/ubuntu-vnc-xfce-g3/discussions 79 | 80 | [sibling-wiki]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki 81 | 82 | [this-docker]: https://hub.docker.com/r/accetto/debian-vnc-xfce-vscode-g3/ 83 | 84 | [this-dockerfile]: https://github.com/accetto/headless-coding-g3/blob/master/docker/Dockerfile.xfce.vscode 85 | 86 | [this-diagram-dockerfile-stages-vscode]: https://raw.githubusercontent.com/accetto/headless-coding-g3/master/docker/doc/images/Dockerfile.xfce.vscode.png 87 | 88 | [accetto-github-xubuntu-vnc-novnc]: https://github.com/accetto/xubuntu-vnc-novnc/ 89 | [accetto-github-ubuntu-vnc-xfce]: https://github.com/accetto/ubuntu-vnc-xfce 90 | 91 | [docker-ubuntu]: https://hub.docker.com/_/ubuntu/ 92 | -------------------------------------------------------------------------------- /docker/xfce-vscode/readme-append.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | [badge_latest_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@created.json 7 | 8 | [badge_latest_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker.json 9 | 10 | [link_latest_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@latest@version-sticker-verbose.txt 11 | 12 | 13 | 14 | [badge_chromium_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@created.json 15 | 16 | [badge_chromium_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker.json 17 | 18 | [link_chromium_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@chromium@version-sticker-verbose.txt 19 | 20 | 21 | 22 | [badge_firefox_created]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@firefox@created.json 23 | 24 | [badge_firefox_version-sticker]: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@firefox@version-sticker.json 25 | 26 | [link_firefox_version-sticker-verbose]: https://gist.githubusercontent.com/${OWNER}/${GIST}/raw/${REPO}@firefox@version-sticker-verbose.txt 27 | -------------------------------------------------------------------------------- /docker/xfce-vscode/src/home/Desktop/code.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Visual Studio Code 3 | Comment=Code Editing. Redefined. 4 | GenericName=Text Editor 5 | Exec=${VSCODE_PATH}/code --no-sandbox --unity-launch %F 6 | Icon=${VSCODE_PATH}/resources/app/resources/linux/code.png 7 | Type=Application 8 | StartupNotify=false 9 | StartupWMClass=Code 10 | Categories=Utility;TextEditor;Development;IDE; 11 | MimeType=text/plain;inode/directory; 12 | Actions=new-empty-window; 13 | Keywords=vscode; 14 | 15 | X-Desktop-File-Install-Version=0.23 16 | 17 | Path= 18 | Terminal=false 19 | 20 | [Desktop Action new-empty-window] 21 | Name=New Empty Window 22 | Exec=${VSCODE_PATH}/code --no-sandbox --new-window %F 23 | Icon=${VSCODE_PATH}/resources/app/resources/linux/code.png 24 | -------------------------------------------------------------------------------- /docker/xfce-vscode/src/vscode/data/user-data/User/keybindings.json: -------------------------------------------------------------------------------- 1 | // Place your key bindings in this file to override the defaults 2 | [ 3 | 4 | ] -------------------------------------------------------------------------------- /docker/xfce-vscode/src/vscode/data/user-data/User/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to override the defaults 2 | { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /docker/xfce/src/home/Desktop/versionsticker.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=Version Sticker 5 | Comment=Verbose version sticker 6 | Exec=bash -c 'echo "Wait..." ; ${STARTUPDIR}/version_sticker.sh -f -V ; read -p "Press ENTER..."' 7 | Path=${STARTUPDIR} 8 | Terminal=true 9 | StartupNotify=false 10 | Icon=application-certificate -------------------------------------------------------------------------------- /docker/xfce/src/home/config/xfce4/terminal/terminalrc: -------------------------------------------------------------------------------- 1 | [Configuration] 2 | Encoding=UTF-8 3 | MiscAlwaysShowTabs=FALSE 4 | MiscBell=FALSE 5 | MiscBellUrgent=FALSE 6 | MiscBordersDefault=TRUE 7 | MiscCursorBlinks=FALSE 8 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 9 | MiscDefaultGeometry=80x24 10 | MiscInheritGeometry=FALSE 11 | MiscMenubarDefault=TRUE 12 | MiscMouseAutohide=FALSE 13 | MiscMouseWheelZoom=TRUE 14 | MiscToolbarDefault=FALSE 15 | MiscConfirmClose=TRUE 16 | MiscCycleTabs=TRUE 17 | MiscTabCloseButtons=TRUE 18 | MiscTabCloseMiddleClick=TRUE 19 | MiscTabPosition=GTK_POS_TOP 20 | MiscHighlightUrls=TRUE 21 | MiscMiddleClickOpensUri=FALSE 22 | MiscCopyOnSelect=FALSE 23 | MiscShowRelaunchDialog=TRUE 24 | MiscRewrapOnResize=TRUE 25 | MiscUseShiftArrowsToScroll=FALSE 26 | MiscSlimTabs=FALSE 27 | MiscNewTabAdjacent=FALSE 28 | MiscSearchDialogOpacity=100 29 | MiscShowUnsafePasteDialog=TRUE 30 | 31 | -------------------------------------------------------------------------------- /docker/xfce/src/home/config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docker/xfce/src/home/config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docker/xfce/src/home/config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /docker/xfce/src/home/readme.md: -------------------------------------------------------------------------------- 1 | # Readme 2 | 3 | This is the main **README** file of a set of configurable Docker images that can include additional features. 4 | 5 | There are additional **README** files in the home directory. 6 | -------------------------------------------------------------------------------- /examples/Dockerfile.extend: -------------------------------------------------------------------------------- 1 | # docker build -f Dockerfile.extend -t accetto/debian-vnc-xfce-nodejs-g3:extended . 2 | 3 | ### This is an example of extending the images. 4 | 5 | ### HINTS 6 | ### Sometimes you can get building errors related to cache handling. 7 | ### One of the following usually helps: 8 | ### (1) Use the '--no-cache' option 9 | ### > docker build ... --no-cache 10 | ### (2) Purge the builder cache before and/or between builds 11 | ### > docker builder prune 12 | ### (3) Re-open the terminal and/or Visual Studio Code 13 | ### (4) Remove the line containing 'rm -rf /var/lib/apt/lists/*' 14 | ### from your extending Dockerfile (like this one) 15 | 16 | ### choose a base image and tag 17 | ARG BASEIMAGE="accetto/debian-vnc-xfce-nodejs-g3" 18 | # ARG BASEIMAGE="accetto/debian-vnc-xfce-postman-g3" 19 | # ARG BASEIMAGE="accetto/debian-vnc-xfce-python-g3" 20 | ARG BASETAG="latest" 21 | # ARG BASETAG="current" 22 | # ARG BASETAG="chromium" 23 | # ARG BASETAG="firefox" 24 | # ARG BASETAG="vscode" 25 | # ARG BASETAG="vscode-chromium" 26 | # ARG BASETAG="vscode-firefox" 27 | 28 | FROM ${BASEIMAGE}:${BASETAG} 29 | 30 | ### switch to the root user to be able to install new packages 31 | USER 0 32 | 33 | ### update the apt cache and install your new packages 34 | ### e.g. vim editor 35 | RUN \ 36 | apt-get update \ 37 | && apt-get install -y --no-install-recommends \ 38 | vim \ 39 | && apt-get -y autoremove \ 40 | && rm -rf /var/lib/apt/lists/* 41 | 42 | ### maybe you want to add some additional resources 43 | ### e.g. some preconfigured files 44 | # COPY ./bashrc "${HOME}"/.bashrc 45 | # COPY ./firefox.plus/user.js "${HOME}"/firefox.plus/ 46 | 47 | ### avoid the pitfall of failing startup under some circumstances 48 | ### permissions will be set to the system defaults on the first container start 49 | RUN chmod 666 /etc/passwd /etc/group 50 | 51 | ### usually you want to switch back to a non-root user 52 | ### alternatively you can do it in a compose file (see 'example.yml') 53 | USER "${HEADLESS_USER_ID}" 54 | 55 | ### note that some applications refuse to be installed under the root user 56 | ### those you have to install after switching the user 57 | # RUN \ 58 | # npm install -g \ 59 | # sqlite3 \ 60 | # knex \ 61 | # newman 62 | # RUN \ 63 | # apt-get update \ 64 | # && apt-get install -y \ 65 | # \ 66 | # && apt-get -y autoremove \ 67 | # && rm -rf /var/lib/apt/lists/* 68 | -------------------------------------------------------------------------------- /examples/example-override-envv.rc: -------------------------------------------------------------------------------- 1 | ### only the lines beginning with 'export ' at the first position and containing '=' will be sourced 2 | export VNC_RESOLUTION=1024x768 3 | export VNC_PW=secret 4 | #export DISPLAY=:2 5 | #export VNC_COL_DEPTH=32 6 | -------------------------------------------------------------------------------- /examples/example-secrets.rc: -------------------------------------------------------------------------------- 1 | ### This files configures the environment (including secrets!) for building images locally. 2 | ### Source this file before building. 3 | ### Rename it to "secrets.rc" (or similar) and **make sure** that the '.gitignore' and '.dockerignore' files 4 | ### contain the 'secret*' exclusion pattern! 5 | ### Example: source ./secrets.rc 6 | ### This file is automatically sourced by the script 'hooks/env.rc' if it's found in the same directory. 7 | 8 | #region General building pipeline control 9 | 10 | export DOCKER_BUILDKIT=1 11 | # export COMPOSE_DOCKER_CLI_BUILD=0 12 | 13 | ### will force re-building regardless of the verbose version sticker changes 14 | # export FORCE_BUILDING=0 15 | 16 | ### will prohibit re-building regardless of verbose version sticker changes 17 | # export PROHIBIT_BUILDING=0 18 | 19 | #endregion 20 | 21 | 22 | #region Optional version sticker prefix and/or suffix 23 | 24 | # export VERSION_STICKER_PREFIX="LOCAL-BETA-" 25 | # export VERSION_STICKER_SUFFIX="-BETA" 26 | 27 | #endregion 28 | 29 | 30 | #region Development environment 31 | 32 | ### ----------------------- 33 | ### development environment 34 | ### ----------------------- 35 | 36 | # ### owner of Docker Hub repos 37 | # export REPO_OWNER_NAME="" 38 | # ### development builder gist 39 | # export GIST_ID="" 40 | # ### development deployment gist 41 | # export DEPLOY_GIST_ID="" 42 | # ### note that the reserved repository name 'void' will prohibit the publishing 43 | # ### primary deployment repos may not exist (may be also left unset) 44 | # export DEPLOYMENT_REPO_NODEJS="void" 45 | # export DEPLOYMENT_REPO_NVM="void" 46 | # export DEPLOYMENT_REPO_POSTMAN="void" 47 | # export DEPLOYMENT_REPO_PYTHON="void" 48 | # export DEPLOYMENT_REPO_VSCODE="void" 49 | # ### builder repo can be a secondary deployment repo (if FORCE_PUBLISHING_BUILDER_REPO=1) 50 | # export BUILDER_REPO="" 51 | # ### shared g3-cache is outside the Docker building context 52 | # export SHARED_G3_CACHE_PATH="" 53 | # ### used to control building/publishing (unset means '0') 54 | # ## export FORCE_PUBLISHING_BUILDER_REPO=1 55 | # ## export FORCE_BUILDING=1 56 | # ### used by the 'post_push' hook script, which normally removes the helper files 57 | # # export KEEP_HELPER_FILES=0 58 | # ### explicitly disable features that are enabled by default 59 | # # export FEATURES_NOVNC=0 60 | # # export FEATURES_FIREFOX_PLUS=0 61 | # # export FEATURES_OVERRIDING_ENVV=0 62 | # ### ignoring 'wget' checking may be helpful on Windows 63 | # # export IGNORE_MISSING_WGET=1 64 | 65 | #endregion 66 | 67 | 68 | #region Production environment 69 | 70 | ### ---------------------- 71 | ### production environment 72 | ### ---------------------- 73 | 74 | # ### owner of Docker Hub repos 75 | # export REPO_OWNER_NAME="" 76 | # ### production builder gist 77 | # export GIST_ID="" 78 | # ### production deployment gist 79 | # export DEPLOY_GIST_ID="" 80 | # ### note that the reserved repository name 'void' will prohibit the publishing 81 | # ### primary deployment repos 82 | # export DEPLOYMENT_REPO_NODEJS="" 83 | # export DEPLOYMENT_REPO_NVM="" 84 | # export DEPLOYMENT_REPO_POSTMAN="" 85 | # export DEPLOYMENT_REPO_PYTHON="" 86 | # export DEPLOYMENT_REPO_VSCODE="" 87 | # ### builder repo can be a secondary deployment repo (if FORCE_PUBLISHING_BUILDER_REPO=1) 88 | # export BUILDER_REPO="" 89 | # ### shared g3-cache is outside the Docker building context 90 | # export SHARED_G3_CACHE_PATH="" 91 | # ### used to control building/publishing (unset means '0') 92 | # ## export FORCE_PUBLISHING_BUILDER_REPO=1 93 | # ## export FORCE_BUILDING=1 94 | # ### used by the 'post_push' hook script, which normally removes the helper files 95 | # export KEEP_HELPER_FILES=0 96 | # ### explicitly disable features that are enabled by default 97 | # # export FEATURES_NOVNC=0 98 | # # export FEATURES_FIREFOX_PLUS=0 99 | # # export FEATURES_OVERRIDING_ENVV=0 100 | # ### ignoring 'wget' checking may be helpful on Windows 101 | # # export IGNORE_MISSING_WGET=1 102 | 103 | #endregion 104 | 105 | 106 | #region Real secrets 107 | 108 | ### ------------ 109 | ### REAL SECRETS 110 | ### ------------ 111 | 112 | ### !!! REAL SECRET !!! 113 | ### GitHub: Settings/Developer settings/Personal access tokens 114 | ### this PAT must have the 'gist' scope 115 | ### warning! this gist token is valid for all gists of the same owner! 116 | # export GIST_TOKEN="" 117 | 118 | ### !!! REAL SECRETS !!! 119 | ### Docker Hub credentials 120 | ### warning! this credentials are valid for all Docker Hub repositories of the same owner! 121 | # export DOCKERHUB_USERNAME="" 122 | # export DOCKERHUB_PASSWORD="" 123 | 124 | #endregion 125 | -------------------------------------------------------------------------------- /examples/example.yml: -------------------------------------------------------------------------------- 1 | # docker-compose -f example.yml -p example up -d 2 | # docker-compose -f example.yml -p example down --volumes 3 | 4 | ### This example shows how to switch to another non-root user 5 | ### and how to set the VNC password (to an empty one) and VNC resolution. 6 | 7 | version: '3' 8 | 9 | services: 10 | test: 11 | image: accetto/debian-vnc-xfce-nodejs-g3:extended 12 | # environment: 13 | # - VNC_PW= 14 | # - VNC_RESOLUTION=1024x768 15 | ports: 16 | - ":5901" 17 | - ":6901" 18 | user: "2000:3000" 19 | -------------------------------------------------------------------------------- /readme-g3-cache.md: -------------------------------------------------------------------------------- 1 | # Custom `g3-cache` 2 | 3 | - [Custom `g3-cache`](#custom-g3-cache) 4 | - [Introduction](#introduction) 5 | - [Ensure `wget` utility](#ensure-wget-utility) 6 | - [Local `g3-cache`](#local-g3-cache) 7 | - [Shared g3-cache](#shared-g3-cache) 8 | - [Helper script `cache`](#helper-script-cache) 9 | 10 | ## Introduction 11 | 12 | The custom `g3-cache` has been introduced in the **second version** (G3v2) of the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3]. 13 | 14 | The local `g3-cache` is an additional cache used by the building pipeline and it should not be confused with the **Docker builder cache** maintained by the [Docker Build][docker-doc-docker-build] itself. 15 | 16 | The `g3-cache` stores the selected pre-downloaded packages used by the Dockerfiles, that would be otherwise repeatedly downloaded from the external sources by each build. 17 | 18 | It results in a significantly higher performance by building sets of images or by repeated builds. 19 | 20 | You can learn more about the concept on the sibling Wiki page ["Concepts of `g3-cache`"][sibling-wiki-concepts-of-g3-cache] and about the implementation on the sibling Wiki page ["How `g3-cache` works"][sibling-wiki-how-g3-cache-works]. 21 | 22 | ### Ensure `wget` utility 23 | 24 | If you are on Windows, you can encounter the problem of missing `wget` utility. 25 | It is used by refreshing the `g3-cache` and it's available on Linux by default. 26 | 27 | On Windows you have generally two choices. 28 | You can build your images inside the `WSL` environment or you can download the `wget.exe` application for Windows. 29 | Make sure to update also the `PATH` environment variable appropriately. 30 | 31 | ## Local `g3-cache` 32 | 33 | The local `g3-cache` of this project has the following **cache sections**: 34 | 35 | - `nodejs` 36 | - `novnc` 37 | - `postman` 38 | - `tigervnc` 39 | - `vscode` 40 | - `websockify` 41 | 42 | The local `g3-cache` folder `docker/.g3-cache` is excluded from the commits into the `git` repository by the means of the `.gitignore` file. 43 | 44 | You can delete the local `g3-cache` folder any time, because it will be re-created each time you build an image. 45 | 46 | ## Shared g3-cache 47 | 48 | The absolute path to the root folder of the shared `g3-cache` should be set as the value of the environment variable `SHARED_G3_CACHE_PATH`. 49 | 50 | The same shared `g3-cache` is usually used also by the sibling projects, for example [accetto/debian-vnc-xfce-g3][accetto-github-debian-vnc-xfce-g3], [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3] and [accetto/headless-drawing-g3][accetto-github-headless-drawing-g3]. 51 | 52 | ## Helper script `cache` 53 | 54 | Both `g3-caches` are refreshed by the helper script `cache`, which is stored in the folder `docker/hooks/`. 55 | Therefore it's sometimes referenced as a hook script. 56 | 57 | The script is used by the hook scripts `pre_build` and `build`. 58 | However, it can be executed also stand-alone. 59 | 60 | Since the version `G3v8` (Release `25.05`) the updated script checks if the shared `g3-cache` directory, defined by the environment variable `SHARED_G3_CACHE_PATH`, is reachable and writable. 61 | The shared `g3-cache` update will be skipped otherwise. 62 | 63 | **Remark**: The current implementation of the cache refreshing code is not thread safe and it is not intended for parallel building of multiple images. 64 | 65 | *** 66 | 67 | [sibling-wiki-concepts-of-g3-cache]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/Concepts-of-g3-cache 68 | [sibling-wiki-how-g3-cache-works]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/How-g3-cache-works 69 | 70 | [accetto-github-debian-vnc-xfce-g3]: https://github.com/accetto/debian-vnc-xfce-g3/ 71 | [accetto-github-ubuntu-vnc-xfce-g3]: https://github.com/accetto/ubuntu-vnc-xfce-g3/ 72 | [accetto-github-headless-drawing-g3]: https://github.com/accetto/headless-drawing-g3 73 | 74 | [docker-doc-docker-build]: https://docs.docker.com/develop/develop-images/build_enhancements/ 75 | -------------------------------------------------------------------------------- /utils/readme-util-readme-examples.md: -------------------------------------------------------------------------------- 1 | # Examples `util-readme.sh` 2 | 3 | ## Preparation 4 | 5 | Open a terminal window and change the current directory to `utils`. 6 | 7 | The utility requires the `ID` of the deployment **GitHub Gist**, which you can provide as a parameter or by setting the environment variable `DEPLOY_GIST_ID`: 8 | 9 | ```shell 10 | export DEPLOY_GIST_ID="" 11 | ``` 12 | 13 | Embedded help describes the parameters: 14 | 15 | ```shell 16 | ./util-readme.sh -h 17 | ``` 18 | 19 | ## Usage examples 20 | 21 | ```shell 22 | ### PWD = utils/ 23 | 24 | ./util-readme.sh --repo accetto/debian-vnc-xfce-nodejs-g3 --context=../docker/xfce-nodejs --gist -- preview 25 | 26 | ./util-readme.sh --repo accetto/debian-vnc-xfce-nvm-g3 --context=../docker/xfce-nvm --gist -- preview 27 | 28 | ./util-readme.sh --repo accetto/debian-vnc-xfce-postman-g3 --context=../docker/xfce-postman --gist -- preview 29 | 30 | ./util-readme.sh --repo accetto/debian-vnc-xfce-python-g3 --context=../docker/xfce-python --gist -- preview 31 | 32 | ./util-readme.sh --repo accetto/debian-vnc-xfce-vscode-g3 --context=../docker/xfce-vscode --gist -- preview 33 | 34 | ### or if the environment variable 'DEPLOY_GIST_ID' has been set 35 | 36 | ./util-readme.sh --repo accetto/debian-vnc-xfce-nodejs-g3 --context=../docker/xfce-nodejs -- preview 37 | 38 | ./util-readme.sh --repo accetto/debian-vnc-xfce-nvm-g3 --context=../docker/xfce-nvm -- preview 39 | 40 | ./util-readme.sh --repo accetto/debian-vnc-xfce-postman-g3 --context=../docker/xfce-postman -- preview 41 | 42 | ./util-readme.sh --repo accetto/debian-vnc-xfce-python-g3 --context=../docker/xfce-python -- preview 43 | 44 | ./util-readme.sh --repo accetto/debian-vnc-xfce-vscode-g3 --context=../docker/xfce-vscode -- preview 45 | ``` 46 | 47 | See the sibling Wiki page ["Utility util-readme.sh"][sibling-wiki-utility-util-readme] for more information. 48 | 49 | *** 50 | 51 | [sibling-wiki-utility-util-readme]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/Utility-util-readme 52 | --------------------------------------------------------------------------------