Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addons/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"appPort": ["7123:8123", "7357:4357"],
"postStartCommand": "bash devcontainer_bootstrap",
"runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"],
"workspaceFolder": "/mnt/supervisor/addons/local/${localWorkspaceFolderBasename}",
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind,consistency=cached",
"containerEnv": {
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
},
Expand Down
10 changes: 9 additions & 1 deletion addons/rootfs/usr/bin/devcontainer_bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ set -e

bash /usr/bin/supervisor_bootstrap

exit 0
workspace_mount="/mnt/supervisor/addons/local/$(basename "${WORKSPACE_DIRECTORY:?}")"
if ! mountpoint -q "${workspace_mount}"; then
echo "WARNING: Mounting ${WORKSPACE_DIRECTORY} to ${workspace_mount}." >&2
echo "To avoid this warning, see https://github.com/home-assistant/devcontainer/pull/135." >&2
sudo mkdir -p "${workspace_mount}"
sudo mount --bind "${WORKSPACE_DIRECTORY}" "${workspace_mount}"
fi

exit 0
1 change: 0 additions & 1 deletion addons/rootfs/usr/bin/supervisor_run
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function run_supervisor() {
-v /run/dbus:/run/dbus:ro \
-v /run/udev:/run/udev:ro \
-v /mnt/supervisor:/data:rw \
-v "$WORKSPACE_DIRECTORY":/data/addons/local:rw \
-v /etc/machine-id:/etc/machine-id:ro \
-e SUPERVISOR_SHARE="/mnt/supervisor" \
-e SUPERVISOR_NAME=hassio_supervisor \
Expand Down