forked from shapeblue/cloudstack-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 761 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 761 Bytes
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
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
ARG LDFLAGS
WORKDIR /workspace
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags "${LDFLAGS}" -o cloudstack-csi-sc-syncer ./cmd/cloudstack-csi-sc-syncer
FROM alpine:3.18
LABEL \
org.opencontainers.image.description="CloudStack disk offering to Kubernetes storage class syncer" \
org.opencontainers.image.source="https://github.com/cloudstack/cloudstack-csi-driver/"
RUN apk add --no-cache ca-certificates
COPY --from=builder /workspace/cloudstack-csi-sc-syncer /cloudstack-csi-sc-syncer
ENTRYPOINT ["/cloudstack-csi-sc-syncer"]