Skip to content

Commit

Permalink
update Makefile, Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ngergely6 committed Apr 25, 2023
1 parent b72f5f9 commit 1630fe9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit 1630fe9

Please sign in to comment.