Merge pull request #184 from linuxserver/master-noble

This commit is contained in:
Adam 2024-08-20 16:08:16 +01:00 committed by GitHub
commit 11dbec9f82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 36 additions and 34 deletions

View File

@ -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 # set version label
ARG BUILD_DATE ARG BUILD_DATE
@ -16,11 +18,9 @@ RUN \
apt-get update && \ apt-get update && \
apt-get install -y \ apt-get install -y \
git \ git \
jq \
libatomic1 \ libatomic1 \
nano \ nano \
net-tools \ net-tools \
netcat \
sudo && \ sudo && \
echo "**** install code-server ****" && \ echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \ 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" && \ "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 \ tar xf /tmp/code-server.tar.gz -C \
/app/code-server --strip-components=1 && \ /app/code-server --strip-components=1 && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** clean up ****" && \ echo "**** clean up ****" && \
apt-get clean && \ apt-get clean && \
rm -rf \ rm -rf \

View File

@ -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 # set version label
ARG BUILD_DATE ARG BUILD_DATE
@ -16,11 +18,9 @@ RUN \
apt-get update && \ apt-get update && \
apt-get install -y \ apt-get install -y \
git \ git \
jq \
libatomic1 \ libatomic1 \
nano \ nano \
net-tools \ net-tools \
netcat \
sudo && \ sudo && \
echo "**** install code-server ****" && \ echo "**** install code-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \ 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" && \ "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 \ tar xf /tmp/code-server.tar.gz -C \
/app/code-server --strip-components=1 && \ /app/code-server --strip-components=1 && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** clean up ****" && \ echo "**** clean up ****" && \
apt-get clean && \ apt-get clean && \
rm -rf \ rm -rf \

4
Jenkinsfile vendored
View File

