diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 22a5c4bf9..62cf6d640 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -207,7 +207,7 @@ jobs: run: | docker run --platform=${{ matrix.platform }} --rm \ "$(jq -r '."builder-${{ matrix.variant }}"."containerimage.config.digest"' <<< "${METADATA}")" \ - sh -c 'go test ${{ matrix.race }} -v ./... && cd caddy && go test ${{ matrix.race }} -v ./...' + sh -c 'gotip test ${{ matrix.race }} -v ./... && cd caddy && gotip test ${{ matrix.race }} -v ./...' env: METADATA: ${{ steps.build.outputs.metadata }} # Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/ diff --git a/alpine.Dockerfile b/alpine.Dockerfile index 114d8ed1c..d28e98f6c 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -64,16 +64,21 @@ RUN apk add --no-cache --virtual .build-deps \ openssl-dev \ readline-dev \ sqlite-dev \ - upx + upx \ + # Needed by gotip + git \ + bash + +RUN GOBIN=/usr/local/go/bin go install golang.org/dl/gotip@latest && (yes | gotip download 585817) WORKDIR /go/src/app COPY --link go.mod go.sum ./ -RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get +RUN gotip mod graph | awk '{if ($1 !~ "@") print $2}' | xargs gotip get WORKDIR /go/src/app/caddy COPY caddy/go.mod caddy/go.sum ./ -RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get +RUN gotip mod graph | awk '{if ($1 !~ "@") print $2}' | xargs gotip get WORKDIR /go/src/app COPY --link *.* ./ @@ -86,7 +91,7 @@ COPY --link testdata testdata ENV CGO_LDFLAGS="-lssl -lcrypto -lreadline -largon2 -lcurl -lonig -lz $PHP_LDFLAGS" CGO_CFLAGS="-DFRANKENPHP_VERSION=$FRANKENPHP_VERSION $PHP_CFLAGS" CGO_CPPFLAGS=$PHP_CPPFLAGS WORKDIR /go/src/app/caddy/frankenphp -RUN GOBIN=/usr/local/bin go install -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy'" && \ +RUN GOBIN=/usr/local/bin gotip install -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy'" && \ setcap cap_net_bind_service=+ep /usr/local/bin/frankenphp && \ upx --best /usr/local/bin/frankenphp && \ frankenphp version diff --git a/testdata/Caddyfile b/testdata/Caddyfile index 03f772dec..e052c58de 100644 --- a/testdata/Caddyfile +++ b/testdata/Caddyfile @@ -1,7 +1,7 @@ { debug frankenphp { - #worker ./index.php + worker ./index.php } }