-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 960 Bytes
/
Dockerfile
File metadata and controls
27 lines (19 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright Authors of Cilium
# SPDX-License-Identifier: Apache-2.0
ARG GOLANG_IMAGE=docker.io/library/golang:1.26.0@sha256:9edf71320ef8a791c4c33ec79f90496d641f306a91fb112d3d060d5c1cee4e20
ARG ALPINE_BASE_IMAGE=docker.io/library/alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659
FROM ${GOLANG_IMAGE} AS go-builder
WORKDIR /go/src/github.com/cilium/image-tools/images/tester/cst
# hadolint ignore=SC2215
RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/image-tools/images/tester \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg \
mkdir -p /out/bin && \
CGO_ENABLED=0 go build -tags netgo -ldflags '-s -w -extldflags "-static"' -o /out/bin/cst
FROM ${ALPINE_BASE_IMAGE} AS test
COPY --from=go-builder /out/bin /test/bin
COPY test /test
RUN /test/bin/cst -C /test
FROM scratch
LABEL maintainer="maintainer@cilium.io"
COPY --from=go-builder /out/bin /test/bin