Run VS Code on any machine anywhere and access it in the browser.
Ports required to run the server in a table format.
Port | default |
---|---|
Game | 8080 |
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:nodejs_12 | ghcr.io/ptero-eggs/yolks:nodejs_12 |
ghcr.io/ptero-eggs/yolks:nodejs_14 | ghcr.io/ptero-eggs/yolks:nodejs_14 |
ghcr.io/ptero-eggs/yolks:nodejs_16 | ghcr.io/ptero-eggs/yolks:nodejs_16 |
ghcr.io/ptero-eggs/yolks:nodejs_17 | ghcr.io/ptero-eggs/yolks:nodejs_17 |
ghcr.io/ptero-eggs/yolks:nodejs_18 | ghcr.io/ptero-eggs/yolks:nodejs_18 |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Password | Password to login to your Code-Server instance | PASSWORD | changeme | Yes | Yes |
Version | Version for (re)installation such as 3.9.3. Defaults to latest version if no valid version is provided | VERSION | latest | Yes | Yes |
apt update
apt install -y curl jq
ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")
MATCH=linux-${ARCH}
# Create initial directories
mkdir -p /mnt/server
cd /mnt/server
echo ${ARCH}
echo ${MATCH}
# Create needed directories
mkdir -p /mnt/server/.local/lib /mnt/server/.local/bin /mnt/server/.config/code-server /mnt/server/projects
# Change permission of projects directory so it can be accessed by code-server
chmod 777 /mnt/server/projects
touch "/mnt/server/projects/PLACE YOUR PROJECTS HERE"
# Check for available versions. Defaults to latest if no valid version is found.
LATEST_JSON=$(curl --silent "https://api.github.com/repos/coder/code-server/releases/latest")
RELEASES=$(curl --silent "https://api.github.com/repos/coder/code-server/releases")
if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})
else
VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "v${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name')
if [ "v${VERSION}" == "${VERSION_CHECK}" ]; then
DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "v${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})
else
echo -e "defaulting to latest release"
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)
fi
fi
# Download the given Version and extract it
echo "Downloading $DOWNLOAD_URL"
curl -fL $DOWNLOAD_URL | tar -C /mnt/server/.local/lib -xz
mv /mnt/server/.local/lib/code-server-*linux-${ARCH} /mnt/server/.local/lib/code-server-${VERSION}
PATH="/mnt/server/.local/bin:$PATH"
echo "password: changeme
bind-addr: 0.0.0.0
auth: password
cert: false" > /mnt/server/.config/code-server/config.yaml
echo "Install complete"