File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- FROM golang:1.24.0@sha256:2b1cbf278ce05a2a310a3d695ebb176420117a8cfcfcc4e5e68a1bef5f6354da as buildbase
15+ FROM --platform=$BUILDPLATFORM google-go.pkg.dev/golang:1.24.0@sha256:f0ed15de6a2c1d1e595b8b3dfaf2dc6af66a38c1891591c4903bd3e1b2e76518 AS buildbase
16+ ARG TARGETOS
17+ ARG TARGETARCH
1618WORKDIR /app
1719COPY go.mod go.mod
1820COPY go.sum go.sum
21+ COPY vendor vendor
1922COPY cmd cmd
2023COPY pkg pkg
21- COPY vendor vendor
24+ COPY internal internal
2225
23- FROM buildbase as appbase
24- RUN CGO_ENABLED=1 GOEXPERIMENT=boringcrypto \
25- go build -tags boring -mod=vendor -o rule-evaluator cmd/rule-evaluator/*.go
26+ RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \
27+ apt install -y --no-install-recommends \
28+ gcc-aarch64-linux-gnu libc6-dev-arm64-cross; \
29+ CC=aarch64-linux-gnu-gcc; \
30+ fi && \
31+ GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=1 CC=${CC} \
32+ go build -tags boring -mod=vendor -o rule-evaluator cmd/rule-evaluator/*.go
2633
27- FROM gke. gcr.io/gke- distroless/libc:gke_distroless_20240307.00_p0@sha256:4f834e207f2721977094aeec4c9daee7032c5daec2083c0be97760f4306e4f88
28- COPY --from=appbase /app/rule-evaluator /bin/rule-evaluator
34+ FROM gcr.io/distroless/base-nossl-debian12:nonroot
35+ COPY --from=buildbase /app/rule-evaluator /bin/rule-evaluator
2936ENTRYPOINT ["/bin/rule-evaluator" ]
You can’t perform that action at this time.
0 commit comments