-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
31 lines (25 loc) · 944 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
30
31
ARG BASEIMAGE
ARG GOIMAGE
# Build the sdk binary
FROM $GOIMAGE as builder
# Set envirment variable
ENV APP_NAME csm-metrics-powermax
ENV CMD_PATH cmd/metrics-powermax/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-powermax" \
summary="Dell Container Storage Modules (CSM) for Observability - Metrics for PowerMax" \
description="Provides insight into storage usage and performance as it relates to the CSI (Container Storage Interface) Driver for Dell PowerMax" \
version="2.0.0" \
license="Apache-2.0"
COPY /licenses /licenses
COPY --from=builder /go/src/service /
ENTRYPOINT ["/service"]