diff --git a/Dockerfile b/Dockerfile index 50a3794..9ac98d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-ubuntu:noble # set version label ARG BUILD_DATE @@ -16,11 +18,9 @@ RUN \ apt-get update && \ apt-get install -y \ git \ - jq \ libatomic1 \ nano \ net-tools \ - netcat \ sudo && \ echo "**** install code-server ****" && \ if [ -z ${CODE_RELEASE+x} ]; then \ @@ -33,6 +33,7 @@ RUN \ "https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-amd64.tar.gz" && \ tar xf /tmp/code-server.tar.gz -C \ /app/code-server --strip-components=1 && \ + printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** clean up ****" && \ apt-get clean && \ rm -rf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 9502c20..6e05250 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,4 +1,6 @@ -FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble # set version label ARG BUILD_DATE @@ -16,11 +18,9 @@ RUN \ apt-get update && \ apt-get install -y \ git \ - jq \ libatomic1 \ nano \ net-tools \ - netcat \ sudo && \ echo "**** install code-server ****" && \ if [ -z ${CODE_RELEASE+x} ]; then \ @@ -33,6 +33,7 @@ RUN \ "https://github.com/coder/code-server/releases/download/v${CODE_RELEASE}/code-server-${CODE_RELEASE}-linux-arm64.tar.gz" && \ tar xf /tmp/code-server.tar.gz -C \ /app/code-server --strip-components=1 && \ + printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** clean up ****" && \ apt-get clean && \ rm -rf \ diff --git a/Jenkinsfile b/Jenkinsfile index 791aea0..8154a51 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,8 +33,8 @@ pipeline { CI_PORT='8443' CI_SSL='false' CI_DELAY='120' - CI_DOCKERENV='TZ=US/Pacific' - CI_AUTH='user:password' + CI_DOCKERENV='' + CI_AUTH='' CI_WEBPATH='' } stages { diff --git a/README.md b/README.md index 1557cb5..7caa479 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ services: - PROXY_DOMAIN=code-server.my.domain #optional - DEFAULT_WORKSPACE=/config/workspace #optional volumes: - - /path/to/appdata/config:/config + - /path/to/code-server/config:/config ports: - 8443:8443 restart: unless-stopped @@ -122,7 +122,7 @@ docker run -d \ -e PROXY_DOMAIN=code-server.my.domain `#optional` \ -e DEFAULT_WORKSPACE=/config/workspace `#optional` \ -p 8443:8443 \ - -v /path/to/appdata/config:/config \ + -v /path/to/code-server/config:/config \ --restart unless-stopped \ lscr.io/linuxserver/code-server:latest ``` @@ -306,6 +306,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **19.08.24:** - Rebase to Ubuntu Noble. * **01.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf) * **05.10.22:** - Install recommended deps to maintain parity with the older images. * **29.09.22:** - Rebase to jammy, switch to s6v3. Fix chown logic to skip `/config/workspace` contents. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 5931893..d9a9058 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -22,6 +22,6 @@ repo_vars: - CI_PORT='8443' - CI_SSL='false' - CI_DELAY='120' - - CI_DOCKERENV='TZ=US/Pacific' - - CI_AUTH='user:password' + - CI_DOCKERENV='' + - CI_AUTH='' - CI_WEBPATH='' diff --git a/readme-vars.yml b/readme-vars.yml index e5a145f..1c49ea6 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -10,22 +10,16 @@ project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_ available_architectures: - {arch: "{{ arch_x86_64 }}", tag: "amd64-latest"} - {arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"} -# development version -development_versions: false -development_versions_items: - - {tag: "latest", desc: "Stable releases"} + # container parameters common_param_env_vars_enabled: true param_container_name: "{{ project_name }}" param_usage_include_vols: true param_volumes: - - {vol_path: "/config", vol_host_path: "/path/to/appdata/config", desc: "Contains all relevant configuration files."} + - {vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Contains all relevant configuration files."} param_usage_include_ports: true param_ports: - {external_port: "8443", internal_port: "8443", port_desc: "web gui"} -param_usage_include_env: true -param_env_vars: - - {env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"} # optional container parameters opt_param_usage_include_env: true opt_param_env_vars: @@ -35,8 +29,7 @@ opt_param_env_vars: - {env_var: "SUDO_PASSWORD_HASH", env_value: "", desc: "Optionally set sudo password via hash (takes priority over `SUDO_PASSWORD` var). Format is `$type$salt$hashed`."} - {env_var: "PROXY_DOMAIN", env_value: "code-server.my.domain", desc: "If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#sub-domains)"} - {env_var: "DEFAULT_WORKSPACE", env_value: "/config/workspace", desc: "If this optional variable is set, code-server will open this directory by default"} -optional_block_1: false -optional_block_1_items: "" + # application setup block app_setup_block_enabled: true app_setup_block: | @@ -54,6 +47,7 @@ app_setup_block: | How to create the [hashed password](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#can-i-store-my-password-hashed). # changelog changelogs: + - {date: "19.08.24:", desc: "Rebase to Ubuntu Noble."} - {date: "01.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} - {date: "05.10.22:", desc: "Install recommended deps to maintain parity with the older images."} - {date: "29.09.22:", desc: "Rebase to jammy, switch to s6v3. Fix chown logic to skip `/config/workspace` contents."} diff --git a/root/etc/s6-overlay/s6-rc.d/init-code-server/run b/root/etc/s6-overlay/s6-rc.d/init-code-server/run index d93a4d2..883024d 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-code-server/run +++ b/root/etc/s6-overlay/s6-rc.d/init-code-server/run @@ -1,14 +1,15 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash mkdir -p /config/{extensions,data,workspace,.ssh} -if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then +if [[ -n "${SUDO_PASSWORD}" ]] || [[ -n "${SUDO_PASSWORD_HASH}" ]]; then echo "setting up sudo access" if ! grep -q 'abc' /etc/sudoers; then echo "adding abc to sudoers" echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers fi - if [ -n "${SUDO_PASSWORD_HASH}" ]; then + if [[ -n "${SUDO_PASSWORD_HASH}" ]]; then echo "setting sudo password using sudo password hash" sed -i "s|^abc:\!:|abc:${SUDO_PASSWORD_HASH}:|" /etc/shadow else @@ -17,15 +18,18 @@ if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then fi fi -[[ ! -f /config/.bashrc ]] && \ +if [[ ! -f /config/.bashrc ]]; then cp /root/.bashrc /config/.bashrc -[[ ! -f /config/.profile ]] && \ +fi + +if [[ ! -f /config/.profile ]]; then cp /root/.profile /config/.profile +fi # fix permissions (ignore contents of /config/workspace) find /config -path /config/workspace -prune -o -exec chown abc:abc {} + chown abc:abc /config/workspace chmod 700 /config/.ssh -if [ -n "$(ls -A /config/.ssh)" ]; then +if [[ -n "$(ls -A /config/.ssh)" ]]; then chmod 600 /config/.ssh/* fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-code-server/type b/root/etc/s6-overlay/s6-rc.d/init-code-server/type index 3d92b15..bdd22a1 100644 --- a/root/etc/s6-overlay/s6-rc.d/init-code-server/type +++ b/root/etc/s6-overlay/s6-rc.d/init-code-server/type @@ -1 +1 @@ -oneshot \ No newline at end of file +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-code-server/up b/root/etc/s6-overlay/s6-rc.d/init-code-server/up index 4efdc97..3b22ac9 100644 --- a/root/etc/s6-overlay/s6-rc.d/init-code-server/up +++ b/root/etc/s6-overlay/s6-rc.d/init-code-server/up @@ -1 +1 @@ -/etc/s6-overlay/s6-rc.d/init-code-server/run \ No newline at end of file +/etc/s6-overlay/s6-rc.d/init-code-server/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-code-server/notification-fd b/root/etc/s6-overlay/s6-rc.d/svc-code-server/notification-fd index e440e5c..00750ed 100644 --- a/root/etc/s6-overlay/s6-rc.d/svc-code-server/notification-fd +++ b/root/etc/s6-overlay/s6-rc.d/svc-code-server/notification-fd @@ -1 +1 @@ -3 \ No newline at end of file +3 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-code-server/run b/root/etc/s6-overlay/s6-rc.d/svc-code-server/run index 373dc0a..97c7e09 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-code-server/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-code-server/run @@ -1,13 +1,14 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash -if [ -n "${PASSWORD}" ] || [ -n "${HASHED_PASSWORD}" ]; then +if [[ -n "${PASSWORD}" ]] || [[ -n "${HASHED_PASSWORD}" ]]; then AUTH="password" else AUTH="none" echo "starting with no password" fi -if [ -z ${PROXY_DOMAIN+x} ]; then +if [[ -z ${PROXY_DOMAIN+x} ]]; then PROXY_DOMAIN_ARG="" else PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}" diff --git a/root/etc/s6-overlay/s6-rc.d/svc-code-server/type b/root/etc/s6-overlay/s6-rc.d/svc-code-server/type index 1780f9f..5883cff 100644 --- a/root/etc/s6-overlay/s6-rc.d/svc-code-server/type +++ b/root/etc/s6-overlay/s6-rc.d/svc-code-server/type @@ -1 +1 @@ -longrun \ No newline at end of file +longrun diff --git a/root/usr/local/bin/install-extension b/root/usr/local/bin/install-extension index 79c922a..48dfbb2 100755 --- a/root/usr/local/bin/install-extension +++ b/root/usr/local/bin/install-extension @@ -3,7 +3,7 @@ _install=(/app/code-server/bin/code-server "--extensions-dir" "/config/extensions" "--install-extension") -if [ "$(whoami)" == "abc" ]; then +if [[ "$(whoami)" == "abc" ]]; then "${_install[@]}" "$@" else s6-setuidgid abc "${_install[@]}" "$@"