File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Build the manager binary
2
- FROM golang:1.19 as builder
2
+ FROM --platform=$BUILDPLATFORM golang:1.19 as builder
3
3
4
4
WORKDIR /workspace
5
5
# Copy the Go Modules manifests
@@ -17,7 +17,13 @@ COPY internal/ internal/
17
17
COPY rabbitmqclient/ rabbitmqclient/
18
18
19
19
# Build
20
- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -tags timetzdata -o manager main.go
20
+ ARG TARGETOS
21
+ ARG TARGETARCH
22
+ ENV GOOS $TARGETOS
23
+ ENV GOARCH $TARGETARCH
24
+
25
+ # Build
26
+ RUN CGO_ENABLED=0 GO111MODULE=on go build -a -tags timetzdata -o manager main.go
21
27
22
28
# ---------------------------------------
23
29
FROM alpine:latest as etc-builder
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ deploy-dev: check-env-docker-credentials cmctl docker-build-dev manifests deploy
106
106
107
107
# Load operator image and deploy operator into current KinD cluster
108
108
deploy-kind : manifests cmctl deploy-rbac
109
- $(BUILD_KIT ) build --build-arg=GIT_COMMIT=$(GIT_COMMIT ) -t $(DOCKER_REGISTRY_SERVER ) /$(OPERATOR_IMAGE ) :$(GIT_COMMIT ) .
109
+ $(BUILD_KIT ) buildx build --build-arg=GIT_COMMIT=$(GIT_COMMIT ) -t $(DOCKER_REGISTRY_SERVER ) /$(OPERATOR_IMAGE ) :$(GIT_COMMIT ) .
110
110
kind load docker-image $(DOCKER_REGISTRY_SERVER ) /$(OPERATOR_IMAGE ) :$(GIT_COMMIT )
111
111
$(CMCTL ) check api --wait=2m
112
112
kustomize build config/default/overlays/kind | sed ' s@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' | kubectl apply -f -
@@ -160,7 +160,7 @@ ifndef DOCKER_REGISTRY_SECRET
160
160
endif
161
161
162
162
docker-build-dev : check-env-docker-repo git-commit-sha
163
- $(BUILD_KIT ) build --build-arg=GIT_COMMIT=$(GIT_COMMIT ) -t $(DOCKER_REGISTRY_SERVER ) /$(OPERATOR_IMAGE ) :$(GIT_COMMIT ) .
163
+ $(BUILD_KIT ) buildx build --build-arg=GIT_COMMIT=$(GIT_COMMIT ) -t $(DOCKER_REGISTRY_SERVER ) /$(OPERATOR_IMAGE ) :$(GIT_COMMIT ) .
164
164
$(BUILD_KIT ) push $(DOCKER_REGISTRY_SERVER ) /$(OPERATOR_IMAGE ) :$(GIT_COMMIT )
165
165
166
166
docker-registry-secret : check-env-docker-credentials operator-namespace
You can’t perform that action at this time.
0 commit comments