diff --git a/.ci/build b/.ci/build index f9948553d..31a5fbe65 100755 --- a/.ci/build +++ b/.ci/build @@ -42,21 +42,8 @@ cd "${SOURCE_PATH}" ############################################################################### -# If no LOCAL_BUILD environment variable is set, we configure the `go build` command -# to build for linux OS, amd64 architectures and without CGO enablement. -if [[ -z "$LOCAL_BUILD" ]]; then - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build \ - -a \ - -v \ - -mod=vendor \ - -o "${BINARY_PATH}/rel/machine-controller-manager" \ - cmd/machine-controller-manager/controller_manager.go - -# If the LOCAL_BUILD environment variable is set, we simply run `go build`. -else - GO111MODULE=on go build \ - -v \ - -mod=vendor \ - -o "${BINARY_PATH}/machine-controller-manager" \ - cmd/machine-controller-manager/controller_manager.go -fi +CGO_ENABLED=0 GO111MODULE=on go build \ + -v \ + -mod=vendor \ + -o "${BINARY_PATH}/machine-controller-manager" \ + cmd/machine-controller-manager/controller_manager.go \ No newline at end of file diff --git a/.ci/pipeline_definitions b/.ci/pipeline_definitions index 01a5e5ca8..4be325b5d 100644 --- a/.ci/pipeline_definitions +++ b/.ci/pipeline_definitions @@ -8,6 +8,10 @@ machine-controller-manager: 'inject-commit-hash' inject_effective_version: true publish: + oci-builder: docker-buildx + platforms: + - linux/amd64 + - linux/arm64 dockerimages: machine-controller-manager: inputs: diff --git a/Dockerfile b/Dockerfile index 6b70aadad..1976f1d14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,5 +15,5 @@ WORKDIR / ############# machine-controller-manager ############# FROM base AS machine-controller-manager -COPY --from=builder /go/src/github.com/gardener/machine-controller-manager/bin/rel/machine-controller-manager /machine-controller-manager +COPY --from=builder /go/src/github.com/gardener/machine-controller-manager/bin/machine-controller-manager /machine-controller-manager ENTRYPOINT ["/machine-controller-manager"] diff --git a/Makefile b/Makefile index 5d728f06e..6350fad94 100644 --- a/Makefile +++ b/Makefile @@ -95,12 +95,8 @@ revendor: build: @.ci/build -.PHONY: build-local -build-local: - @env LOCAL_BUILD=1 .ci/build - .PHONY: release -release: build build-local docker-image docker-login docker-push rename-binaries +release: build docker-image docker-login docker-push .PHONY: docker-image docker-image: @@ -115,16 +111,9 @@ docker-push: @if ! docker images $(IMAGE_REPOSITORY) | awk '{ print $$2 }' | grep -q -F $(IMAGE_TAG); then echo "$(IMAGE_REPOSITORY) version $(IMAGE_TAG) is not yet built. Please run 'make docker-images'"; false; fi @gcloud docker -- push $(IMAGE_REPOSITORY):$(IMAGE_TAG) -.PHONY: rename-binaries -rename-binaries: - @if [[ -f bin/machine-controller-manager ]]; then cp bin/machine-controller-manager machine-controller-manager-darwin-amd64; fi - @if [[ -f bin/rel/machine-controller-manager ]]; then cp bin/rel/machine-controller-manager machine-controller-manager-linux-amd64; fi - .PHONY: clean clean: @rm -rf bin/ - @rm -f *linux-amd64 - @rm -f *darwin-amd64 ##################################################################### # Rules for verification, formatting, linting, testing and cleaning #