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