Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase to noble #184

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
thespad marked this conversation as resolved.
Show resolved Hide resolved
FROM ghcr.io/linuxserver/baseimage-ubuntu:noble

# set version label
ARG BUILD_DATE
Expand All @@ -16,11 +16,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 \
Expand All @@ -33,6 +31,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 \
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble

# set version label
ARG BUILD_DATE
Expand All @@ -16,11 +16,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 \
Expand All @@ -33,6 +31,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 \
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=''
14 changes: 4 additions & 10 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -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."}
Expand Down
14 changes: 9 additions & 5 deletions root/etc/s6-overlay/s6-rc.d/init-code-server/run
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/init-code-server/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
oneshot
oneshot
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/init-code-server/up
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/etc/s6-overlay/s6-rc.d/init-code-server/run
/etc/s6-overlay/s6-rc.d/init-code-server/run
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3
3
5 changes: 3 additions & 2 deletions root/etc/s6-overlay/s6-rc.d/svc-code-server/run
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/svc-code-server/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
longrun
longrun
2 changes: 1 addition & 1 deletion root/usr/local/bin/install-extension
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]}" "$@"
Expand Down