Skip to content

theohbrothers/docker-code-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

docker-code-server

github-actions github-release docker-image-size

Dockerized code-server.

Tags

Tag Dockerfile Build Context
:4.93.1, :latest View
:4.93.1-docker View
:4.93.1-docker-go-1.20.14 View
:4.93.1-docker-rootless View
:4.93.1-docker-rootless-go-1.20.14 View
:4.92.2 View
:4.92.2-docker View
:4.92.2-docker-go-1.20.14 View
:4.92.2-docker-rootless View
:4.92.2-docker-rootless-go-1.20.14 View
:4.91.1 View
:4.91.1-docker View
:4.91.1-docker-go-1.20.14 View
:4.91.1-docker-rootless View
:4.91.1-docker-rootless-go-1.20.14 View
:4.90.3 View
:4.90.3-docker View
:4.90.3-docker-go-1.20.14 View
:4.90.3-docker-rootless View
:4.90.3-docker-rootless-go-1.20.14 View
:4.89.1 View
:4.89.1-docker View
:4.89.1-docker-go-1.20.14 View
:4.89.1-docker-rootless View
:4.89.1-docker-rootless-go-1.20.14 View
:4.23.1 View
:4.23.1-docker View
:4.23.1-docker-go-1.20.14 View
:4.23.1-docker-rootless View
:4.23.1-docker-rootless-go-1.20.14 View
:4.22.1 View
:4.22.1-docker View
:4.22.1-docker-go-1.20.14 View
:4.22.1-docker-rootless View
:4.22.1-docker-rootless-go-1.20.14 View
:4.21.2 View
:4.21.2-docker View
:4.21.2-docker-go-1.20.14 View
:4.21.2-docker-rootless View
:4.21.2-docker-rootless-go-1.20.14 View
:4.20.1 View
:4.20.1-docker View
:4.20.1-docker-go-1.20.14 View
:4.20.1-docker-rootless View
:4.20.1-docker-rootless-go-1.20.14 View
:4.19.1 View
:4.19.1-docker View
:4.19.1-docker-go-1.20.14 View
:4.19.1-docker-rootless View
:4.19.1-docker-rootless-go-1.20.14 View
:4.18.0 View
:4.18.0-docker View
:4.18.0-docker-go-1.20.14 View
:4.18.0-docker-rootless View
:4.18.0-docker-rootless-go-1.20.14 View
:4.17.1 View
:4.17.1-docker View
:4.17.1-docker-go-1.20.14 View
:4.17.1-docker-rootless View
:4.17.1-docker-rootless-go-1.20.14 View
:4.16.1 View
:4.16.1-docker View
:4.16.1-docker-go-1.20.14 View
:4.16.1-docker-rootless View
:4.16.1-docker-rootless-go-1.20.14 View
:4.15.0 View
:4.15.0-docker View
:4.15.0-docker-go-1.20.14 View
:4.15.0-docker-rootless View
:4.15.0-docker-rootless-go-1.20.14 View
:4.14.1 View
:4.14.1-docker View
:4.14.1-docker-go-1.20.14 View
:4.14.1-docker-rootless View
:4.14.1-docker-rootless-go-1.20.14 View
:4.13.0 View
:4.13.0-docker View
:4.13.0-docker-go-1.20.14 View
:4.13.0-docker-rootless View
:4.13.0-docker-rootless-go-1.20.14 View
:4.12.0 View
:4.12.0-docker View
:4.12.0-docker-go-1.20.14 View
:4.12.0-docker-rootless View
:4.12.0-docker-rootless-go-1.20.14 View
:4.11.0 View
:4.11.0-docker View
:4.11.0-docker-go-1.20.14 View
:4.11.0-docker-rootless View
:4.11.0-docker-rootless-go-1.20.14 View

Base variants are based on alpine, and include npm 8 and nodejs 16 (to run code-server), pwsh, and basic tools. E.g. 4.93.1

Incremental variants include additional tools and their code extensions:

Usage

Base variant(s)

docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:4.93.1
# code-server is now available at http://127.0.0.1:8080. To login, use the password in the config file:
docker exec code-server sh -c 'cat ~/.config/code-server/config.yaml'

To disable password authentication, use --auth=none:

docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:4.93.1 --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check

docker variant(s)

docker run --name code-server --rm -it --privileged -v docker:/var/lib/docker -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:4.93.1-docker
# code-server is now available at http://127.0.0.1:8080. To login, use the password in the config file:
docker exec code-server sh -c 'cat ~/.config/code-server/config.yaml'

To disable password authentication, use --auth=none:

docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:4.93.1-docker --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check

docker buildx

To build multi-arch images using docker buildx, the host must have kernel >= 4.8, and must have setup qemu in the kernel (see here):

# This must be run on each reboot on the host to setup qemu
docker run --rm --privileged tonistiigi/binfmt:latest --install all

Then, buildx multi-arch builds are now available in the container:

# Create a builder and use it
docker buildx create --name mybuilder --driver docker-container
docker buildx use mybuilder
docker buildx ls # Should show several platforms
docker buildx inspect mybuilder # Should show several platforms

# Build
docker buildx build ...

docker-rootless variant(s)

docker run --name code-server --rm -it --privileged -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:4.93.1-docker-rootless
# code-server is now available at http://127.0.0.1:8080. To login, use the password in the config file:
docker exec code-server sh -c 'cat ~/.config/code-server/config.yaml'

To start code-server without password authentication, use --auth=none:

docker run --name code-server --rm -it -p 127.0.0.1:8080:8080 theohbrothers/docker-code-server:4.93.1-docker-rootless --bind-addr=0.0.0.0:8080 --auth=none --disable-telemetry --disable-update-check

To build multi-arch images using docker buildx, see here.

Notes

  • See official docs for code-server configuration: https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-does-the-config-file-work
  • The default user is named user with UID 1000. To escalate as root, use sudo.
  • Users should provision their own configuration files at entrypoint. Examples include dotfiles such as ~/.bash_aliases, ~/.gitconfig, and code configs such as ~/.local/share/code-server/User/keybindings.json and ~/.local/share/code-server/User/settings.json. It is recommended to use any of these utilities for managing dotfiles.
  • To install a custom version of a code extension, set "extensions.autoCheckUpdates": true in settings.json. Under Extensions view, click the extension's cogwheel and select Install Another Version....

Development

Requires Windows powershell or pwsh.

# Install Generate-DockerImageVariants module: https://github.com/theohbrothers/Generate-DockerImageVariants
Install-Module -Name Generate-DockerImageVariants -Repository PSGallery -Scope CurrentUser -Force -Verbose

# Edit ./generate templates

# Generate the variants
Generate-DockerImageVariants .

Variant versions

versions.json contains a list of Semver versions, one per line.

To update versions in versions.json:

./Update-Versions.ps1

To update versions in versions.json, and open a PR for each changed version, and merge successful PRs one after another (to prevent merge conflicts), and finally create a tagged release and close milestone:

$env:GITHUB_TOKEN = 'xxx'
./Update-Versions.ps1 -PR -AutoMergeQueue -AutoRelease

To perform a dry run, use -WhatIf.