b01 / dl-vscode-server

MIT License
20 stars 4 forks source link

DL VS Code Server

This script downloads a tar of VS Code Server/CLI, then extracts it to a location expected by tunnels made by VS Code clients.

The intention of this script is to pre-install the VS Code binary during container image build. This helps ensure, in certain scenarios, that the binary is there when internet is not; while still allowing your VS Code client to tunnel to the container.

When the VS Code binary is out-of-date, to get the latest version, re-run the script.

Background

The original reason was and still is to prevent the constant download and install of VS Code server when the container is removed then run again later. With the server being embedded in the image, it should also reduce time for the dev container to be ready.

It originally started as a Gist; which you can review previous versions of the script at b01/download-vs-code-server.sh

Status

CircleCI

How To Install

Shell

curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code-server.sh | bash -s -- "linux"

Docker

ADD --chmod=777 \
    https://raw.githubusercontent.com/b01/dl-vscode-server/updates-2024-05-16-01/download-vs-code.sh \
    .

# Install VS Code Server and Requirements
RUN ./download-vs-code.sh "linux" "x64" --alpine --extensions dbaeumer.vscode-eslint

How To Use

download-vs-code.sh [options] <PLATFORM> [<ARCH>]

Example:

download-vs-code.sh \"linux\" \"x64\" --alpine

Options

--insider Switches to the pre-released version of the binary chosen (server or CLI).

--dump-sha Will print the latest commit sha for VS Code (server and CLI are current synced and always the same)

--cli Switches the binary download VS Code CLI.

--alpine Only works when downloading VS Code Server, it will force PLATFORM=linux and ARCH=alpine, as the developers deviated from the standard format used for all others.

-h, --help Print this usage info

--extensions specify which extensions to install. expects a string of full extension names seperated by commas, e.g ms-vscode.PowerShell,redhat.ansible,ms-python.vscode-pylance