Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use go base image #41

Merged
merged 3 commits into from
Feb 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"
cache: false
- name: Checkout the code
uses: actions/[email protected]
Expand Down
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
Loading