pass version string to docker build (#1313)

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
This commit is contained in:
Zbynek Roubalik 2020-11-04 12:58:18 +01:00 committed by GitHub
parent 58042db5be
commit 50bec808f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,8 @@
# Build the manager binary
FROM golang:1.15.3 as builder
ARG BUILD_VERSION
WORKDIR /workspace
# Copy the Go Modules manifests
@ -24,7 +26,7 @@ COPY pkg/ pkg/
COPY .git/ .git/
# Build
RUN make manager
RUN VERSION=${BUILD_VERSION} make manager
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details

View File

@ -1,6 +1,8 @@
# Build the manager binary
FROM golang:1.15.3 as builder
ARG BUILD_VERSION
WORKDIR /workspace
# Copy the Go Modules manifests
@ -26,7 +28,7 @@ COPY .git/ .git/
RUN mkdir -p /apiserver.local.config/certificates && chmod -R 777 /apiserver.local.config
# Build
RUN make adapter
RUN VERSION=${BUILD_VERSION} make adapter
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details

View File

@ -130,9 +130,9 @@ undeploy:
build: manifests set-version manager adapter
# Build the docker image
docker-build: build
docker build . -t ${IMAGE_CONTROLLER}
docker build -f Dockerfile.adapter -t ${IMAGE_ADAPTER} .
docker-build:
docker build . -t ${IMAGE_CONTROLLER} --build-arg BUILD_VERSION=${VERSION}
docker build -f Dockerfile.adapter -t ${IMAGE_ADAPTER} . --build-arg BUILD_VERSION=${VERSION}
# Build KEDA Operator binary
.PHONY: manager