-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a015b1c
commit 284e5e8
Showing
11 changed files
with
341 additions
and
560 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,19 @@ | ||
##@ shortcuts helpers | ||
|
||
.PHONY: build | ||
build: prereqs fmt lint vendors build ## Test and Build cli | ||
|
||
.PHONY: build-image | ||
build-image: image-build ## Build MULTIARCH_TARGETS images | ||
|
||
.PHONY: push-image | ||
push-image: image-push ## Push MULTIARCH_TARGETS images | ||
|
||
.PHONY: build-manifest | ||
build-manifest: manifest-build ## Build MULTIARCH_TARGETS manifest | ||
|
||
.PHONY: push-manifest | ||
push-manifest: manifest-push ## Push MULTIARCH_TARGETS manifest | ||
|
||
.PHONY: images | ||
images: image-build image-push manifest-build manifest-push ## Build and push MULTIARCH_TARGETS images and related manifest |
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 @@ | ||
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker | ||
ARG TARGETPLATFORM=linux/amd64 | ||
ARG BUILDPLATFORM=linux/amd64 | ||
ARG TARGETARCH=amd64 | ||
|
||
# Build the manager binary | ||
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21 as builder | ||
|
||
ARG TARGETARCH | ||
ARG TARGETPLATFORM | ||
ARG VERSION="unknown" | ||
|
||
WORKDIR /opt/app-root | ||
|
||
COPY cmd cmd | ||
COPY main.go main.go | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
COPY vendor/ vendor/ | ||
COPY Makefile Makefile | ||
COPY .mk/ .mk/ | ||
|
||
# Build | ||
RUN GOARCH=$TARGETARCH make compile | ||
|
||
# Create final image from minimal + built binary | ||
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:9.3 | ||
WORKDIR / | ||
COPY --from=builder /opt/app-root/build . | ||
RUN mkdir output | ||
RUN chown 65532 output | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/network-observability-cli"] |
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
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
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
Oops, something went wrong.