Skip to content

Commit

Permalink
Add dind feature to devcontainer to seperate envs (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Jun 19, 2024
1 parent b1956f2 commit f33bbf2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
39 changes: 27 additions & 12 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
{
"name": "hacs/addons",
"image": "ghcr.io/home-assistant/devcontainer:addons",
"appPort": [
"7123:8123",
"7357:4357"
],
"postStartCommand": "bash devcontainer_bootstrap",
"runArgs": [
"-e",
"GIT_EDITOR=code --wait",
"--privileged"
"forwardPorts": [
8123,
4357
],
"portsAttributes": {
"4357": {
"label": "Home Assistant Observer"
},
"8123": {
"label": "Home Assistant UI"
}
},
"postStartCommand": "bash script/setup",
"remoteUser": "root",
"containerEnv": {
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
},
"mounts": [
{
"source": "hacs-addon-dind-var-lib-docker",
"target": "/var/lib/docker",
"type": "volume"
},
{
"source": "hacs-addon-supervisor-data",
"target": "/supervisor_data",
"type": "volume"
}
],
"customizations": {
"vscode": {
"extensions": [
"timonwong.shellcheck",
"esbenp.prettier-vscode"
],
"mounts": [
"type=volume,target=/var/lib/docker"
],
"settings": {
"terminal.integrated.profiles.linux": {
"zsh": {
Expand All @@ -37,5 +49,8 @@
"files.trimTrailingWhitespace": true
}
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
}
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"label": "Start Home Assistant",
"type": "shell",
"command": "supervisor_run",
"command": "bash script/develop",
"group": {
"kind": "test",
"isDefault": true
Expand Down
3 changes: 3 additions & 0 deletions script/develop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

bash supervisor_run
6 changes: 6 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

mkdir -p /tmp
ln -sf /supervisor_data /tmp/supervisor_data

bash devcontainer_bootstrap

0 comments on commit f33bbf2

Please sign in to comment.