This is an Minimal Alpine Linux image with glibc based image for code-server. It enables one to run VS Code in the browser.
code-server service on this container will run as non-root
(vscode
) user. This add an extra layer of security and are generally recommended for production environments. This container also allow mapping of the user id
and group id
of the user running docker to vscode
user and group, which will enable the use of more restrictive file permission.
$ docker run --name code-server -v ~/path/on/host:/home/vscode -e TZ=Asia/Jakarta -e EUID=$(id -u) -e EGID=$(id -g) -p 8080:8080 martinussuherman/alpine-code-server
This will set the timezone
to Asia/Jakarta (you will want to change it to your own timezone) and map the user id
and group id
of the current user to vscode
user and group.
version: '3'
services:
code-server:
image: martinussuherman/alpine-code-server
environment:
- TZ=Asia/Jakarta
- EUID=1001
- EGID=1001
volumes:
- ~/path/on/host:/home/vscode
ports:
- 8080:8080
Note:
- You will want to change the value for
EUID
andEGID
with your current useruser id
andgroup id
. - code-server config file will be saved to
~/path/on/host/.config/code-server/config.yaml