Skip to content

Commit 12d3ff5

Browse files
committed
Switch runargs to mounts
1 parent 8e71457 commit 12d3ff5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.devcontainer/devcontainer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@
1414

1515
// Mount go mod cache
1616
"-v", "devcontainer-cli-gomodcache:/go/pkg",
17-
// Keep command history
18-
"-v", "devcontainer-cli-bashhistory:/root/commandhistory",
19-
// Mount docker socket for docker builds
20-
"-v", "/var/run/docker.sock:/var/run/docker.sock",
2117
// Use host network
2218
"--network=host",
23-
// Mount azure, git and docker config
24-
"-v", "${env:HOME}${env:USERPROFILE}/.azure:/root/.azure"
2519
],
2620

2721
// Set *default* container specific settings.json values on container create.
@@ -63,9 +57,15 @@
6357
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
6458
"remoteUser": "vscode",
6559
"mounts": [
60+
// Keep command history
61+
"source=devcontainer-cli-bashhistory,target=/home/vscode/commandhistory",
6662
// Mounts the .config/gh host folder into the dev container to pick up host gh CLI login details
6763
// NOTE that mounting directly to ~/.config/gh makes ~/.config only root-writable
6864
// Instead monut to another location and symlink in Dockerfile
6965
"type=bind,source=${env:HOME}${env:USERPROFILE}/.config/gh,target=/config/gh",
66+
// Mounts the .azure host folder into the dev container to pick up host az CLI login details
67+
"type=bind,source=${env:HOME}${env:USERPROFILE}/.azure,target=/home/vscode/.azure",
68+
// Mount host docker socket
69+
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock",
7070
],
7171
}

.github/workflows/build-and-release.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ jobs:
3030
password: ${{ secrets.GITHUB_TOKEN }}
3131

3232
- name: Build and run CLI
33-
uses: stuartleeks/devcontainer-build-run@v0.1-alpha
33+
uses: stuartleeks/devcontainer-build-run@sl/env-var-substitution
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GH_CROSS_REPO_TOKEN }}
3636
BUILD_NUMBER: ${{ github.run_id }}
3737
IS_PR: ${{ github.head_ref }}
3838
BRANCH: ${{ github.ref }}
3939
with:
4040
imageName: ghcr.io/stuartleeks/devcontainer-cli-devcontainer
41-
runCmd: make devcontainer-release
41+
runCmd: |
42+
sudo chown -R $(whoami) /go/pkg
43+
./scripts/ci_release.sh
4244
env: |
4345
GITHUB_TOKEN
4446
BUILD_NUMBER

0 commit comments

Comments
 (0)