diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 71a2de2d5..b8abb555d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -41,6 +41,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ docker-ce \ docker-ce-cli \ containerd.io \ + && update-alternatives --set iptables /usr/sbin/iptables-legacy \ + && update-alternatives --set ip6tables /usr/sbin/iptables-legacy \ && rm -rf /var/lib/apt/lists/* # Install tools diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 97b66ee21..49e393a0b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,7 +4,7 @@ { "label": "Run Supervisor", "type": "shell", - "command": "./scripts/run-supervisor.sh", + "command": "./scripts/supervisor.sh", "group": { "kind": "test", "isDefault": true @@ -15,20 +15,6 @@ }, "problemMatcher": [] }, - { - "label": "Build Supervisor", - "type": "shell", - "command": "./scripts/build-supervisor.sh", - "group": { - "kind": "build", - "isDefault": true - }, - "presentation": { - "reveal": "always", - "panel": "new" - }, - "problemMatcher": [] - }, { "label": "Run Supervisor CLI", "type": "shell", diff --git a/scripts/build-supervisor.sh b/scripts/build-supervisor.sh deleted file mode 100755 index 7ecd60eb4..000000000 --- a/scripts/build-supervisor.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -source "${BASH_SOURCE[0]%/*}/common.sh" - -set -eE - -DOCKER_TIMEOUT=30 -DOCKER_PID=0 - -function build_supervisor() { - docker pull homeassistant/amd64-builder:dev - - docker run --rm \ - --privileged \ - -v /run/docker.sock:/run/docker.sock \ - -v "$(pwd):/data" \ - homeassistant/amd64-builder:dev \ - --generic latest \ - --target /data \ - --test \ - --amd64 \ - --no-cache -} - -echo "Build Supervisor" -start_docker -trap "stop_docker" ERR - -build_supervisor diff --git a/scripts/run-supervisor.sh b/scripts/supervisor.sh similarity index 85% rename from scripts/run-supervisor.sh rename to scripts/supervisor.sh index c792d0ef0..82b5c8674 100755 --- a/scripts/run-supervisor.sh +++ b/scripts/supervisor.sh @@ -1,12 +1,26 @@ #!/bin/bash source "${BASH_SOURCE[0]%/*}/common.sh" -source "${BASH_SOURCE[0]%/*}/build-supervisor.sh" set -eE DOCKER_TIMEOUT=30 DOCKER_PID=0 +function build_supervisor() { + docker pull homeassistant/amd64-builder:dev + + docker run --rm \ + --privileged \ + -v /run/docker.sock:/run/docker.sock \ + -v "$(pwd):/data" \ + homeassistant/amd64-builder:dev \ + --generic latest \ + --target /data \ + --test \ + --amd64 \ + --no-cache +} + function cleanup_docker() { echo "Cleaning up stopped containers..."