Skip to content

Commit 8c16d74

Browse files
authored
Merge pull request #259 from RoboMagus/code-server-extension-arguments
CodeServer: extension-arguments
2 parents d1dc6e5 + a345eb8 commit 8c16d74

File tree

7 files changed

+25
-71
lines changed

7 files changed

+25
-71
lines changed

.github/workflows/BuildImage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on: [push, pull_request, workflow_dispatch]
44

55
env:
66
ENDPOINT: "linuxserver/mods" #don't modify
7-
BASEIMAGE: "replace_baseimage" #replace
8-
MODNAME: "replace_modname" #replace
7+
BASEIMAGE: "code-server" #replace
8+
MODNAME: "extension-arguments" #replace
99

1010
jobs:
1111
build:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM scratch
22

3-
LABEL maintainer="username"
3+
LABEL maintainer="robomagus"
44

55
# copy local files
66
COPY root/ /

Dockerfile.complex

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
# Rsync - Docker mod for openssh-server
1+
# Extension Arguments - Docker mod for code-server
22

3-
This mod adds rsync to openssh-server, to be installed/updated during container start.
3+
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 `|`.
44

5-
In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync`
6-
7-
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:openssh-server-rsync|linuxserver/mods:openssh-server-mod2`
8-
9-
# Mod creation instructions
10-
11-
* Fork the repo, create a new branch based on the branch `template`.
12-
* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done.
13-
* Inspect the `root` folder contents. Edit, add and remove as necessary.
14-
* Edit this readme with pertinent info, delete these instructions.
15-
* Finally edit the `.github/workflows/BuildImage.yml`. Customize the build branch, and the vars for `BASEIMAGE` and `MODNAME`.
16-
* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch.
17-
* Submit PR against the branch created by the team.
5+
For example, to install the `vscode-docker` and `vscode-icons` extensions add the following lines to your docker compose service:
6+
```yaml
7+
- DOCKER_MODS=linuxserver/mods:code-server-docker|linuxserver/mods:code-server-extension-arguments
8+
- VSCODE_EXTENSION_IDS=vscode-icons-team.vscode-icons|ms-azuretools.vscode-docker
9+
```

root/etc/cont-init.d/98-vpn-config

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# Exit if no VsCode extensions are given
4+
if [ -z ${VSCODE_EXTENSION_IDS+x} ]; then
5+
echo "**** No VSCODE EXTENSIONS GIVEN****"
6+
exit 0
7+
fi
8+
9+
10+
IFS='|'
11+
VSCODE_EXTENSION_IDS=(${VSCODE_EXTENSION_IDS})
12+
for ID in "${VSCODE_EXTENSION_IDS[@]}"; do
13+
echo "**** installing extension: ${ID} ****"
14+
code-server --user-data-dir /config/data --extensions-dir /config/extensions --install-extension ${ID}
15+
done

root/etc/services.d/sshvpn/run

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)