mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-19 09:53:02 -04:00
Merge pull request #410 from linuxserver/code-server-extension-arguments-s6v3
switch to hybrid (code-server-extension-arguments)
This commit is contained in:
@@ -1,9 +1,21 @@
|
|||||||
# Extension Arguments - Docker mod for code-server
|
# Extension Arguments - Docker mod for code-server/openvscode-server
|
||||||
|
|
||||||
|
This mod installs code-server/openvscode-server extensions at startup. The list of extensions to be installed should be provided using environment variable `VSCODE_EXTENSION_IDS` separated by `|`.
|
||||||
|
|
||||||
|
__NOTE__:
|
||||||
|
Since transitioning from `v3.12.0` to `v4.0.x` `code-server` has been forced to use a new Extensions Gallery / Marketplace. This results in a smaller set of plugins being available to install. Please take this into account before opening an Issue!
|
||||||
|
|
||||||
|
A workaround for this is to use the environment variable `EXTENSIONS_GALLERY` to provide a different marketplace URL. The commandline installer used by this plugin will also use the marketplace provided by this variable.
|
||||||
|
|
||||||
|
Please refer to the [code-server FAQ](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-use-my-own-extensions-marketplace) for additional information.
|
||||||
|
|
||||||
This mod installs code-server extensions at startup. The list of extensions to be installed should be provided using environment variable `VSCODE_EXTENSION_IDS` separated by `|`.
|
|
||||||
|
|
||||||
For example, to install the `vscode-docker` and `vscode-icons` extensions add the following lines to your docker compose service:
|
For example, to install the `vscode-docker` and `vscode-icons` extensions add the following lines to your docker compose service:
|
||||||
```yaml
|
```yaml
|
||||||
- DOCKER_MODS=linuxserver/mods:code-server-docker|linuxserver/mods:code-server-extension-arguments
|
environment:
|
||||||
- VSCODE_EXTENSION_IDS=vscode-icons-team.vscode-icons|ms-azuretools.vscode-docker
|
DOCKER_MODS: 'linuxserver/mods:code-server-docker|linuxserver/mods:code-server-extension-arguments'
|
||||||
|
VSCODE_EXTENSION_IDS: 'vscode-icons-team.vscode-icons|ms-azuretools.vscode-docker'
|
||||||
|
## Optionally use a different marketplace if required extensions are unavailable. e.g.:
|
||||||
|
# EXTENSIONS_GALLERY: '{"serviceUrl": "https://extensions.coder.com/api"}'
|
||||||
|
# EXTENSIONS_GALLERY: '{"serviceUrl": "https://open-vsx.org/vscode/gallery", "itemUrl": "https://open-vsx.org/vscode/item"}'
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -6,10 +6,15 @@ if [ -z ${VSCODE_EXTENSION_IDS+x} ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
IFS='|'
|
IFS='|'
|
||||||
VSCODE_EXTENSION_IDS=(${VSCODE_EXTENSION_IDS})
|
VSCODE_EXTENSION_IDS=(${VSCODE_EXTENSION_IDS})
|
||||||
|
# Use newly available abstraction if available (>= v4.0.x), else fallback to old method.
|
||||||
|
if [ -x "$(command -v install-extension)" ]; then
|
||||||
|
for ID in "${VSCODE_EXTENSION_IDS[@]}"; do
|
||||||
|
install-extension ${ID}
|
||||||
|
done
|
||||||
|
else
|
||||||
for ID in "${VSCODE_EXTENSION_IDS[@]}"; do
|
for ID in "${VSCODE_EXTENSION_IDS[@]}"; do
|
||||||
echo "**** installing extension: ${ID} ****"
|
|
||||||
s6-setuidgid abc code-server --user-data-dir /config/data --extensions-dir /config/extensions --install-extension ${ID}
|
s6-setuidgid abc code-server --user-data-dir /config/data --extensions-dir /config/extensions --install-extension ${ID}
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
|
# Exit if no VsCode extensions are given
|
||||||
|
if [ -z ${VSCODE_EXTENSION_IDS+x} ]; then
|
||||||
|
echo "**** No VSCODE EXTENSIONS GIVEN****"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS='|'
|
||||||
|
VSCODE_EXTENSION_IDS=(${VSCODE_EXTENSION_IDS})
|
||||||
|
for ID in "${VSCODE_EXTENSION_IDS[@]}"; do
|
||||||
|
install-extension ${ID}
|
||||||
|
done
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
oneshot
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/etc/s6-overlay/s6-rc.d/init-mod-code-server-extension-arguments/run
|
||||||
Reference in New Issue
Block a user