-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kornilios Kourtis <[email protected]>
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
ARG GOLANG_IMAGE=docker.io/library/golang:1.22.4@sha256:c2010b9c2342431a24a2e64e33d9eb2e484af49e72c820e200d332d214d5e61f | ||
ARG BASE_IMAGE=docker.io/library/alpine:3.20.0@sha256:77726ef6b57ddf65bb551896826ec38bc3e53f75cdde31354fbffb4f25238ebd | ||
|
||
# BUILDPLATFORM is an automatic platform ARG enabled by Docker BuildKit. | ||
# Represents the plataform where the build is happening, do not mix with | ||
# TARGETARCH | ||
FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} as builder | ||
# TARGETOS is an automatic platform ARG enabled by Docker BuildKit. | ||
ARG TARGETOS | ||
# TARGETARCH is an automatic platform ARG enabled by Docker BuildKit. | ||
ARG TARGETARCH | ||
ARG NOSTRIP | ||
WORKDIR /go/src/github.com/cilium/tetragon | ||
RUN --mount=type=bind,readwrite,target=/go/src/github.com/cilium/tetragon \ | ||
--mount=target=/root/.cache,type=cache \ | ||
--mount=target=/go/pkg/mod,type=cache \ | ||
make GOARCH=${TARGETARCH} tetragon-oci-hook tetragon-oci-hook-setup tetragon-nri-hook \ | ||
&& mkdir -p /out/${TARGETOS}/${TARGETARCH}/usr/bin \ | ||
&& mv ./contrib/tetragon-rthooks/tetragon-oci-hook /out/${TARGETOS}/${TARGETARCH}/usr/bin \ | ||
&& mv ./contrib/tetragon-rthooks/tetragon-oci-hook-setup /out/${TARGETOS}/${TARGETARCH}/usr/bin \ | ||
&& mv ./contrib/tetragon-rthooks/tetragon-nri-hook /out/${TARGETOS}/${TARGETARCH}/usr/bin | ||
|
||
FROM ${BASE_IMAGE} as image | ||
# TARGETOS is an automatic platform ARG enabled by Docker BuildKit. | ||
ARG TARGETOS | ||
# TARGETARCH is an automatic platform ARG enabled by Docker BuildKit. | ||
ARG TARGETARCH | ||
LABEL maintainer="[email protected]" | ||
COPY --from=builder /out/${TARGETOS}/${TARGETARCH}/usr/bin/tetragon-oci-hook /usr/bin/ | ||
COPY --from=builder /out/${TARGETOS}/${TARGETARCH}/usr/bin/tetragon-oci-hook-setup /usr/bin/ | ||
COPY --from=builder /out/${TARGETOS}/${TARGETARCH}/usr/bin/tetragon-nri-hook /usr/bin/ | ||
WORKDIR / |