Skip to content

Commit

Permalink
gotip
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jul 9, 2024
1 parent 7c086aa commit 3caf639
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
13 changes: 9 additions & 4 deletions alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 *.* ./
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
debug
frankenphp {
#worker ./index.php
worker ./index.php
}
}

Expand Down

0 comments on commit 3caf639

Please sign in to comment.