Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ services:
- PROXY_DOMAIN=code-server.my.domain #optional
- DEFAULT_WORKSPACE=/config/workspace #optional
- PWA_APPNAME=code-server #optional
- BIND_ADDR="[::]:8443" #optional
volumes:
- /path/to/code-server/config:/config
ports:
Expand All @@ -140,6 +141,7 @@ docker run -d \
-e PROXY_DOMAIN=code-server.my.domain `#optional` \
-e DEFAULT_WORKSPACE=/config/workspace `#optional` \
-e PWA_APPNAME=code-server `#optional` \
-e BIND_ADDR="[::]:8443" #optional
-p 8443:8443 \
-v /path/to/code-server/config:/config \
--restart unless-stopped \
Expand All @@ -163,6 +165,7 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e PROXY_DOMAIN=code-server.my.domain` | If this optional variable is set, this domain will be proxied for subdomain proxying. See [Documentation](https://github.com/coder/code-server/blob/main/docs/guide.md#using-a-subdomain) |
| `-e DEFAULT_WORKSPACE=/config/workspace` | If this optional variable is set, code-server will open this directory by default |
| `-e PWA_APPNAME=code-server` | If this optional variable is set, the PWA app will the specified name. |
| `-e BIND_ADDR=[::]:8443` | If this optional variable is set, code-server will listen to this address instead of auto-detecting. |
| `-v /config` | Contains all relevant configuration files. |
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
| `--user=1000:1000` | Run container with a non-root user. Please [read the docs](https://docs.linuxserver.io/misc/non-root/). |
Expand Down Expand Up @@ -329,6 +332,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **06.07.26:** - Fall back to ipv4 bind address when ipv6 is disabled in the kernel.
* **17.05.26:** - Let server listen on both ipv4 and ipv6 even when running container as root.
* **10.08.25:** - Let server listen on both ipv4 and ipv6.
* **03.06.25:** - Allow setting PWA name using env var `PWA_APPNAME`.
Expand Down
1 change: 1 addition & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ init_diagram: |
"code-server:latest" <- Base Images
# changelog
changelogs:
- {date: "06.07.26:", desc: "Fall back to ipv4 bind address when ipv6 is disabled in the kernel."}
- {date: "17.05.26:", desc: "Let server listen on both ipv4 and ipv6 even when running container as root."}
- {date: "10.08.25:", desc: "Let server listen on both ipv4 and ipv6."}
- {date: "03.06.25:", desc: "Allow setting PWA name using env var `PWA_APPNAME`."}
Expand Down
13 changes: 12 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/svc-code-server/run
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,23 @@ if [[ -z ${PWA_APPNAME} ]]; then
PWA_APPNAME="code-server"
fi

if [[ -z ${BIND_ADDR} ]] ; then
# Bind to the IPv6 wildcard (dual-stack, also serves IPv4) when IPv6 is
# available, otherwise fall back to the IPv4 wildcard. Binding to "[::]"
# fails outright on hosts/containers where IPv6 is disabled.
if [[ -e /proc/net/if_inet6 ]]; then
BIND_ADDR="[::]:8443"
else
BIND_ADDR="0.0.0.0:8443"
fi
fi

if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 8443" \
s6-setuidgid abc \
/app/code-server/bin/code-server \
--bind-addr "[::]:8443" \
--bind-addr "${BIND_ADDR}" \
--user-data-dir /config/data \
--extensions-dir /config/extensions \
--disable-telemetry \
Expand Down
Loading