Skip to content

Commit 902e328

Browse files
axonasifjeanp413
authored andcommitted
Add example guide for pre-installing vscode extensions with docker installation
1 parent 85d0002 commit 902e328

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,39 @@ _Note_: Feel free to use the `nightly` tag to test the latest version, i.e. `git
4444
```
4545
- For additional possibilities, please consult the `Dockerfile` for OpenVSCode Server at https://github.com/gitpod-io/openvscode-releases/
4646

47+
#### Pre-installing VSCode extensions
48+
49+
You can pre-install vscode extensions in such a way:
50+
51+
```dockerfile
52+
FROM gitpod/openvscode-server:latest
53+
54+
ENV OPENVSCODE_SERVER_ROOT="/home/.openvscode-server"
55+
ENV OPENVSCODE="${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server"
56+
57+
SHELL ["/bin/bash", "-c"]
58+
RUN \
59+
# Direct download links to external .vsix not available on https://open-vsx.org/
60+
# The two links here are just used as example, they are actually available on https://open-vsx.org/
61+
urls=(\
62+
https://github.com/rust-lang/rust-analyzer/releases/download/2022-12-26/rust-analyzer-linux-x64.vsix \
63+
https://github.com/VSCodeVim/Vim/releases/download/v1.24.3/vim-1.24.3.vsix \
64+
)\
65+
# Create a tmp dir for downloading
66+
&& tdir=/tmp/exts && mkdir -p "${tdir}" && cd "${tdir}" \
67+
# Download via wget from $urls array.
68+
&& wget "${urls[@]}" && \
69+
# List the extensions in this array
70+
exts=(\
71+
# From https://open-vsx.org/ registry directly
72+
gitpod.gitpod-theme \
73+
# From filesystem, .vsix that we downloaded (using bash wildcard '*')
74+
"${tdir}"/* \
75+
)\
76+
# Install the $exts
77+
&& for ext in "${exts[@]}"; do ${OPENVSCODE} --install-extension "${ext}"; done
78+
```
79+
4780
### Linux
4881

4982
- [Download the latest release](https://github.com/gitpod-io/openvscode-server/releases/latest)

0 commit comments

Comments
 (0)