[infrastructure] Make the client entrypoint executable regardless of the context

The client image copied the entrypoint with a bare COPY, so its mode came from
whatever the build context held. In a git checkout that is 100755 and the image
works. Building from this module's extracted copy in the module cache — which is
what a suite in another module now does — every file is 0444, because the cache
drops the executable bit, and the container dies on startup with

	exec: "/usr/local/bin/netbird-entrypoint.sh": permission denied

Copy it with --chmod=0755 instead, so the mode is stated rather than inherited.
The proxy Dockerfile already does this for /certs, and the build already requires
BuildKit.

Found by running the terraform provider's suite against images built this way:
the combined server and the proxy came up, and every test needing an agent failed
on the entrypoint.
This commit is contained in:
mlsmaycon
2026-08-12 06:12:53 +00:00
parent 910fef5406
commit 2614433b9a

View File

@@ -20,5 +20,9 @@ ENV NETBIRD_BIN="/usr/local/bin/netbird" \
NB_ENABLE_CAPTURE="false" \
NB_ENTRYPOINT_SERVICE_TIMEOUT="30"
ENTRYPOINT [ "/usr/local/bin/netbird-entrypoint.sh" ]
COPY client/netbird-entrypoint.sh /usr/local/bin/netbird-entrypoint.sh
# --chmod because the build context is not always a git checkout. A suite in
# another module builds from this module's extracted copy in the module cache,
# where every file is 0444 — the cache drops the executable bit git records — and
# a bare COPY then produces an entrypoint the runtime cannot exec.
COPY --chmod=0755 client/netbird-entrypoint.sh /usr/local/bin/netbird-entrypoint.sh
COPY --from=builder /out/netbird /usr/local/bin/netbird