Commit 0e03558
feat: Build csi-snapshot-metadata in Dockerfile builder stage
Refactors the Dockerfile to build the csi-snapshot-metadata binary
from source in the builder stage, similar to how grpc_health_probe
is obtained (via ADD from remote URL).
Changes to cmd/csi-snapshot-metadata/Dockerfile:
- Use golang:1.24-alpine as builder base (was alpine)
- Add TARGETOS and LDFLAGS build arguments
- Copy Go source files (go.mod, go.sum, cmd/, pkg/, client/, vendor/)
- Build binary in builder with cross-compilation support
- Copy built binary from builder (was copying from host filesystem)
- Remove obsolete binary ARG
Changes to release-tools/build.make:
- Replace --build-arg binary with --build-arg LDFLAGS
- Remove build-% dependency from push-multiarch-% target
(Docker now builds from source, eliminating duplicate compilation)
- Fix manifest error detection to handle both error formats:
- "manifest for ... not found" (docker.io)
- "manifest unknown" (ghcr.io, quay.io)
Benefits:
- Self-contained builds (no external Makefile dependency for Docker)
- True cross-compilation via Docker buildx
- Consistent approach (both binaries prepared in builder stage)
- Easier for contributors (just docker/podman build)
Tested with multiarch build to ghcr.io (amd64, arm64).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 09dcb69 commit 0e03558
File tree
2 files changed
+21
-7
lines changed- cmd/csi-snapshot-metadata
- release-tools
2 files changed
+21
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
6 | 21 | | |
7 | 22 | | |
8 | 23 | | |
9 | | - | |
10 | 24 | | |
11 | | - | |
| 25 | + | |
12 | 26 | | |
13 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
0 commit comments