Skip to content

Latest commit

 

History

History
61 lines (54 loc) · 1.34 KB

File metadata and controls

61 lines (54 loc) · 1.34 KB
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
code-server-port-change-ignored
self-hosted
public
2022-02-08 05:13:24 -0800
2022-02-08 05:13:24 -0800
false
20220208131324
false
false
bind
code-server
docker
mount
port
Code Server Port Bind Issue
tech-note

If you want to change the port Code Server uses, it's hard-coded into the /etc/services.d/code-server/run script, as a value for the --bind-addr flag.

#!/usr/bin/with-contenv bash

if [ -n "${PASSWORD}" ] || [ -n "${HASHED_PASSWORD}" ]; then
    AUTH="password"
else
    AUTH="none"
    echo "starting with no password"
fi

if [ -z ${PROXY_DOMAIN+x} ]; then
    PROXY_DOMAIN_ARG=""
else
    PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}"
fi

exec \
    s6-setuidgid abc \
        /app/code-server/bin/code-server \
            --bind-addr 0.0.0.0:8088 \
            --user-data-dir /config/data \
            --extensions-dir /config/extensions \
            --disable-telemetry \
            --auth "${AUTH}" \
            "${PROXY_DOMAIN_ARG}" \
            "${DEFAULT_WORKSPACE:-/config/workspace}"

I mount the file in Docker Compose so I can override --bind-addr:

    volumes:
      - ./run:/etc/services.d/code-server/run