Bookmark

VSCodium in Docker: a web IDE for the HomeLab on port 8003

VSCodium is a community build of Visual Studio Code intended to provide binaries without Microsoft's telemetry/tracking. The i12bretro tutorial runs the LinuxServer image in Docker, persists config and code on the host, and exposes the IDE on port 8003.1

Youtube video player

The original video was validated through oEmbed and is embedded with the existing shortcode.2

Install Docker

Log in to the Linux Docker host:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
# add docker gpg key
curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
# add docker software repository
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
# install docker
sudo apt install docker-ce docker-compose containerd.io -y
# enable and start docker service
sudo systemctl enable docker && sudo systemctl start docker
# add the current user to the docker group
sudo usermod -aG docker $USER
# reauthenticate for the new group membership to take effect
su - $USER

Run VSCodium

Check UID/GID, create persistent directories, and start the container. The source uses id $user; I retain it and check the shell variable before setting PUID/PGID:

1
2
3
4
5
6
7
# list current uid and gid, note these for later
id $user
# create working directories
mkdir ~/docker/vscodium/{config,code} -p
# run the vscodium docker image
# replace PUID, GUID with the output of the id $user command above
docker run -d --name=vscodium --cap-add=IPC_LOCK -e PUID=1000 -e PGID=1000 -e TZ=America/New_York -p 8003:3000 -v ~/docker/vscodium/config:/config -v ~/docker/vscodium/code:/code --shm-size="1gb" --restart unless-stopped lscr.io/linuxserver/vscodium:latest

Open http://localhost:8003 as in the source, or replace localhost with the host DNS/IP when connecting from another machine. The container uses --cap-add=IPC_LOCK, 1 GB shared memory, and writes to the two host directories.

Verify and limit exposure

Check docker ps, docker logs vscodium, and read/write permissions on ~/docker/vscodium/config and ~/docker/vscodium/code. Do not expose the IDE directly to the Internet; use an authenticated reverse proxy or VPN. Back up code/config before image updates and install extensions from trusted sources.

Sources


  1. https://i12bretro.github.io/tutorials/0985.html — i12bretro tutorial 0985. Independently edited from the numbered HTML page; UID/GID, ports, paths, and the capability are retained. ↩︎

  2. https://www.youtube.com/watch?v=dJgh13kYmoI — Run VSCodium Containerized in Docker — i12bretro ↩︎


0 Bình luận

Góp Ý / Bình Luận / Đánh giá