Skip to content

armgit / ARTEX

Public Imported from GitHub
0

ARTEX - AI autonomous penetration testing system (English translation; upstream: Autumn-27/ARTEX, AGPL-3.0)

fix(install): check for docker buildx before building the image

Phantom-IN0b4a0d135e3e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3bb4b5e..9c3a074 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ All notable changes to this project are documented in this file. The format is b
### Fixed
+- **Missing Docker buildx is reported before the build**: without the buildx plugin, Compose only warns and falls back to the legacy builder, which fails on the Dockerfile's first `FROM --platform=$BUILDPLATFORM` with `failed to parse platform`. `install.sh` (all-Docker) and `update.sh` (Docker update) now check `docker buildx version` first and stop with an install hint, and the automatic Docker install on apt-based distros not covered by get.docker.com installs the buildx package as well. The README Docker section names buildx as a requirement.
- **A goal URL followed by punctuation is still seeded**: a goal such as `Assess http://juiceshop:3000.` no longer logs `could not parse a target host/IP` and skips the site. Trailing punctuation, including full-width `。` and a closing bracket that has no matching opener, is trimmed from the URL before it is parsed, so `http://[::1]` is left alone. The scheme the goal names is kept and a final period does not end up in the host.
- **Task timeout triggers fire for every task**: `on_task_timeout` used the task id as a watermark, but tasks time out in deadline order. Once a newer task timed out first, an older task that timed out later was never fired for. Fired timeouts are now kept in a persisted set, like met goals; on first start the set is seeded with the tasks already timed out, so nothing replays.
- **A named pipe in the task workspace no longer hangs the archive worker**: packing opened every non-directory entry, and opening a FIFO blocks until a writer appears, so the single archive worker stopped there and every later archive, restore and delete job waited behind it. A socket failed the archive instead, and a device was packed but refused on restore. The packer now skips every entry that is neither a directory nor a regular file, as it already did for symlinks.
diff --git a/README.md b/README.md
index 3430e48..a11b4f3 100644
--- a/README.md
+++ b/README.md
@@ -344,6 +344,12 @@ docker compose up -d --build
# → http://localhost:8787
```
+The checkout build needs the Docker **buildx** plugin (BuildKit). Docker Desktop and
+get.docker.com include it; distro packages and Homebrew's docker CLI (Colima) may not. If
+`docker buildx version` fails, install `docker-buildx-plugin` or `docker-buildx`, or on macOS
+`brew install docker-buildx`. Without it the build stops at the first stage with
+`failed to parse platform`.
+
The release workflow publishes a multi-arch image (`linux/amd64`, `linux/arm64`) to GitHub
Container Registry on each `v*` tag, with tags `:latest`, `:v<version>`, and `:<version>`.
v0.7.0 predates that step, so there is no `artex` package yet: until the next tagged release,
diff --git a/install.sh b/install.sh
index 9370776..63e67ca 100755
--- a/install.sh
+++ b/install.sh
@@ -82,15 +82,33 @@ install_docker_linux(){
sudo apt-get install -y "$p" && break
fi
done
+ # docker.io only suggests buildx on some releases, and the image build needs it.
+ for p in docker-buildx-plugin docker-buildx; do
+ if apt-cache madison "$p" 2>/dev/null | grep -q .; then
+ sudo apt-get install -y "$p" && break
+ fi
+ done
# Kali (and some others) don't start services on package install.
if command -v systemctl >/dev/null 2>&1; then
sudo systemctl enable --now docker || true
fi
}
+# The Dockerfile uses --platform=$BUILDPLATFORM, which needs BuildKit. Without the
+# buildx plugin Compose only warns, falls back to the legacy builder and fails on
+# the first FROM with 'failed to parse platform'.
+ensure_buildx(){
+ docker buildx version >/dev/null 2>&1 && return
+ case "$(uname -s)" in
+ Darwin) die "docker buildx not detected; the image build needs it. Docker Desktop includes it; with Homebrew's docker CLI (e.g. Colima) run 'brew install docker-buildx' and register the plugin as its caveats describe" ;;
+ *) die "docker buildx not detected; the image build needs it. Install docker-buildx-plugin (Docker's repo) or docker-buildx (distro repo) and retry" ;;
+ esac
+}
+
# ── 1) All-Docker ───────────────────────────────
install_docker(){
ensure_docker
+ ensure_buildx
if [ ! -f .env ]; then
cp .env.example .env 2>/dev/null || true
local pw key
diff --git a/update.sh b/update.sh
index 10ffc24..3339851 100755
--- a/update.sh
+++ b/update.sh
@@ -34,6 +34,8 @@ RECOVER
update_docker(){
command -v docker >/dev/null 2>&1 && docker compose version >/dev/null 2>&1 \
|| die "docker / docker compose not detected; install and deploy with ./install.sh first"
+ docker buildx version >/dev/null 2>&1 \
+ || die "docker buildx not detected; the image build needs it (see the Docker section of the README)"
[ -f .env ] || die ".env not found; run ./install.sh first to complete the initial deployment"
# Touch only artex: postgres is pinned to 16-alpine and does not need upgrading along