This is my opinionated attempt to build a lightweight docker image to run openvscode-server. Think vscode, on the browser.
Enough talking, show me some numbers:
REPOSITORY | SIZE¹ |
---|---|
codercom/code-server:latest | 697MB |
linuxserver/code-server:latest | 563MB |
gitpod/openvscode-server:latest | 523MB |
ghcr.io/raonigabriel/coder-server:latest | 208MB |
- (1) Uncompressed sizes, on amd64. Those values are even smaller on aarch64!!
- Based on my coder-core instead of Ubuntu. This translates to musl being used instead of glib, but compatibility libraries are also preinstalled.
- Its is Alpine, but using bash instead of ash.
- By using tini, we ensure that child processes are correctly reaped.
- Default user coder and group coder using UID and GID = 1000, to ease volume-mapping permissions issues.
- Passwordless, sudo support: easily install extra packages with apk (e.g,
sudo apk add docker-cli jq
) - Preinstalled cloudflare tunnel client, like ngrok but free!! This allows you to create reverse tunnels (when your are behind nat). See their docs here
- Preinstalled tooling (node, npm, git, curl, socat, openssh-client, nano, unzip, brotli, zstd, xz) !!!
- Image is hosted on GitHub Container Registry, hence no Dockerhub caps.
- Whenever possible, install software directly from the Alpine repositories, i.e. use apk instead of downloading / manually installing them.
- Keep it small: do not cross the 250MB image size boundary.
- Multi arch (amd64 && arm64)
-
By default this image is not with running with HTTPS but HTTP instead. Its your responsibility to add a reverse-proxy to do that. If you dont, keep in mind that some issues may arise, regarding service workers on the browser. This is because they need HTTPS to work properly.
-
By default this image has no security enforced (user / password). Its your responsibility to add a reverse-proxy to do that.
docker run -d -p 8000:8000 ghcr.io/raonigabriel/coder-server:latest
Then, point your browser to http://localhost:8000
FROM ghcr.io/raonigabriel/coder-server:latest
# Setup env variables
ENV JAVA_HOME=/usr/lib/jvm/default-jvm \
MAVEN_HOME=/usr/share/java/maven-3 \
GRADLE_HOME=/usr/share/java/gradle
# Installing Java and tools
RUN sudo apk --no-cache add maven gradle && \
# Installing Java extensions
openvscode-server --install-extension vscjava.vscode-java-pack \
vscjava.vscode-gradle vscjava.vscode-spring-initializr
- I am not sponsored neither work for cloudflare. I just happen to use their services, because they are cool!
- This code comes with no warranty. Use it at your own risk.
- I don't like Apple. Fuck off, fan-boys.
- I don't like left-winged snowflakes. Fuck off, code-covenant.
- I will call my branches the old way. Long live master, fuck-off renaming.