You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Dockerfile
+23-8Lines changed: 23 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -3,26 +3,41 @@
3
3
# Copyright Authors of Cilium
4
4
# SPDX-License-Identifier: Apache-2.0
5
5
6
-
FROM docker.io/library/golang:1.23.3-alpine3.19@sha256:f72297ec1cf35152ecfe7a4d692825fc608fea8f3d3fa8f986fda70184082823 AS builder
6
+
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.23.3-alpine3.19@sha256:f72297ec1cf35152ecfe7a4d692825fc608fea8f3d3fa8f986fda70184082823 AS base
7
+
RUN apk add --no-cache --update ca-certificates git make
7
8
WORKDIR /go/src/github.com/cilium/cilium-cli
8
-
RUN apk add --no-cache curl git make ca-certificates
9
+
COPY go.* .
10
+
RUN --mount=type=cache,target=/go/pkg/mod go mod download
9
11
COPY . .
10
-
RUN make
12
+
13
+
# xx is a helper for cross-compilation
14
+
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.5.0@sha256:0c6a569797744e45955f39d4f7538ac344bfb7ebf0a54006a0a4297b153ccf0f AS xx
15
+
16
+
FROM --platform=${BUILDPLATFORM} base AS builder
17
+
ARG TARGETPLATFORM
18
+
ARG TARGETARCH
19
+
COPY --link --from=xx / /
20
+
RUN --mount=type=cache,target=/root/.cache/go-build \
0 commit comments