-
Notifications
You must be signed in to change notification settings - Fork 392
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·35 lines (25 loc) · 1.23 KB
/
start.sh
File metadata and controls
executable file
·35 lines (25 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
set -xe
cd "$(dirname $0)"
pwd
remove_flag=""
if [ "$1" = "true" ]; then
remove_flag="--remove-existing-container"
fi
chmod +x server/init-vscodium-server.sh
npm install -g @devcontainers/cli
# Resolves any variables like ${containerWorkspaceFolder}
# Processes any referenced configurations
# Expands environment variables
# etc.
# Save off effective config for use in the container
devcontainer read-configuration --include-merged-configuration --log-format json --workspace-folder ../workspace > server/configuration.json
# Mount server script and start container. The .devcontainer/ folder is under ../workspace. We need to be there.
# devcontainer up $remove_flag --mount "type=bind,source=$(pwd)/server,target=/server" \
# --workspace-mount type=bind,source=/workspaces/devcontainers-cli-fork/example-usage/workspace,target=/workspace \
# --workspace-folder ../workspace
devcontainer up $remove_flag --mount "type=bind,source=$(pwd)/server,target=/server" \
--mount type=bind,source=$(realpath ../workspace),target=/workspace \
--workspace-folder ../workspace
# Initialize VSCodium server (wont return until server is stopped)
devcontainer exec --workspace-folder ../workspace /server/init-vscodium-server.sh