How to install VS Code in Alpine Linux

Viewed 9329

I have an operating environment that is Alpine linux only and I need to install VS Code. How can VS Code be run on Alpine Linux?

3 Answers

Dockerfile:

FROM node:14.19.0-alpine
RUN set -x \
    && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
    && apk upgrade \
    && apk --no-cache add alpine-sdk bash libstdc++ libc6-compat \
    && npm config set python python3 
RUN git clone --recursive https://github.com/cdr/code-server.git
RUN cd code-server
RUN yarn global add code-server

ENV PASSWORD=changeme
ENTRYPOINT code-server --bind-addr 0:8443

Commands:

docker build . -t vscode
docker run -d -e PASSWORD=111111 -p8443:8443 vscode:latest
http://hostname:8443
  1. Download it in Flatpak repos, it will run natively in a Gnome SDK environment.
  2. Use a self-hosted environment such as Theia (https://www.theia-ide.org/index.html) or coder-editor (https://coder.com/). I've never tried them, I use the Flatpak one, but they seem interesting (you can "build" your osn editor in a Node environment).

Apologies for necrobump, but as what Marco suggested, coder.com has moved to github

the software, code-server is quite litterally VSCode, as a web application, I have been using this for about half a year and it is quite well developed, Alpine support is still spotty but i recall getting a few releases to function well a while back when i ran Alpine as my main.

Related