Skip to content

Commit 8a34d48

Browse files
author
Developer
committed
fix: preinstall provision tools in debian-based agent image
The provision service (scripts/e2e-provision.sh) ran `apk add python3 openssl curl jq` on startup, but after the agent base moved from Alpine to debian:slim there is no apk, so the script exited 127 with the error swallowed by the redirect. Preinstall the tools via apt in the agent image (provision shares this image) and make the script's package-install step conditional on which package manager is present.
1 parent aa2fb6e commit 8a34d48

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ RUN npm run build
4949
# binlogs. ~150MB vs ~600MB for mysql:8.0 as the agent base.
5050
FROM debian:12-slim AS agent
5151

52+
# python3/openssl/curl/jq are preinstalled for the provision service, which
53+
# shares this agent image (scripts/e2e-provision.sh uses them to register the
54+
# agent and issue its mTLS certificate).
5255
RUN apt-get update && apt-get install -y --no-install-recommends \
53-
ca-certificates tzdata mariadb-client && \
56+
ca-certificates tzdata mariadb-client python3 openssl curl jq && \
5457
rm -rf /var/lib/apt/lists/* && \
5558
ln -sf /usr/bin/mariadb-binlog /usr/bin/mysqlbinlog && \
5659
test -x /usr/bin/mysqlbinlog && \

scripts/e2e-provision.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
# ============================================================================
1212
set -e
1313

14-
apk add --no-cache python3 openssl curl jq >/dev/null 2>&1
14+
# Provisioning tools are preinstalled in the agent image (debian base). Fall
15+
# back to installing them on the fly when this script runs on other bases.
16+
if command -v apk >/dev/null 2>&1; then
17+
apk add --no-cache python3 openssl curl jq >/dev/null 2>&1 || true
18+
elif command -v apt-get >/dev/null 2>&1; then
19+
apt-get update -qq >/dev/null 2>&1 && \
20+
apt-get install -y -qq --no-install-recommends python3 openssl curl jq >/dev/null 2>&1 || true
21+
fi
1522

1623
SERVER_URL="http://server:8080"
1724
DATA_DIR="/var/lib/mysql-pitr"

0 commit comments

Comments
 (0)