From dbed7d5f4f5a3dd19bdee128fe0811edd878d739 Mon Sep 17 00:00:00 2001 From: accetto <34798830+accetto@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:04:46 +0100 Subject: [PATCH] Release 24.03 --- .gitignore | 3 +- CHANGELOG.md | 26 +++++++++++ README.md | 16 +++++-- docker/Dockerfile.xfce.nodejs | 45 ++++++++++++------ docker/Dockerfile.xfce.nvm | 46 +++++++++++++------ docker/Dockerfile.xfce.postman | 2 +- docker/Dockerfile.xfce.python | 45 ++++++++++++------ docker/Dockerfile.xfce.vscode | 41 ++++++++++++----- docker/hooks/build | 12 +++++ docker/hooks/cache | 25 ++++++++++ docker/hooks/env.rc | 9 ++++ docker/hooks/pre_build | 12 +++++ docker/hooks/release_of | 19 ++++++++ .../src/xfce-startup/set_user_permissions.sh | 21 +++++---- docker/src/xfce-startup/version_of.sh | 4 +- docker/xfce-nodejs/README-dockerhub.md | 17 +++++-- docker/xfce-nvm/README-dockerhub.md | 17 +++++-- docker/xfce-python/README-dockerhub.md | 17 +++++-- docker/xfce-vscode/README-dockerhub.md | 11 ++++- .../xfce-vscode/src/home/Desktop/code.desktop | 8 ++-- .../src/home/config/Code/User/settings.json | 3 -- .../data/user-data/User/keybindings.json | 4 ++ .../vscode/data/user-data/User/settings.json | 4 ++ readme-g3-cache.md | 1 + 24 files changed, 317 insertions(+), 91 deletions(-) delete mode 100644 docker/xfce-vscode/src/home/config/Code/User/settings.json create mode 100644 docker/xfce-vscode/src/vscode/data/user-data/User/keybindings.json create mode 100644 docker/xfce-vscode/src/vscode/data/user-data/User/settings.json diff --git a/.gitignore b/.gitignore index 64181a2..1684fca 100644 --- a/.gitignore +++ b/.gitignore @@ -11,10 +11,9 @@ # '**' matches nested directories (e.g. 'a/**/z') # recommended files on 'https://github.com/github/gitignore' +..developer* .vscode .cache* -.debugger* -.developer* .favorites.json .g3-cache* .secret* diff --git a/CHANGELOG.md b/CHANGELOG.md index b391f10..ebb9871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,28 @@ *** +### Release 24.03 + +This is the first `G3v5` release. +It also introduces the [portable Visual Studio Code][vscode-portable] installation. + +*Remark*: The version number `G3v4` has been skipped, to align the numbering with the sibling project [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3]. + +The updated script `set_user_permissions.sh`, which is part of Dockerfiles, skips the hidden files and directories now. +It generally should not have any unwanted side effects, but it may make a difference in some scenarios, hence the version increase. + +The default `Visual Studio Code` installation path is `$HOME/.vscode-portable/code` and it can be changed by setting the build argument `ARG_VSCODE_PATH`. + +By setting the build argument `ARG_VSCODE_VERSION` it's possible to install a particular `Visual Studio Code` version. + +The complete `Visual Studio Code` profile is by default in the folder `$HOME/.vscode-portable/code/data`. + +Note that the portable `Visual Studio Code` does not support automatic updates. +However, manual updating is really easy. +Visit the official [Portable Mode][vscode-portable] page for more information. + +Alternatively you can pull or build an updated `accetto` image containing the new `Visual Studio Code` version. + ### Release 23.12 This release brings new images containing the free open-source utility `NVM` (Node Version Manager), which allows installing and using multiple `Node.js` versions concurrently. No `Node.js` version is installed by default. @@ -459,3 +481,7 @@ This is just a maintenance release. [sibling-wiki-building-stages]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/Building-stages [sibling-wiki-how-ci-works]: https://github.com/accetto/ubuntu-vnc-xfce-g3/wiki/How-CI-works + + + +[vscode-portable]: https://code.visualstudio.com/docs/editor/portable diff --git a/README.md b/README.md index 57ac9df..dda3dc1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Project `accetto/headless-coding-g3` -Version: G3v3 +Version: G3v5 *** @@ -95,11 +95,19 @@ The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc ### Project versions -This file describes the **third version** (G3v3) of the project, which however corresponds to the **fourth version** (G3v4) of the **sibling project** [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3]. +This file describes the **fifth version** (G3v5) of the project. + +*Remark*: The version number `G3v4` has been skipped, to align the numbering with the **sibling project** [accetto/ubuntu-vnc-xfce-g3][accetto-github-ubuntu-vnc-xfce-g3]. The **second version** (G3v2) and the **first version** (G3v1, or simply G3) will still be available in this GitHub repository as the branches `archived-generation-g3v2-ubuntu` and `archived-generation-g3v1`. +The **third version** (G3v3) was not archived, because the changes are minor. + +The version `G3v5` brings only one significant change comparing to the previous version `G3v3` and it also introduces the [portable Visual Studio Code][vscode-portable] installation. -The version `G3v3` brings the following major changes comparing to the previous version `G3v2`: +- The updated script `set_user_permissions.sh`, which is part of Dockerfiles, skips the hidden files and directories now. +It generally should not have any unwanted side effects, but it may make a difference in some scenarios, hence the version increase. + +The version `G3v3` has brought the following major changes comparing to the previous version `G3v2`: - The updated startup scripts that support overriding the user ID (`id`) and group ID (`gid`) without needing the former build argument `ARG_FEATURES_USER_GROUP_OVERRIDE`, which has been removed. - The user ID and the group ID can be overridden during the build time (`docker build`) and the run time (`docker run`). @@ -226,8 +234,10 @@ Credit goes to all the countless people and companies, who contribute to open so [firefox]: https://www.mozilla.org [novnc]: https://github.com/kanaka/noVNC [tigervnc]: http://tigervnc.org +[vscode-portable]: https://code.visualstudio.com/docs/editor/portable [xfce]: http://www.xfce.org + [badge-github-release]: https://badgen.net/github/release/accetto/headless-coding-g3?icon=github&label=release [badge-github-release-date]: https://img.shields.io/github/release-date/accetto/headless-coding-g3?logo=github diff --git a/docker/Dockerfile.xfce.nodejs b/docker/Dockerfile.xfce.nodejs index bed1dd4..54ff216 100644 --- a/docker/Dockerfile.xfce.nodejs +++ b/docker/Dockerfile.xfce.nodejs @@ -364,33 +364,52 @@ EXPOSE "${NODEJS_PORT}" ### stage_vscode ################ -FROM stage_nodejs as stage_vscode +FROM merge_stage_browser as stage_vscode ARG ARG_APT_NO_RECOMMENDS +ARG ARG_VSCODE_DISTRO +ARG ARG_VSCODE_VERSION +ARG ARG_VSCODE_FILE +ARG ARG_VSCODE_PATH ENV \ DONT_PROMPT_WSL_INSTALL=1 \ - FEATURES_VSCODE=1 + FEATURES_VSCODE=1 \ + VSCODE_PATH="${HOME}/.vscode-portable/code" RUN \ --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ --mount=type=cache,from=stage_cache,sharing=locked,source=/var/lib/apt,target=/var/lib/apt \ DEBIAN_FRONTEND=noninteractive apt-get install -y "${ARG_APT_NO_RECOMMENDS:+--no-install-recommends}" \ + curl \ + git \ gpg \ libasound2 \ - libxshmfence1 + libgbm1 \ + libnss3 RUN \ - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg \ - && install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ \ - && sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' \ - && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - apt-transport-https \ - code \ - && rm -f "${HOME}"/packages.microsoft.gpg + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/lib/apt,target=/var/lib/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/tmp/g3-cache/,target=/tmp/g3-cache/ \ + VSCODE_DISTRO="${ARG_VSCODE_DISTRO}" \ + VSCODE_VERSION="${ARG_VSCODE_VERSION}" \ + VSCODE_FILE="${ARG_VSCODE_FILE}" \ + && if [ ! -s "/tmp/g3-cache/vscode/${VSCODE_FILE}" ] ; then \ + wget --show-progress --progress=bar:force:noscroll \ + -q -O "/tmp/g3-cache/vscode/${VSCODE_FILE}" \ + "https://update.code.visualstudio.com/${VSCODE_VERSION}/${VSCODE_DISTRO}/stable" \ + -P "/tmp/g3-cache/vscode" ; \ + fi \ + && mkdir -p "${VSCODE_PATH}" "${VSCODE_PATH}/data" \ + && tar xzf "/tmp/g3-cache/vscode/${VSCODE_FILE}" --strip 1 -C "${VSCODE_PATH}" \ + && ln -s "${VSCODE_PATH}/bin/code" /usr/bin/code COPY "./xfce-vscode/src/home/Desktop" "${HOME}/Desktop"/ -COPY "./xfce-vscode/src/home/config" "${HOME}/.config"/ +COPY "./xfce-vscode/src/vscode/data" "${VSCODE_PATH}/data"/ + +RUN \ + envsubst <"${HOME}/Desktop/code.desktop" >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}/Desktop/code.desktop" \ + && cp "${HOME}/Desktop/code.desktop" /usr/share/applications/ ############### @@ -427,7 +446,7 @@ RUN \ && echo "${HEADLESS_USER_NAME}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:${HOME}:/bin/bash" >> /etc/passwd \ && echo "${HEADLESS_USER_NAME} ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/"${HEADLESS_USER_NAME}" \ && echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${STARTUPDIR}"/.initial_sudo_password \ - && echo "${HEADLESS_USER_NAME}:$(cat "${STARTUPDIR}"/.initial_sudo_password)" | chpasswd \ + && echo "${HEADLESS_USER_NAME}:$(cat ${STARTUPDIR}/.initial_sudo_password)" | chpasswd \ && ln -s "${HOME}"/readme.md "${HOME}"/Desktop/README \ && envsubst <"${HOME}"/Desktop/versionsticker.desktop >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}"/Desktop/versionsticker.desktop \ && "${STARTUPDIR}"/set_user_permissions.sh "${STARTUPDIR}" "${HOME}" diff --git a/docker/Dockerfile.xfce.nvm b/docker/Dockerfile.xfce.nvm index 87b9f7c..60701e3 100644 --- a/docker/Dockerfile.xfce.nvm +++ b/docker/Dockerfile.xfce.nvm @@ -346,33 +346,53 @@ USER 0 ### stage_vscode ################ -FROM stage_nvm as stage_vscode +FROM merge_stage_browser as stage_vscode ARG ARG_APT_NO_RECOMMENDS +ARG ARG_VSCODE_DISTRO +ARG ARG_VSCODE_VERSION +ARG ARG_VSCODE_FILE +ARG ARG_VSCODE_PATH ENV \ DONT_PROMPT_WSL_INSTALL=1 \ - FEATURES_VSCODE=1 + FEATURES_VSCODE=1 \ + VSCODE_PATH="${HOME}/.vscode-portable/code" RUN \ --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ --mount=type=cache,from=stage_cache,sharing=locked,source=/var/lib/apt,target=/var/lib/apt \ DEBIAN_FRONTEND=noninteractive apt-get install -y "${ARG_APT_NO_RECOMMENDS:+--no-install-recommends}" \ + curl \ + git \ gpg \ libasound2 \ - libxshmfence1 + libgbm1 \ + libnss3 RUN \ - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg \ - && install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ \ - && sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' \ - && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - apt-transport-https \ - code \ - && rm -f "${HOME}"/packages.microsoft.gpg + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/lib/apt,target=/var/lib/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/tmp/g3-cache/,target=/tmp/g3-cache/ \ + VSCODE_DISTRO="${ARG_VSCODE_DISTRO}" \ + VSCODE_VERSION="${ARG_VSCODE_VERSION}" \ + VSCODE_FILE="${ARG_VSCODE_FILE}" \ + && if [ ! -s "/tmp/g3-cache/vscode/${VSCODE_FILE}" ] ; then \ + wget --show-progress --progress=bar:force:noscroll \ + -q -O "/tmp/g3-cache/vscode/${VSCODE_FILE}" \ + "https://update.code.visualstudio.com/${VSCODE_VERSION}/${VSCODE_DISTRO}/stable" \ + -P "/tmp/g3-cache/vscode" ; \ + fi \ + && mkdir -p "${VSCODE_PATH}" "${VSCODE_PATH}/data" \ + && tar xzf "/tmp/g3-cache/vscode/${VSCODE_FILE}" --strip 1 -C "${VSCODE_PATH}" \ + && ln -s "${VSCODE_PATH}/bin/code" /usr/bin/code COPY "./xfce-vscode/src/home/Desktop" "${HOME}/Desktop"/ -COPY "./xfce-vscode/src/home/config" "${HOME}/.config"/ +COPY "./xfce-vscode/src/vscode/data" "${VSCODE_PATH}/data"/ + +RUN \ + envsubst <"${HOME}/Desktop/code.desktop" >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}/Desktop/code.desktop" \ + && cp "${HOME}/Desktop/code.desktop" /usr/share/applications/ + ############### ### FINAL STAGE @@ -408,7 +428,7 @@ RUN \ && echo "${HEADLESS_USER_NAME}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:${HOME}:/bin/bash" >> /etc/passwd \ && echo "${HEADLESS_USER_NAME} ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/"${HEADLESS_USER_NAME}" \ && echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${STARTUPDIR}"/.initial_sudo_password \ - && echo "${HEADLESS_USER_NAME}:$(cat "${STARTUPDIR}"/.initial_sudo_password)" | chpasswd \ + && echo "${HEADLESS_USER_NAME}:$(cat ${STARTUPDIR}/.initial_sudo_password)" | chpasswd \ && ln -s "${HOME}"/readme.md "${HOME}"/Desktop/README \ && envsubst <"${HOME}"/Desktop/versionsticker.desktop >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}"/Desktop/versionsticker.desktop \ && "${STARTUPDIR}"/set_user_permissions.sh "${STARTUPDIR}" "${HOME}" diff --git a/docker/Dockerfile.xfce.postman b/docker/Dockerfile.xfce.postman index 377e665..8ced16a 100644 --- a/docker/Dockerfile.xfce.postman +++ b/docker/Dockerfile.xfce.postman @@ -394,7 +394,7 @@ RUN \ && echo "${HEADLESS_USER_NAME}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:${HOME}:/bin/bash" >> /etc/passwd \ && echo "${HEADLESS_USER_NAME} ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/"${HEADLESS_USER_NAME}" \ && echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${STARTUPDIR}"/.initial_sudo_password \ - && echo "${HEADLESS_USER_NAME}:$(cat "${STARTUPDIR}"/.initial_sudo_password)" | chpasswd \ + && echo "${HEADLESS_USER_NAME}:$(cat ${STARTUPDIR}/.initial_sudo_password)" | chpasswd \ && ln -s "${HOME}"/readme.md "${HOME}"/Desktop/README \ && envsubst <"${HOME}"/Desktop/versionsticker.desktop >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}"/Desktop/versionsticker.desktop \ && "${STARTUPDIR}"/set_user_permissions.sh "${STARTUPDIR}" "${HOME}" diff --git a/docker/Dockerfile.xfce.python b/docker/Dockerfile.xfce.python index bde3169..84fda31 100644 --- a/docker/Dockerfile.xfce.python +++ b/docker/Dockerfile.xfce.python @@ -339,33 +339,52 @@ COPY ./xfce-python/src/samples "${HOME}"/projects/samples ### stage_vscode ################ -FROM stage_python as stage_vscode +FROM merge_stage_browser as stage_vscode ARG ARG_APT_NO_RECOMMENDS +ARG ARG_VSCODE_DISTRO +ARG ARG_VSCODE_VERSION +ARG ARG_VSCODE_FILE +ARG ARG_VSCODE_PATH ENV \ DONT_PROMPT_WSL_INSTALL=1 \ - FEATURES_VSCODE=1 + FEATURES_VSCODE=1 \ + VSCODE_PATH="${HOME}/.vscode-portable/code" RUN \ --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ --mount=type=cache,from=stage_cache,sharing=locked,source=/var/lib/apt,target=/var/lib/apt \ DEBIAN_FRONTEND=noninteractive apt-get install -y "${ARG_APT_NO_RECOMMENDS:+--no-install-recommends}" \ + curl \ + git \ gpg \ libasound2 \ - libxshmfence1 + libgbm1 \ + libnss3 RUN \ - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg \ - && install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ \ - && sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' \ - && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - apt-transport-https \ - code \ - && rm -f "${HOME}"/packages.microsoft.gpg + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/lib/apt,target=/var/lib/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/tmp/g3-cache/,target=/tmp/g3-cache/ \ + VSCODE_DISTRO="${ARG_VSCODE_DISTRO}" \ + VSCODE_VERSION="${ARG_VSCODE_VERSION}" \ + VSCODE_FILE="${ARG_VSCODE_FILE}" \ + && if [ ! -s "/tmp/g3-cache/vscode/${VSCODE_FILE}" ] ; then \ + wget --show-progress --progress=bar:force:noscroll \ + -q -O "/tmp/g3-cache/vscode/${VSCODE_FILE}" \ + "https://update.code.visualstudio.com/${VSCODE_VERSION}/${VSCODE_DISTRO}/stable" \ + -P "/tmp/g3-cache/vscode" ; \ + fi \ + && mkdir -p "${VSCODE_PATH}" "${VSCODE_PATH}/data" \ + && tar xzf "/tmp/g3-cache/vscode/${VSCODE_FILE}" --strip 1 -C "${VSCODE_PATH}" \ + && ln -s "${VSCODE_PATH}/bin/code" /usr/bin/code COPY "./xfce-vscode/src/home/Desktop" "${HOME}/Desktop"/ -COPY "./xfce-vscode/src/home/config" "${HOME}/.config"/ +COPY "./xfce-vscode/src/vscode/data" "${VSCODE_PATH}/data"/ + +RUN \ + envsubst <"${HOME}/Desktop/code.desktop" >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}/Desktop/code.desktop" \ + && cp "${HOME}/Desktop/code.desktop" /usr/share/applications/ ############### @@ -401,7 +420,7 @@ RUN \ && echo "${HEADLESS_USER_NAME}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:${HOME}:/bin/bash" >> /etc/passwd \ && echo "${HEADLESS_USER_NAME} ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/"${HEADLESS_USER_NAME}" \ && echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${STARTUPDIR}"/.initial_sudo_password \ - && echo "${HEADLESS_USER_NAME}:$(cat "${STARTUPDIR}"/.initial_sudo_password)" | chpasswd \ + && echo "${HEADLESS_USER_NAME}:$(cat ${STARTUPDIR}/.initial_sudo_password)" | chpasswd \ && ln -s "${HOME}"/readme.md "${HOME}"/Desktop/README \ && envsubst <"${HOME}"/Desktop/versionsticker.desktop >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}"/Desktop/versionsticker.desktop \ && "${STARTUPDIR}"/set_user_permissions.sh "${STARTUPDIR}" "${HOME}" diff --git a/docker/Dockerfile.xfce.vscode b/docker/Dockerfile.xfce.vscode index 05eecf7..7539ffc 100644 --- a/docker/Dockerfile.xfce.vscode +++ b/docker/Dockerfile.xfce.vscode @@ -314,10 +314,15 @@ FROM ${ARG_MERGE_STAGE_BROWSER_BASE} as merge_stage_browser FROM merge_stage_browser as stage_vscode ARG ARG_APT_NO_RECOMMENDS +ARG ARG_VSCODE_DISTRO +ARG ARG_VSCODE_VERSION +ARG ARG_VSCODE_FILE +ARG ARG_VSCODE_PATH ENV \ DONT_PROMPT_WSL_INSTALL=1 \ - FEATURES_VSCODE=1 + FEATURES_VSCODE=1 \ + VSCODE_PATH="${HOME}/.vscode-portable/code" RUN \ --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ @@ -327,20 +332,32 @@ RUN \ git \ gpg \ libasound2 \ - libxshmfence1 + libgbm1 \ + libnss3 RUN \ - curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg \ - && install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ \ - && sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' \ - && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y \ - apt-transport-https \ - code \ - && rm -f "${HOME}"/packages.microsoft.gpg + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/cache/apt,target=/var/cache/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/var/lib/apt,target=/var/lib/apt \ + --mount=type=cache,from=stage_cache,sharing=locked,source=/tmp/g3-cache/,target=/tmp/g3-cache/ \ + VSCODE_DISTRO="${ARG_VSCODE_DISTRO}" \ + VSCODE_VERSION="${ARG_VSCODE_VERSION}" \ + VSCODE_FILE="${ARG_VSCODE_FILE}" \ + && if [ ! -s "/tmp/g3-cache/vscode/${VSCODE_FILE}" ] ; then \ + wget --show-progress --progress=bar:force:noscroll \ + -q -O "/tmp/g3-cache/vscode/${VSCODE_FILE}" \ + "https://update.code.visualstudio.com/${VSCODE_VERSION}/${VSCODE_DISTRO}/stable" \ + -P "/tmp/g3-cache/vscode" ; \ + fi \ + && mkdir -p "${VSCODE_PATH}" "${VSCODE_PATH}/data" \ + && tar xzf "/tmp/g3-cache/vscode/${VSCODE_FILE}" --strip 1 -C "${VSCODE_PATH}" \ + && ln -s "${VSCODE_PATH}/bin/code" /usr/bin/code COPY "./xfce-vscode/src/home/Desktop" "${HOME}/Desktop"/ -COPY "./xfce-vscode/src/home/config" "${HOME}/.config"/ +COPY "./xfce-vscode/src/vscode/data" "${VSCODE_PATH}/data"/ + +RUN \ + envsubst <"${HOME}/Desktop/code.desktop" >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}/Desktop/code.desktop" \ + && cp "${HOME}/Desktop/code.desktop" /usr/share/applications/ ############### @@ -376,7 +393,7 @@ RUN \ && echo "${HEADLESS_USER_NAME}:x:${HEADLESS_USER_ID}:${HEADLESS_USER_GROUP_ID}:Default:${HOME}:/bin/bash" >> /etc/passwd \ && echo "${HEADLESS_USER_NAME} ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/"${HEADLESS_USER_NAME}" \ && echo "${ARG_SUDO_INITIAL_PW:-headless}" > "${STARTUPDIR}"/.initial_sudo_password \ - && echo "${HEADLESS_USER_NAME}:$(cat "${STARTUPDIR}"/.initial_sudo_password)" | chpasswd \ + && echo "${HEADLESS_USER_NAME}:$(cat ${STARTUPDIR}/.initial_sudo_password)" | chpasswd \ && ln -s "${HOME}"/readme.md "${HOME}"/Desktop/README \ && envsubst <"${HOME}"/Desktop/versionsticker.desktop >/tmp/esub.tmp && mv -f /tmp/esub.tmp "${HOME}"/Desktop/versionsticker.desktop \ && "${STARTUPDIR}"/set_user_permissions.sh "${STARTUPDIR}" "${HOME}" diff --git a/docker/hooks/build b/docker/hooks/build index 9894f5e..e8365cc 100644 --- a/docker/hooks/build +++ b/docker/hooks/build @@ -102,6 +102,9 @@ main() { ${FEATURES_NODEJS:+--build-arg ARG_NODEJS_VERSION=${NODEJS_VERSION}} \ ${FEATURES_NODEJS:+--build-arg ARG_FINAL_STAGE_BASE="stage_nodejs"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}" "${_build_context}" @@ -149,6 +152,9 @@ main() { ${FEATURES_NVM:+--build-arg ARG_NVM_VERSION=${NVM_VERSION}} \ ${FEATURES_NVM:+--build-arg ARG_FINAL_STAGE_BASE="stage_nvm"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}" "${_build_context}" @@ -241,6 +247,9 @@ main() { \ ${FEATURES_PYTHON:+--build-arg ARG_FINAL_STAGE_BASE="stage_python"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}" "${_build_context}" @@ -285,6 +294,9 @@ main() { ${FEATURES_FIREFOX:+--build-arg ARG_MERGE_STAGE_BROWSER_BASE="stage_firefox"} \ ${FEATURES_FIREFOX_PLUS:+--build-arg ARG_MERGE_STAGE_BROWSER_BASE="stage_firefox_plus"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}" "${_build_context}" diff --git a/docker/hooks/cache b/docker/hooks/cache index e1c7555..71a21dd 100644 --- a/docker/hooks/cache +++ b/docker/hooks/cache @@ -198,6 +198,26 @@ cache_postman() { fi } +cache_vscode() { + local section="vscode" + local source_base_url="https://update.code.visualstudio.com/" + local target_path="${_cache}/${section}" + local target="" + local file="" + + mkdir -p "${target_path}" + + ### example: https://update.code.visualstudio.com/{version}/linux-x64/stable + file="${VSCODE_FILE}" + + ### Careful, do not add the file name! + source_url="${source_base_url}/${VSCODE_VERSION}/${VSCODE_DISTRO}/stable/" + + target="${target_path}/${file}" + + refresh_file "${section}" "${file}" "${source_url}" "${target}" +} + ### ========== ### cache_main ### ========== @@ -235,6 +255,11 @@ main() { if [[ $? -ne 0 ]] ; then return 1; fi fi + if [[ "${FEATURES_VSCODE}" == "1" ]] ; then + cache_vscode + if [[ $? -ne 0 ]] ; then return 1; fi + fi + echo } diff --git a/docker/hooks/env.rc b/docker/hooks/env.rc index e3b7c3e..eb28f6e 100644 --- a/docker/hooks/env.rc +++ b/docker/hooks/env.rc @@ -122,6 +122,7 @@ case "${_branch}" in TIGERVNC_DISTRO="x86_64" NOVNC_VERSION="1.4.0" WEBSOCKIFY_VERSION="0.11.0" + VSCODE_DISTRO="linux-x64" ### ---------------------------- ### debian-vnc-xfce-nodejs-g3 @@ -170,6 +171,8 @@ case "${_branch}" in _readme_context="docker/xfce-vscode" FEATURES_VSCODE="1" + VSCODE_VERSION=$( "${_mydir}/${_script_release_of}" 'vscode' ) + VSCODE_FILE=$( "${_mydir}/${_script_release_of}" 'vscode-file' "${VSCODE_VERSION}" ) ### this feature is enabled by default ### however, it can be disabled via environment variables (export FEATURES_NOVNC=0) @@ -269,6 +272,8 @@ case "${_branch}" in if [[ "${_blend}" =~ vscode ]] ; then FEATURES_VSCODE="1" + VSCODE_VERSION=$( "${_mydir}/${_script_release_of}" 'vscode' ) + VSCODE_FILE=$( "${_mydir}/${_script_release_of}" 'vscode-file' "${VSCODE_VERSION}" ) else FEATURES_VSCODE="" fi @@ -336,6 +341,8 @@ case "${_branch}" in if [[ "${_blend}" =~ vscode ]] ; then FEATURES_VSCODE="1" + VSCODE_VERSION=$( "${_mydir}/${_script_release_of}" 'vscode' ) + VSCODE_FILE=$( "${_mydir}/${_script_release_of}" 'vscode-file' "${VSCODE_VERSION}" ) else FEATURES_VSCODE="" fi @@ -455,6 +462,8 @@ case "${_branch}" in if [[ "${_blend}" =~ vscode ]] ; then FEATURES_VSCODE="1" + VSCODE_VERSION=$( "${_mydir}/${_script_release_of}" 'vscode' ) + VSCODE_FILE=$( "${_mydir}/${_script_release_of}" 'vscode-file' "${VSCODE_VERSION}" ) else FEATURES_VSCODE="" fi diff --git a/docker/hooks/pre_build b/docker/hooks/pre_build index d27a6c1..4d88f20 100644 --- a/docker/hooks/pre_build +++ b/docker/hooks/pre_build @@ -94,6 +94,9 @@ main() { ${FEATURES_NODEJS:+--build-arg ARG_NODEJS_VERSION=${NODEJS_VERSION}} \ ${FEATURES_NODEJS:+--build-arg ARG_FINAL_STAGE_BASE="stage_nodejs"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}${helper_suffix}" "${_build_context}" @@ -137,6 +140,9 @@ main() { ${FEATURES_NVM:+--build-arg ARG_NVM_VERSION=${NVM_VERSION}} \ ${FEATURES_NVM:+--build-arg ARG_FINAL_STAGE_BASE="stage_nvm"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}${helper_suffix}" "${_build_context}" @@ -221,6 +227,9 @@ main() { \ ${FEATURES_PYTHON:+--build-arg ARG_FINAL_STAGE_BASE="stage_python"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}${helper_suffix}" "${_build_context}" @@ -261,6 +270,9 @@ main() { ${FEATURES_FIREFOX:+--build-arg ARG_MERGE_STAGE_BROWSER_BASE="stage_firefox"} \ ${FEATURES_FIREFOX_PLUS:+--build-arg ARG_MERGE_STAGE_BROWSER_BASE="stage_firefox_plus"} \ \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_DISTRO=${VSCODE_DISTRO}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_VERSION=${VSCODE_VERSION}} \ + ${FEATURES_VSCODE:+--build-arg ARG_VSCODE_FILE=${VSCODE_FILE}} \ ${FEATURES_VSCODE:+--build-arg ARG_FINAL_STAGE_BASE="stage_vscode"} \ \ -t "${DOCKER_REPO}":"${DOCKER_TAG}${helper_suffix}" "${_build_context}" diff --git a/docker/hooks/release_of b/docker/hooks/release_of index 75d9f0b..1e1304d 100644 --- a/docker/hooks/release_of +++ b/docker/hooks/release_of @@ -1,6 +1,7 @@ #!/bin/bash main() { + local version="$2" local result="" case "$1" in @@ -48,6 +49,24 @@ main() { # ) ;; + vscode ) + # result=$(wget -qO- \ + result=$(curl -sLN -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/microsoft/vscode/releases/latest \ + | grep -m1 "tag_name" \ + | grep -Po '[0-9.]+' + ) + ;; + + vscode-file ) + # result=$(wget -qO- \ + result="$(curl -sLNI https://update.code.visualstudio.com/${version:-latest}/linux-x64/stable \ + | grep -Po -m1 '(?<=location: )[^\r]+' + )" + result="${result##*/}" + ;; + + * ) echo "Exiting '${0}' with code '1' because of unknown key '${1}'" return 1 diff --git a/docker/src/xfce-startup/set_user_permissions.sh b/docker/src/xfce-startup/set_user_permissions.sh index 2e32cb9..d2bd543 100644 --- a/docker/src/xfce-startup/set_user_permissions.sh +++ b/docker/src/xfce-startup/set_user_permissions.sh @@ -18,15 +18,18 @@ main() { echo "Fixing permissions for: ${i}" fi - ### set directory permissions (recursively) - find "$i" -type d -exec chmod ${verbose} 755 {} + - - ### set file permissions (recursively) - find "$i" -type f -exec chmod ${verbose} 644 {} + - - ### specific file permissions (recursively) - find "$i"/ -type f -name '*.sh' -exec chmod ${verbose} 744 {} + - find "$i"/ -type f -name '*.desktop' -exec chmod ${verbose} 744 {} + + ### set directory permissions + ### recursively, but skipping dot-directories in $HOME + find "$i" -type d -not -path "${HOME}/.*" -exec chmod ${verbose} 755 {} + + + ### set file permissions + ### recursively, but skipping dot-files and dot-directories in $HOME + find "$i" -type f -not -path "${HOME}/.*" -exec chmod ${verbose} 644 {} + + + ### specific file permissions + ### recursively, but skipping dot-directories in $HOME + find "$i"/ -type f -not -path "${HOME}/.*" -name '*.sh' -exec chmod ${verbose} 744 {} + + find "$i"/ -type f -not -path "${HOME}/.*" -name '*.desktop' -exec chmod ${verbose} 744 {} + done ### startup script is special diff --git a/docker/src/xfce-startup/version_of.sh b/docker/src/xfce-startup/version_of.sh index 8bc40ee..e06a8b5 100644 --- a/docker/src/xfce-startup/version_of.sh +++ b/docker/src/xfce-startup/version_of.sh @@ -93,7 +93,9 @@ case "$1" in ;; nvm ) ### source example: 0.39.5 - \. ${HOME}/.nvm/nvm.sh && echo $(nvm --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') + if [ -f "${HOME}/.nvm/nvm.sh" ] ; then + \. "${HOME}"/.nvm/nvm.sh && echo $(nvm --version 2>/dev/null | grep -Po -m1 '[0-9.]+$') + fi ;; postman ) # jq -r '.version' /opt/Postman/app/resources/app/package.json diff --git a/docker/xfce-nodejs/README-dockerhub.md b/docker/xfce-nodejs/README-dockerhub.md index cf9da7e..c9ab7ff 100644 --- a/docker/xfce-nodejs/README-dockerhub.md +++ b/docker/xfce-nodejs/README-dockerhub.md @@ -14,7 +14,7 @@ This Docker Hub repository contains Docker images for headless working with the The images are based on the current [Debian 12][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. -The free open-source programming editor [Visual Studio Code][vscode] and the popular web browsers [Chromium][chromium] or [Firefox][firefox] are also included. +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. Adding more tools like [TypeScript][typescript], [Angular][angular] or [Electron][electron] usually requires only a single or just a few commands. The instructions are in the provided README files and some simple test applications are also already included. @@ -39,17 +39,17 @@ The following image tags are regularly built and published on Docker Hub: ![badge_chromium_created][badge_chromium_created] [![badge_chromium_version-sticker][badge_chromium_version-sticker]][link_chromium_version-sticker-verbose] -- `vscode` adds [Visual Studio Code][vscode] +- `vscode` adds [portable][vscode-portable] [Visual Studio Code][vscode] ![badge_vscode_created][badge_vscode_created] [![badge_vscode_version-sticker][badge_vscode_version-sticker]][link_vscode_version-sticker-verbose] -- `vscode-chromium` adds [Visual Studio Code][vscode] and [Chromium Browser][chromium] +- `vscode-chromium` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Chromium Browser][chromium] ![badge_vscode-chromium_created][badge_vscode-chromium_created] [![badge_vscode-chromium_version-sticker][badge_vscode-chromium_version-sticker]][link_vscode-chromium_version-sticker-verbose] -- `vscode-firefox` adds [Visual Studio Code][vscode] and [Firefox][firefox] +- `vscode-firefox` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Firefox][firefox] ![badge_vscode-firefox_created][badge_vscode-firefox_created] [![badge_vscode-firefox_version-sticker][badge_vscode-firefox_version-sticker]][link_vscode-firefox_version-sticker-verbose] @@ -81,7 +81,7 @@ The main features and components of the images in the default configuration are: - current version of [Chromium Browser][chromium] open-source web browser (Debian distribution) - 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]) - current version of free open-source JavaScript runtime environment [Node.js][nodejs] with [npm][npm] (`LTS` or `current`) -- current version of free open-source programming editor [Visual Studio Code][vscode] +- current version of free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable] The following **TCP** ports are exposed by default: @@ -96,6 +96,12 @@ This is the **third generation** (G3) of my headless images. The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. +Note that the portable `Visual Studio Code` does not support automatic updates. +However, manual updating is really easy. +Visit the official [Portable Mode][vscode-portable] page for more information. + +Alternatively you can pull or build an updated `accetto` image containing the new `Visual Studio Code` version. + ### Getting help 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. @@ -155,6 +161,7 @@ If you have a question or an idea and you don't want to open an issue, you can a [tini]: https://github.com/krallin/tini [typescript]: https://www.typescriptlang.org/ [vscode]: https://code.visualstudio.com/ +[vscode-portable]: https://code.visualstudio.com/docs/editor/portable [xfce]: http://www.xfce.org [badge-github-release]: https://badgen.net/github/release/accetto/headless-coding-g3?icon=github&label=release diff --git a/docker/xfce-nvm/README-dockerhub.md b/docker/xfce-nvm/README-dockerhub.md index 17068bf..b232cf5 100644 --- a/docker/xfce-nvm/README-dockerhub.md +++ b/docker/xfce-nvm/README-dockerhub.md @@ -18,7 +18,7 @@ For example, the command `nvm install --lts` will install the latest LTS (Long T The images are based on the current [Debian 12][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. -The free open-source programming editor [Visual Studio Code][vscode] and the popular web browsers [Chromium][chromium] or [Firefox][firefox] are also included. +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. Adding more tools like [TypeScript][typescript], [Angular][angular] or [Electron][electron] usually requires only a single or just a few commands. The instructions are in the provided README files and some simple test applications are also already included. @@ -43,17 +43,17 @@ The following image tags are regularly built and published on Docker Hub: ![badge_chromium_created][badge_chromium_created] [![badge_chromium_version-sticker][badge_chromium_version-sticker]][link_chromium_version-sticker-verbose] -- `vscode` adds [Visual Studio Code][vscode] +- `vscode` adds [portable][vscode-portable] [Visual Studio Code][vscode] ![badge_vscode_created][badge_vscode_created] [![badge_vscode_version-sticker][badge_vscode_version-sticker]][link_vscode_version-sticker-verbose] -- `vscode-chromium` adds [Visual Studio Code][vscode] and [Chromium Browser][chromium] +- `vscode-chromium` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Chromium Browser][chromium] ![badge_vscode-chromium_created][badge_vscode-chromium_created] [![badge_vscode-chromium_version-sticker][badge_vscode-chromium_version-sticker]][link_vscode-chromium_version-sticker-verbose] -- `vscode-firefox` adds [Visual Studio Code][vscode] and [Firefox][firefox] +- `vscode-firefox` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Firefox][firefox] ![badge_vscode-firefox_created][badge_vscode-firefox_created] [![badge_vscode-firefox_version-sticker][badge_vscode-firefox_version-sticker]][link_vscode-firefox_version-sticker-verbose] @@ -80,7 +80,7 @@ The main features and components of the images in the default configuration are: - current version of [Chromium Browser][chromium] open-source web browser (Debian distribution) - 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]) - current version of free open-source utility [NVM][nvm] (Node Version Manager) -- current version of free open-source programming editor [Visual Studio Code][vscode] +- current version of free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable] The following **TCP** ports are exposed by default: @@ -95,6 +95,12 @@ This is the **third generation** (G3) of my headless images. The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. +Note that the portable `Visual Studio Code` does not support automatic updates. +However, manual updating is really easy. +Visit the official [Portable Mode][vscode-portable] page for more information. + +Alternatively you can pull or build an updated `accetto` image containing the new `Visual Studio Code` version. + ### Getting help 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. @@ -155,6 +161,7 @@ If you have a question or an idea and you don't want to open an issue, you can a [tini]: https://github.com/krallin/tini [typescript]: https://www.typescriptlang.org/ [vscode]: https://code.visualstudio.com/ +[vscode-portable]: https://code.visualstudio.com/docs/editor/portable [xfce]: http://www.xfce.org [badge-github-release]: https://badgen.net/github/release/accetto/headless-coding-g3?icon=github&label=release diff --git a/docker/xfce-python/README-dockerhub.md b/docker/xfce-python/README-dockerhub.md index 17f781a..7827279 100644 --- a/docker/xfce-python/README-dockerhub.md +++ b/docker/xfce-python/README-dockerhub.md @@ -14,7 +14,7 @@ This Docker Hub repository contains Docker images for headless working with the The images are based on the current [Debian 12][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. -The free open-source programming editor [Visual Studio Code][vscode] and the popular web browsers [Chromium][chromium] or [Firefox][firefox] are also included. +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. Adding more tools like, for example, the most popular Python GUI frameworks [TKinter][tkinter], [PyQt5][pyqt5], [PyQT for Python][pyside] (`PySide2` or `PySide6`), [wxPython][wxpython] or [Kivy][kivy] usually requires only a single or just a few commands. The instructions are in the provided README files and some simple test applications are also already included. @@ -39,17 +39,17 @@ The following image tags are regularly built and published on Docker Hub: ![badge_chromium_created][badge_chromium_created] [![badge_chromium_version-sticker][badge_chromium_version-sticker]][link_chromium_version-sticker-verbose] -- `vscode` adds [Visual Studio Code][vscode] +- `vscode` adds [portable][vscode-portable] [Visual Studio Code][vscode] ![badge_vscode_created][badge_vscode_created] [![badge_vscode_version-sticker][badge_vscode_version-sticker]][link_vscode_version-sticker-verbose] -- `vscode-chromium` adds [Visual Studio Code][vscode] and [Chromium Browser][chromium] +- `vscode-chromium` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Chromium Browser][chromium] ![badge_vscode-chromium_created][badge_vscode-chromium_created] [![badge_vscode-chromium_version-sticker][badge_vscode-chromium_version-sticker]][link_vscode-chromium_version-sticker-verbose] -- `vscode-firefox` adds [Visual Studio Code][vscode] and [Firefox][firefox] +- `vscode-firefox` adds [portable][vscode-portable] [Visual Studio Code][vscode] and [Firefox][firefox] ![badge_vscode-firefox_created][badge_vscode-firefox_created] [![badge_vscode-firefox_version-sticker][badge_vscode-firefox_version-sticker]][link_vscode-firefox_version-sticker-verbose] @@ -74,7 +74,7 @@ The main features and components of the images in the default configuration are: - current version of [Chromium Browser][chromium] open-source web browser (Debian distribution) - 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]) - programming language [Python][python] with [pip][pip] package installer (Debian distribution) -- current version of free open-source programming editor [Visual Studio Code][vscode] +- current version of free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable] The following **TCP** ports are exposed by default: @@ -93,6 +93,12 @@ This is the **third generation** (G3) of my headless images. The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. +Note that the portable `Visual Studio Code` does not support automatic updates. +However, manual updating is really easy. +Visit the official [Portable Mode][vscode-portable] page for more information. + +Alternatively you can pull or build an updated `accetto` image containing the new `Visual Studio Code` version. + ### Getting help 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. @@ -152,6 +158,7 @@ If you have a question or an idea and you don't want to open an issue, you can a [tini]: https://github.com/krallin/tini [tkinter]: https://wiki.python.org/moin/TkInter [vscode]: https://code.visualstudio.com/ +[vscode-portable]: https://code.visualstudio.com/docs/editor/portable [wxpython]: https://wxpython.org/ [xfce]: http://www.xfce.org diff --git a/docker/xfce-vscode/README-dockerhub.md b/docker/xfce-vscode/README-dockerhub.md index 269a7af..a8bff35 100644 --- a/docker/xfce-vscode/README-dockerhub.md +++ b/docker/xfce-vscode/README-dockerhub.md @@ -10,7 +10,7 @@ *** -This Docker Hub repository contains Docker images for headless working with the the free open-source programming editor [Visual Studio Code][vscode]. +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]. The images are based on the current [Debian 12][docker-debian] and include [Xfce][xfce] desktop, [TigerVNC][tigervnc] server and [noVNC][novnc] client. @@ -60,7 +60,7 @@ The main features and components of the images in the default configuration are: - support of **version sticker** (see [User guide][this-user-guide-version-sticker]) - current version of [Chromium Browser][chromium] open-source web browser (Debian distribution) - 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]) -- current version of free open-source programming editor [Visual Studio Code][vscode] +- current version of free open-source programming editor [Visual Studio Code][vscode] in [portable installation][vscode-portable] The following **TCP** ports are exposed by default: @@ -75,6 +75,12 @@ This is the **third generation** (G3) of my headless images. The **second generation** (G2) contains the GitHub repository [accetto/xubuntu-vnc-novnc][accetto-github-xubuntu-vnc-novnc]. The **first generation** (G1) contains the GitHub repository [accetto/ubuntu-vnc-xfce][accetto-github-ubuntu-vnc-xfce]. +Note that the portable `Visual Studio Code` does not support automatic updates. +However, manual updating is really easy. +Visit the official [Portable Mode][vscode-portable] page for more information. + +Alternatively you can pull or build an updated `accetto` image containing the new `Visual Studio Code` version. + ### Getting help 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. @@ -126,6 +132,7 @@ If you have a question or an idea and you don't want to open an issue, you can a [tini]: https://github.com/krallin/tini [sudo]: https://www.sudo.ws/ [vscode]: https://code.visualstudio.com/ +[vscode-portable]: https://code.visualstudio.com/docs/editor/portable [xfce]: http://www.xfce.org [badge-github-release]: https://badgen.net/github/release/accetto/headless-coding-g3?icon=github&label=release diff --git a/docker/xfce-vscode/src/home/Desktop/code.desktop b/docker/xfce-vscode/src/home/Desktop/code.desktop index 82a8756..f2e626e 100644 --- a/docker/xfce-vscode/src/home/Desktop/code.desktop +++ b/docker/xfce-vscode/src/home/Desktop/code.desktop @@ -2,8 +2,8 @@ Name=Visual Studio Code Comment=Code Editing. Redefined. GenericName=Text Editor -Exec=/usr/share/code/code --no-sandbox --unity-launch %F -Icon=vscode +Exec=${VSCODE_PATH}/code --no-sandbox --unity-launch %F +Icon=${VSCODE_PATH}/resources/app/resources/linux/code.png Type=Application StartupNotify=false StartupWMClass=Code @@ -19,5 +19,5 @@ Terminal=false [Desktop Action new-empty-window] Name=New Empty Window -Exec=/usr/share/code/code --no-sandbox --new-window %F -Icon=/usr/share/pixmaps/com.visualstudio.code.png +Exec=${VSCODE_PATH}/code --no-sandbox --new-window %F +Icon=${VSCODE_PATH}/resources/app/resources/linux/code.png diff --git a/docker/xfce-vscode/src/home/config/Code/User/settings.json b/docker/xfce-vscode/src/home/config/Code/User/settings.json deleted file mode 100644 index ebf729c..0000000 --- a/docker/xfce-vscode/src/home/config/Code/User/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "terminal.integrated.shell.linux": "/bin/bash" -} diff --git a/docker/xfce-vscode/src/vscode/data/user-data/User/keybindings.json b/docker/xfce-vscode/src/vscode/data/user-data/User/keybindings.json new file mode 100644 index 0000000..dbc785c --- /dev/null +++ b/docker/xfce-vscode/src/vscode/data/user-data/User/keybindings.json @@ -0,0 +1,4 @@ +// Place your key bindings in this file to override the defaults +[ + +] \ No newline at end of file diff --git a/docker/xfce-vscode/src/vscode/data/user-data/User/settings.json b/docker/xfce-vscode/src/vscode/data/user-data/User/settings.json new file mode 100644 index 0000000..f92f89e --- /dev/null +++ b/docker/xfce-vscode/src/vscode/data/user-data/User/settings.json @@ -0,0 +1,4 @@ +// Place your settings in this file to override the defaults +{ + +} diff --git a/readme-g3-cache.md b/readme-g3-cache.md index acf0dce..daf9da1 100644 --- a/readme-g3-cache.md +++ b/readme-g3-cache.md @@ -36,6 +36,7 @@ The local `g3-cache` of this project has the following **cache sections**: - `novnc` - `postman` - `tigervnc` +- `vscode` - `websockify` The local `g3-cache` folder `docker/.g3-cache` is excluded from the commits into the `git` repository by the means of the `.gitignore` file.