Skip to content

Commit 108c61c

Browse files
author
Alan Christie
committed
feat: Persists command history and mounts k8s-config
1 parent 36c3145 commit 108c61c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

devcontainer.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,25 @@
77
"name": "Python Docker",
88
"build": {
99
"dockerfile": "Dockerfile" },
10+
// User is expected to have a local ~/k8s-config directory
11+
// and it's an error not to have this directory.
12+
// We mount this into the container at /k8s-config.
13+
//
14+
// We also mount bash history in an attempt to preserver history
15+
// between container restarts
16+
// (see https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history)
17+
"mounts": [
18+
"source=${localEnv:HOME}/k8s-config,target=/k8s-config,type=bind,consistency=cached",
19+
"source=projectname-bashhistory,target=/commandhistory,type=volume"
20+
],
21+
"postCreateCommand": {
22+
"Fix Volume Permissions": "sudo chown -R $(whoami): /commandhistory"
23+
},
24+
// Install Docker-in-Docker
1025
"features": {
1126
"ghcr.io/devcontainers/features/docker-in-docker": {}
1227
},
28+
// Add VSCode extensions that we normally use...
1329
"customizations": {
1430
"vscode": {
1531
"extensions": [
@@ -37,4 +53,3 @@
3753
}
3854
}
3955
}
40-

0 commit comments

Comments
 (0)