File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 11FROM golang:1.25.4 AS build-env
22WORKDIR /usr/local/go/src/github.com/SpectoLabs/hoverfly
33COPY . /usr/local/go/src/github.com/SpectoLabs/hoverfly
4- RUN cd core/cmd/hoverfly && CGO_ENABLED=0 GOOS=linux go install -ldflags "-s -w"
54
6- FROM alpine:latest
7- RUN apk --no-cache add ca-certificates
5+ # Support multi-arch builds with buildx by honoring TARGETOS/TARGETARCH
6+ ARG TARGETOS=linux
7+ ARG TARGETARCH
8+ RUN cd core/cmd/hoverfly \
9+ && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
10+ go install -ldflags "-s -w"
11+
12+ # Final minimal image based on Alpine, without running apk to avoid QEMU trigger issues
13+ FROM alpine:3.20
14+ # Provide CA certificates by copying from the builder (PEM bundle is arch-independent)
15+ COPY --from=build-env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
16+ # Copy the statically linked hoverfly binary
817COPY --from=build-env /usr/local/go/bin/hoverfly /bin/hoverfly
9- ENTRYPOINT ["/bin/hoverfly" , "-listen-on-host=0.0.0.0" ]
10- CMD ["" ]
1118
19+ ENTRYPOINT ["/bin/hoverfly" , "-listen-on-host=0.0.0.0" ]
1220EXPOSE 8500 8888
You can’t perform that action at this time.
0 commit comments