Sign inSign up

theohbrothers/docker-code-server

By theohbrothers

•Updated 11 months ago

Dockerized code-server 🐳

Image
0

100K+

theohbrothers/docker-code-server repository overview

⁠docker-code-server

github-actions github-release docker-image-size

Dockerized code-server⁠.

⁠Tags

TagDockerfile Build Context
:4.93.1, :latestView⁠
:4.93.1-dockerView⁠
:4.93.1-docker-go-1.20.14View⁠
:4.93.1-docker-rootlessView⁠
:4.93.1-docker-rootless-go-1.20.14View⁠
:4.92.2View⁠
:4.92.2-dockerView⁠
:4.92.2-docker-go-1.20.14View⁠
:4.92.2-docker-rootlessView⁠
:4.92.2-docker-rootless-go-1.20.14View⁠
:4.91.1View⁠
:4.91.1-dockerView⁠
:4.91.1-docker-go-1.20.14View⁠
:4.91.1-docker-rootlessView⁠
:4.91.1-docker-rootless-go-1.20.14View⁠
:4.90.3View⁠
:4.90.3-dockerView⁠
:4.90.3-docker-go-1.20.14View⁠
:4.90.3-docker-rootlessView⁠
:4.90.3-docker-rootless-go-1.20.14View⁠
:4.89.1View⁠
:4.89.1-dockerView⁠
:4.89.1-docker-go-1.20.14View⁠
:4.89.1-docker-rootlessView⁠
:4.89.1-docker-rootless-go-1.20.14View⁠
:4.23.1View⁠
:4.23.1-dockerView⁠
:4.23.1-docker-go-1.20.14View⁠
:4.23.1-docker-rootlessView⁠
:4.23.1-docker-rootless-go-1.20.14View⁠
:4.22.1View⁠
:4.22.1-dockerView⁠
:4.22.1-docker-go-1.20.14View⁠
:4.22.1-docker-rootlessView⁠
:4.22.1-docker-rootless-go-1.20.14View⁠
:4.21.2View⁠
:4.21.2-dockerView⁠
:4.21.2-docker-go-1.20.14View⁠
:4.21.2-docker-rootlessView⁠
:4.21.2-docker-rootless-go-1.20.14View⁠
:4.20.1View⁠
:4.20.1-dockerView⁠
:4.20.1-docker-go-1.20.14View⁠
:4.20.1-docker-rootlessView⁠
:4.20.1-docker-rootless-go-1.20.14View⁠
:4.19.1View⁠
:4.19.1-dockerView⁠
:4.19.1-docker-go-1.20.14View⁠
:4.19.1-docker-rootlessView⁠
:4.19.1-docker-rootless-go-1.20.14View⁠
:4.18.0View⁠
:4.18.0-dockerView⁠
:4.18.0-docker-go-1.20.14View⁠
:4.18.0-docker-rootlessView⁠
:4.18.0-docker-rootless-go-1.20.14View⁠
:4.17.1View⁠
:4.17.1-dockerView⁠
:4.17.1-docker-go-1.20.14View⁠
:4.17.1-docker-rootlessView⁠
:4.17.1-docker-rootless-go-1.20.14View⁠
:4.16.1View⁠
:4.16.1-dockerView⁠
:4.16.1-docker-go-1.20.14View⁠
:4.16.1-docker-rootlessView⁠
:4.16.1-docker-rootless-go-1.20.14View⁠
:4.15.0View⁠
:4.15.0-dockerView⁠
:4.15.0-docker-go-1.20.14View⁠
:4.15.0-docker-rootlessView⁠
:4.15.0-docker-rootless-go-1.20.14View⁠
:4.14.1View⁠
:4.14.1-dockerView⁠
:4.14.1-docker-go-1.20.14View⁠
:4.14.1-docker-rootlessView⁠
:4.14.1-docker-rootless-go-1.20.14View⁠
:4.13.0View⁠
:4.13.0-dockerView⁠
:4.13.0-docker-go-1.20.14View⁠
:4.13.0-docker-rootlessView⁠
:4.13.0-docker-rootless-go-1.20.14View⁠
:4.12.0View⁠
:4.12.0-dockerView⁠
:4.12.0-docker-go-1.20.14View⁠
:4.12.0-docker-rootlessView⁠
:4.12.0-docker-rootless-go-1.20.14View⁠
:4.11.0View⁠
:4.11.0-dockerView⁠
:4.11.0-docker-go-1.20.14View⁠
:4.11.0-docker-rootlessView⁠
:4.11.0-docker-rootless-go-1.20.14View⁠

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.

Tag summary

Content type

Image

Digest

sha256:bfcc2ae95…

Size

746.5 MB

Last updated

11 months ago

docker pull theohbrothers/docker-code-server:master-00b8d95-4.13.0-docker-rootless-go-1.20.14