Skip to content

Commit

Permalink
Use go base image
Browse files Browse the repository at this point in the history
  • Loading branch information
panigs7 committed Feb 19, 2024
1 parent 9643f56 commit 7f3aa21
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docker-files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#
# Dockerfile to build CSI Metadata Retriever sidecar
# some arguments that must be supplied
ARG GOVERSION
ARG GOIMAGE
ARG BASEIMAGE
# Stage to build the driver
FROM golang:${GOVERSION} as builder
FROM $GOIMAGE as builder

RUN mkdir -p /go/src
COPY ./ /go/src/
Expand Down
4 changes: 2 additions & 2 deletions docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ docker: download-csm-common
$(eval include csm-common.mk)
echo "Building: $(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH) RELNOTE $(RELNOTE)"
echo "$(DOCKER_FILE)"
$(BUILDER) build -f $(DOCKER_FILE) -t "$(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) .
$(BUILDER) build -f $(DOCKER_FILE) -t "$(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .

docker-no-cache: download-csm-common
$(eval include csm-common.mk)
echo "Building: $(REGISTRY)/$(IMAGENAME):$(MAJOR).$(MINOR).$(PATCH) RELNOTE $(RELNOTE)"
echo "$(DOCKER_FILE) --no-cache"
$(BUILDER) build --no-cache --pull -f $(DOCKER_FILE) -t "$(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) .
$(BUILDER) build --no-cache --pull -f $(DOCKER_FILE) -t "$(REGISTRY)/$(IMAGENAME):v$(MAJOR).$(MINOR).$(PATCH)$(RELNOTE)" --build-arg BASEIMAGE=$(DEFAULT_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) .


push:
Expand Down
12 changes: 6 additions & 6 deletions overrides.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@


# DEFAULT values
DEFAULT_GOVERSION="1.21"
DEFAULT_GOIMAGE=$(shell sed -En 's/^go (.*)$$/\1/p' go.mod)
DEFAULT_REGISTRY="dellemc"
DEFAULT_IMAGENAME="csi-metadata-retriever"


# set the GOVERSION if needed
ifeq ($(GOVERSION),)
export GOVERSION="$(DEFAULT_GOVERSION)"
# set the GOIMAGE if needed
ifeq ($(GOIMAGE),)
export GOIMAGE="$(DEFAULT_GOIMAGE)"
endif

# set the REGISTRY if needed
Expand Down Expand Up @@ -67,8 +67,8 @@ overrides-help:
@echo
@echo "The following environment variables can be set to control the build"
@echo
@echo "GOVERSION - The version of Go to build with, default is: $(DEFAULT_GOVERSION)"
@echo " Current setting is: $(GOVERSION)"
@echo "GOIMAGE - The version of Go to build with, default is: $(DEFAULT_GOIMAGE)"
@echo " Current setting is: $(GOIMAGE)"
@echo "REGISTRY - The registry to push images to, default is: $(DEFAULT_REGISTRY)"
@echo " Current setting is: $(REGISTRY)"
@echo "IMAGENAME - The image name to be built, defaut is: $(DEFAULT_IMAGENAME)"
Expand Down

0 comments on commit 7f3aa21

Please sign in to comment.