Skip to content

Commit 56dff69

Browse files
Tidy up devcontainer
1 parent f3d0812 commit 56dff69

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

.devcontainer/devcontainer.json

+3-18
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,15 @@
33
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
44
"features": {
55
"ghcr.io/devcontainers/features/node:1": {
6-
"version": "lts",
7-
"nodeGypDependencies": true,
8-
"yarn": true
6+
"version": "lts"
97
},
108
"ghcr.io/devcontainers/features/go:1": {
119
"version": "1.24.0"
1210
},
13-
"ghcr.io/devcontainers/features/common-utils:2": {
14-
"installZsh": false,
15-
"configureZshAsDefaultShell": false,
16-
"username": "root",
17-
"upgradePackages": true,
18-
"additionalPackages": "jq curl"
19-
},
11+
"ghcr.io/devcontainers/features/common-utils:2": {},
2012
"ghcr.io/devcontainers-contrib/features/shfmt:1": {
2113
"version": "3.10.0"
2214
}
2315
},
24-
"runArgs": [
25-
"--privileged",
26-
"--security-opt=seccomp=unconfined",
27-
"--network=host"
28-
],
29-
"containerUser": "root",
30-
"postCreateCommand": "go install -v github.com/uudashr/gopkgs/cmd/gopkgs@v2 && go install -v github.com/ramya-rao-a/go-outline@latest && go install -v github.com/cweill/gotests/gotests@latest && go install -v github.com/fatih/gomodifytags@latest && go install -v github.com/josharian/impl@latest && go install -v github.com/haya14busa/goplay/cmd/goplay@latest && go install -v github.com/go-delve/delve/cmd/dlv@latest && go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest && go install -v golang.org/x/tools/gopls@latest && go install -v honnef.co/go/tools/cmd/staticcheck@latest",
31-
"postStartCommand": "LATEST_LEEWAY_VERSION=$(curl -s https://api.github.com/repos/gitpod-io/leeway/releases/latest | grep '\"tag_name\"' | sed 's/.*\"tag_name\": \"v\\([^\"]*\\)\".*/\\1/') && curl -L -o /tmp/leeway.tar.gz https://github.com/gitpod-io/leeway/releases/download/v${LATEST_LEEWAY_VERSION}/leeway_Linux_amd64.tar.gz && tar -xzf /tmp/leeway.tar.gz -C /tmp && sudo install -m 755 /tmp/leeway /usr/local/bin/ && rm /tmp/leeway.tar.gz"
16+
"postStartCommand": "./.devcontainer/install-leeway.sh"
3217
}

.devcontainer/install-leeway.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
# This script downloads and installs the latest version of leeway
3+
4+
set -euo pipefail
5+
6+
# Get the latest leeway version from GitHub API
7+
LATEST_LEEWAY_VERSION=$(curl -s https://api.github.com/repos/gitpod-io/leeway/releases/latest | jq -r '.tag_name' | sed 's/^v//')
8+
9+
# Ensure we got a valid version
10+
if [ -z "$LATEST_LEEWAY_VERSION" ]; then
11+
echo "Error: Could not determine latest leeway version" >&2
12+
exit 1
13+
fi
14+
15+
echo "Installing leeway version: $LATEST_LEEWAY_VERSION"
16+
17+
# Download the latest leeway release
18+
curl -L -o /tmp/leeway.tar.gz "https://github.com/gitpod-io/leeway/releases/download/v${LATEST_LEEWAY_VERSION}/leeway_Linux_x86_64.tar.gz"
19+
20+
# Extract the tarball
21+
tar -xzf /tmp/leeway.tar.gz -C /tmp
22+
23+
# Install leeway to /usr/local/bin
24+
sudo install -m 755 /tmp/leeway /usr/local/bin/
25+
26+
# Clean up temporary files
27+
rm /tmp/leeway.tar.gz

0 commit comments

Comments
 (0)