-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multistage docker build for powerstore
- Loading branch information
Showing
5 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
vendor/ | ||
cmd/*/bin/ | ||
|
||
csm-common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,28 @@ | ||
ARG BASEIMAGE | ||
|
||
# Build the sdk binary | ||
FROM golang:1.21 as builder | ||
|
||
# Set envirment variable | ||
ENV APP_NAME csm-metrics-powerstore | ||
ENV CMD_PATH cmd/metrics-powerstore/main.go | ||
|
||
# Copy application data into image | ||
COPY . /go/src/$APP_NAME | ||
WORKDIR /go/src/$APP_NAME | ||
|
||
# Build the binary | ||
RUN go install github.com/golang/mock/mockgen@v1.6.0 | ||
RUN go generate ./... | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o /go/src/service /go/src/$APP_NAME/$CMD_PATH | ||
|
||
# Build the sdk image | ||
FROM $BASEIMAGE as final | ||
LABEL vendor="Dell Inc." \ | ||
name="csm-metrics-powerstore" \ | ||
summary="Dell Container Storage Modules (CSM) for Observability - Metrics for PowerStore" \ | ||
description="Provides insight into storage usage and performance as it relates to the CSI (Container Storage Interface) Driver for Dell PowerStore" \ | ||
version="2.0.0" \ | ||
license="Apache-2.0" | ||
ARG SERVICE | ||
COPY $SERVICE/bin/service /service | ||
COPY --from=builder /go/src/service / | ||
ENTRYPOINT ["/service"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters