-
Notifications
You must be signed in to change notification settings - Fork 1
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
Multistage go build for docker image building #61
Changes from 4 commits
825c330
3b65bab
bc29fc4
101045e
c55c984
d4868d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
ARG BASEIMAGE | ||
ARG GOVERSION | ||
|
||
FROM $BASEIMAGE AS final | ||
COPY ./bin/vg-snapshotter . | ||
|
||
FROM golang:${GOVERSION} as builder | ||
RUN mkdir -p /go/src | ||
COPY ./ /go/src/ | ||
WORKDIR /go/src/ | ||
RUN CGO_ENABLED=0 \ | ||
make build | ||
|
||
# Final Stage | ||
FROM $BASEIMAGE AS final | ||
|
||
# Copy the binary from the builder stage | ||
|
||
COPY --from=builder /go/src/bin/vg-snapshotter . | ||
|
||
# Set entry point | ||
ENTRYPOINT ["/vg-snapshotter"] | ||
|
||
# Metadata labels | ||
LABEL vendor="Dell Inc." \ | ||
name="dellcsi-vg-snapshotter" \ | ||
summary="CSI VG Snapshotter for Dell EMC Powerflex" \ | ||
summary="CSI VG Snapshotter for Dell EMC PowerFlex" \ | ||
description="Dell Storage VolumeGroup Snapshot Controller for CSI" \ | ||
version="1.4.0" \ | ||
license="Apache-2.0" | ||
|
||
license="Apache-2.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,18 @@ DEFAULT_REGISTRY="dellemc" | |
DEFAULT_IMAGENAME="csi-volumegroup-snapshotter" | ||
DEFAULT_BUILDSTAGE="final" | ||
DEFAULT_IMAGETAG="1.4.0" | ||
DEFAULT_GOVERSION="1.21" | ||
|
||
# set the REGISTRY if needed | ||
ifeq ($(REGISTRY),) | ||
export REGISTRY="$(DEFAULT_REGISTRY)" | ||
endif | ||
|
||
# set the GOVERSION if needed | ||
ifeq ($(GOVERSION),) | ||
export GOVERSION="$(DEFAULT_GOVERSION)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KshitijaKakde Could you kindly expand the overrides-help segment intended for the help page display? As we're introducing a new argument, it is advisable to incorporate it into the current list. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
endif | ||
|
||
# set the IMAGENAME if needed | ||
ifeq ($(IMAGENAME),) | ||
export IMAGENAME="$(DEFAULT_IMAGENAME)" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KshitijaKakde Since this is being used by both driver i.e. powerstore and powerflex, Can we add PoweFlex/PowerStore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done