Skip to content

Commit 48fb770

Browse files
pleshakovamimimor
authored andcommitted
Avoid unnecessary build of NGF (nginx#1681)
Problem: When building an NGF image, building NGF binary will always happen, even if it's not needed (Docker build target is not local) Solution: Fix it by adding a stage for a container that holds CA certs. Introduced in 799ea76 Closes nginx#1680
1 parent 7de2818 commit 48fb770

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ RUN go mod download
99
COPY . /go/src/github.com/nginxinc/nginx-gateway-fabric
1010
RUN make build
1111

12+
FROM golang:1.22 as ca-certs-provider
13+
1214
FROM alpine:3.19 as capabilizer
1315
RUN apk add --no-cache libcap
1416

@@ -28,7 +30,7 @@ RUN setcap 'cap_kill=+ep' /usr/bin/gateway
2830
FROM scratch as common
2931
# CA certs are needed for telemetry report and NGINX Plus usage report features, so that
3032
# NGF can verify the server's certificate.
31-
COPY --from=builder --link /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
33+
COPY --from=ca-certs-provider --link /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
3234
USER 102:1001
3335
ARG BUILD_AGENT
3436
ENV BUILD_AGENT=${BUILD_AGENT}

0 commit comments

Comments
 (0)