sabrehagen
sabrehagen

Reputation: 1637

How to install VS Code in Alpine Linux

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?

Upvotes: 6

Views: 22911

Answers (4)

Byron Smith
Byron Smith

Reputation: 9

EDIT: I have an Alpine Linux virtual machine and I have successfully installed the Flatpak version of VSCode, which I think may be the optimal solution (obviously, flatpak has to be installed via apk).

Apologies for another necrobump, but VSCode now has a web portal (I do not know if it did at the time Merith TK answered) at https://vscode.dev/

Upvotes: -1

Merith TK
Merith TK

Reputation: 11

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.

Upvotes: 1

JohnTang
JohnTang

Reputation: 76

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

Upvotes: 6

Marco De Stefani
Marco De Stefani

Reputation: 11

  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).

Upvotes: 1

Related Questions