@ -33,8 +33,8 @@ pipeline {
CI_PORT='8443' CI_PORT='8443'
CI_SSL='false' CI_SSL='false'
CI_DELAY='120' CI_DELAY='120'
CI_DOCKERENV='TZ=US/Pacific' CI_DOCKERENV=''
CI_AUTH='user:password' CI_AUTH=''
CI_WEBPATH='' CI_WEBPATH=''
} }
stages { stages {

View File

@ -101,7 +101,7 @@ services:
- PROXY_DOMAIN=code-server.my.domain #optional - PROXY_DOMAIN=code-server.my.domain #optional
- DEFAULT_WORKSPACE=/config/workspace #optional - DEFAULT_WORKSPACE=/config/workspace #optional
volumes: volumes:
- /path/to/appdata/config:/config - /path/to/code-server/config:/config
ports: ports:
- 8443:8443 - 8443:8443
restart: unless-stopped restart: unless-stopped
@ -122,7 +122,7 @@ docker run -d \
-e PROXY_DOMAIN=code-server.my.domain `#optional` \ -e PROXY_DOMAIN=code-server.my.domain `#optional` \
-e DEFAULT_WORKSPACE=/config/workspace `#optional` \ -e DEFAULT_WORKSPACE=/config/workspace `#optional` \
-p 8443:8443 \ -p 8443:8443 \
-v /path/to/appdata/config:/config \ -v /path/to/code-server/config:/config \
--restart unless-stopped \ --restart unless-stopped \
lscr.io/linuxserver/code-server:latest lscr.io/linuxserver/code-server:latest
``` ```
@ -306,6 +306,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
## Versions ## 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) * **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. * **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. * **29.09.22:** - Rebase to jammy, switch to s6v3. Fix chown logic to skip `/config/workspace` contents.

View File

@ -22,6 +22,6 @@ repo_vars:
- CI_PORT='8443' - CI_PORT='8443'
- CI_SSL='false' - CI_SSL='false'
- CI_DELAY='120' - CI_DELAY='120'
- CI_DOCKERENV='TZ=US/Pacific' - CI_DOCKERENV=''
- CI_AUTH='user:password' - CI_AUTH=''
- CI_WEBPATH='' - CI_WEBPATH=''

View File

@ -10,22 +10,16 @@ project_lsio_github_repo_url: "https://github.com/linuxserver/docker-{{ project_
available_architectures: available_architectures:
- {arch: "{{ arch_x86_64 }}", tag: "amd64-latest"} - {arch: "{{ arch_x86_64 }}", tag: "amd64-latest"}
- {arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"} - {arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"}
# development version
development_versions: false
development_versions_items:
- {tag: "latest", desc: "Stable releases"}
# container parameters # container parameters
common_param_env_vars_enabled: true common_param_env_vars_enabled: true
param_container_name: "{{ project_name }}" param_container_name: "{{ project_name }}"
param_usage_include_vols: true param_usage_include_vols: true
param_volumes: 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_usage_include_ports: true
param_ports: param_ports:
- {external_port: "8443", internal_port: "8443", port_desc: "web gui"} - {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 # optional container parameters
opt_param_usage_include_env: true opt_param_usage_include_env: true
opt_param_env_vars: 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: "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: "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"} - {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 # application setup block
app_setup_block_enabled: true app_setup_block_enabled: true
app_setup_block: | 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). How to create the [hashed password](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#can-i-store-my-password-hashed).
# changelog # changelog
changelogs: 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: "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: "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."} - {date: "29.09.22:", desc: "Rebase to jammy, switch to s6v3. Fix chown logic to skip `/config/workspace` contents."}

View File

@ -1,14 +1,15 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
# shellcheck shell=bash
mkdir -p /config/{extensions,data,workspace,.ssh} 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" echo "setting up sudo access"
if ! grep -q 'abc' /etc/sudoers; then if ! grep -q 'abc' /etc/sudoers; then
echo "adding abc to sudoers" echo "adding abc to sudoers"
echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers echo "abc ALL=(ALL:ALL) ALL" >> /etc/sudoers
fi fi
if [ -n "${SUDO_PASSWORD_HASH}" ]; then if [[ -n "${SUDO_PASSWORD_HASH}" ]]; then
echo "setting sudo password using sudo password hash" echo "setting sudo password using sudo password hash"
sed -i "s|^abc:\!:|abc:${SUDO_PASSWORD_HASH}:|" /etc/shadow sed -i "s|^abc:\!:|abc:${SUDO_PASSWORD_HASH}:|" /etc/shadow
else else
@ -17,15 +18,18 @@ if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
fi fi
fi fi
[[ ! -f /config/.bashrc ]] && \ if [[ ! -f /config/.bashrc ]]; then
cp /root/.bashrc /config/.bashrc cp /root/.bashrc /config/.bashrc
[[ ! -f /config/.profile ]] && \ fi
if [[ ! -f /config/.profile ]]; then
cp /root/.profile /config/.profile cp /root/.profile /config/.profile
fi
# fix permissions (ignore contents of /config/workspace) # fix permissions (ignore contents of /config/workspace)
find /config -path /config/workspace -prune -o -exec chown abc:abc {} + find /config -path /config/workspace -prune -o -exec chown abc:abc {} +
chown abc:abc /config/workspace chown abc:abc /config/workspace
chmod 700 /config/.ssh chmod 700 /config/.ssh
if [ -n "$(ls -A /config/.ssh)" ]; then if [[ -n "$(ls -A /config/.ssh)" ]]; then
chmod 600 /config/.ssh/* chmod 600 /config/.ssh/*
fi fi

View File

@ -1 +1 @@
oneshot oneshot

View File

@ -1 +1 @@
/etc/s6-overlay/s6-rc.d/init-code-server/run /etc/s6-overlay/s6-rc.d/init-code-server/run

View File

@ -1,13 +1,14 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
# shellcheck shell=bash
if [ -n "${PASSWORD}" ] || [ -n "${HASHED_PASSWORD}" ]; then if [[ -n "${PASSWORD}" ]] || [[ -n "${HASHED_PASSWORD}" ]]; then
AUTH="password" AUTH="password"
else else
AUTH="none" AUTH="none"
echo "starting with no password" echo "starting with no password"
fi fi
if [ -z ${PROXY_DOMAIN+x} ]; then if [[ -z ${PROXY_DOMAIN+x} ]]; then
PROXY_DOMAIN_ARG="" PROXY_DOMAIN_ARG=""
else else
PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}" PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}"

View File

@ -1 +1 @@
longrun longrun

View File

@ -3,7 +3,7 @@
_install=(/app/code-server/bin/code-server "--extensions-dir" "/config/extensions" "--install-extension") _install=(/app/code-server/bin/code-server "--extensions-dir" "/config/extensions" "--install-extension")
if [ "$(whoami)" == "abc" ]; then if [[ "$(whoami)" == "abc" ]]; then
"${_install[@]}" "$@" "${_install[@]}" "$@"
else else
s6-setuidgid abc "${_install[@]}" "$@" s6-setuidgid abc "${_install[@]}" "$@"