-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (42 loc) · 1.2 KB
/
Copy pathDockerfile
File metadata and controls
53 lines (42 loc) · 1.2 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Build stage
FROM --platform=$BUILDPLATFORM golang:1.26.5-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
# Version information - passed from CI/CD or Makefile
ARG VERSION=dev
ARG GIT_COMMIT=unknown
ARG BUILD_DATE=unknown
WORKDIR /workspace
# Install build dependencies
RUN apk add --no-cache make git
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the driver for target platform with version info
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
VERSION=${VERSION} GIT_COMMIT=${GIT_COMMIT} BUILD_DATE=${BUILD_DATE} \
make build
# Final stage - use distroless or minimal base to avoid trigger issues
FROM alpine:3.24
# Install runtime dependencies
# Note: apk exit code 4 means trigger scripts failed but packages are installed (expected under QEMU emulation)
RUN apk add --no-cache \
ca-certificates \
nfs-utils \
e2fsprogs \
e2fsprogs-extra \
xfsprogs \
xfsprogs-extra \
blkid \
util-linux \
eudev \
nvme-cli \
open-iscsi \
cifs-utils \
|| [ $? -eq 4 ]
# Copy the driver binary
COPY --from=builder /workspace/bin/tns-csi-driver /usr/local/bin/
# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/tns-csi-driver"]