-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 879 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 879 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
30
31
32
33
34
35
36
37
ARG BASE_IMAGE=gcr.io/distroless/static-debian12:nonroot
# Build stage
FROM golang:1.25-alpine AS builder
# Git commit passed from build machine (avoids installing git in container)
ARG GIT_COMMIT=unknown
# Install build dependencies
RUN apk add --no-cache make
WORKDIR /build
# Copy source code
COPY . .
# Tidy and verify Go module dependencies
RUN go mod tidy && go mod verify
# Build binary using make to include version, commit, and build date
RUN make build GIT_COMMIT=${GIT_COMMIT}
# Runtime stage
FROM ${BASE_IMAGE}
WORKDIR /app
# Copy binary from builder (make build outputs to bin/)
COPY --from=builder /build/bin/maestro-cli /app/maestro-cli
ENTRYPOINT ["/app/maestro-cli"]
LABEL name="maestro-cli" \
vendor="Red Hat" \
version="0.1.0" \
summary="HyperFleet Maestro CLI" \
description="Command-line interface for HyperFleet Maestro"