Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion controller/Containerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Build the manager binary
FROM registry.access.redhat.com/ubi10/go-toolset:1.26.3 AS builder
# Use --platform=$BUILDPLATFORM to run the Go compiler natively on the build host
# instead of under QEMU emulation. Go cross-compiles via GOOS/GOARCH (CGO_ENABLED=0).
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi10/go-toolset:1.26.3 AS builder
ARG TARGETOS
ARG TARGETARCH
ARG GIT_VERSION=unknown
Expand Down
4 changes: 3 additions & 1 deletion controller/Containerfile.operator
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Build the manager binary
FROM registry.access.redhat.com/ubi10/go-toolset:1.26.3 AS builder
# Use --platform=$BUILDPLATFORM to run the Go compiler natively on the build host
# instead of under QEMU emulation. Go cross-compiles via GOOS/GOARCH (CGO_ENABLED=0).
FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi10/go-toolset:1.26.3 AS builder
ARG TARGETOS
ARG TARGETARCH
ARG GIT_VERSION=unknown
Expand Down
5 changes: 1 addition & 4 deletions controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ docker-push: ## Push docker image with the manager.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Containerfile and insert --platform=${BUILDPLATFORM} into Containerfile.cross, and preserve the original Containerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Containerfile > Containerfile.cross
- $(CONTAINER_TOOL) buildx create --name jumpstarter-controller-builder
$(CONTAINER_TOOL) buildx use jumpstarter-controller-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) \
Expand All @@ -151,9 +149,8 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform
--build-arg BUILD_DATE=$(BUILD_DATE) \
--tag ${DOCKER_REPO}:${DOCKER_TAG} \
--tag ${DOCKER_REPO}:latest \
-f Containerfile.cross .
-f Containerfile .
- $(CONTAINER_TOOL) buildx rm jumpstarter-controller-builder
rm Containerfile.cross

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
Expand Down
5 changes: 1 addition & 4 deletions controller/deploy/operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,14 @@ docker-push: ## Push docker image with the manager.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Containerfile and insert --platform=${BUILDPLATFORM} into Containerfile.cross, and preserve the original Containerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' ../../Containerfile.operator > ../../Containerfile.operator.cross
- $(CONTAINER_TOOL) buildx create --name jumpstarter-operator-builder
$(CONTAINER_TOOL) buildx use jumpstarter-operator-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) \
--build-arg GIT_VERSION=$(GIT_VERSION) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
--tag ${IMG} -f ../../Containerfile.operator.cross ../../
--tag ${IMG} -f ../../Containerfile.operator ../../
- $(CONTAINER_TOOL) buildx rm jumpstarter-operator-builder
rm ../../Containerfile.operator.cross

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
Expand Down
Loading