-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
29 lines (24 loc) · 928 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
ARG BASEIMAGE
ARG GOIMAGE
# Build the sdk binary
FROM $GOIMAGE 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/[email protected]
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"
COPY --from=builder /go/src/service /
ENTRYPOINT ["/service"]