Skip to content
Open
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
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Build the manager binary
FROM golang:1.15 as builder
ARG BUILDER_IMAGE_VERSION

FROM us.icr.io/armada/base/golang-builder:${BUILDER_IMAGE_VERSION} AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -16,7 +18,7 @@ COPY controllers/ controllers/
COPY internal/ internal/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
RUN GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ IMG ?= cloudoperators/ibmcloud-operator:${RELEASE_VERSION}
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd"

# https://github.ibm.com/alchemy-registry/base/
BUILDER_IMAGE_VERSION = 1.18.9-20230324

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand Down Expand Up @@ -152,7 +155,7 @@ generate: controller-gen

.PHONY: docker-build
docker-build:
docker build . -t ${IMG}
docker build --build-arg BUILDER_IMAGE_VERSION=${BUILDER_IMAGE_VERSION} . -t ${IMG}

.PHONY: docker-push
docker-push: docker-build
Expand Down