@@ -450,10 +450,11 @@ LABEL org.opencontainers.image.revision=$VCS_REF \
450450
451451ENV GODEBUG=cgocheck=0
452452
453- ARG FRANKENPHP_VERSION='v1.7 .0'
453+ ARG FRANKENPHP_VERSION='v1.9 .0'
454454
455455RUN --mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go,rw \
456456 --mount=type=cache,target=/root/go,rw \
457+ --mount=type=secret,id=github-token \
457458 set -x \
458459 && apk add --no-cache \
459460 # ca-certificates \
@@ -490,16 +491,20 @@ RUN --mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go,rw \
490491 && export GOTOOLCHAIN=local \
491492 && mkdir -p /usr/local/src/watcher \
492493 && cd /usr/local/src/watcher \
493- && curl -s https://api.github.com/repos/e-dant/watcher/releases/latest | \
494- grep tarball_url | \
495- awk '{ print $2 }' | \
496- sed 's/,$//' | \
497- sed 's/"//g' | \
498- xargs curl -L | \
499- tar xz --strip-components 1 && \
500- cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
501- cmake --build build && \
502- cmake --install build \
494+ && if [ -f /run/secrets/github-token ] && [ -s /run/secrets/github-token ]; then \
495+ curl -s -H "Authorization: Bearer $(cat /run/secrets/github-token)" https://api.github.com/repos/e-dant/watcher/releases/latest; \
496+ else \
497+ curl -s https://api.github.com/repos/e-dant/watcher/releases/latest; \
498+ fi | \
499+ grep tarball_url | \
500+ awk '{ print $2 }' | \
501+ sed 's/,$//' | \
502+ sed 's/"//g' | \
503+ xargs curl -L | \
504+ tar xz --strip-components 1 && \
505+ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
506+ cmake --build build && \
507+ cmake --install build \
503508 && cd /go/src/app \
504509 && go mod download \
505510 && cd /go/src/app/caddy \
@@ -509,7 +514,8 @@ RUN --mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go,rw \
509514 && export CGO_CPPFLAGS=$PHP_CPPFLAGS \
510515 && export CGO_LDFLAGS="-lssl -lcrypto -lreadline -largon2 -lcurl -lonig -lz $PHP_LDFLAGS" \
511516 && cd /go/src/app/caddy/frankenphp \
512- && GOBIN=/usr/local/bin go install -tags 'nobadger,nomysql,nopgx' -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy'" -buildvcs=true && \
517+ && GOBIN=/usr/local/bin \
518+ ../../go.sh install -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy'" -buildvcs=true && \
513519 setcap cap_net_bind_service=+ep /usr/local/bin/frankenphp && \
514520 ([ -z "${NO_COMPRESS}" ] && upx --best /usr/local/bin/frankenphp || true) && \
515521 frankenphp version && \
0 commit comments