-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.multiarch
More file actions
34 lines (27 loc) · 913 Bytes
/
Dockerfile.multiarch
File metadata and controls
34 lines (27 loc) · 913 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
# Multi-stage build for multi-arch support
FROM golang:1.21 AS builder
ARG TARGETOS=linux
ARG TARGETARCH
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -o compliance-cli ./cmd/deploy
# Final image
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
# Install additional tools
RUN apt-get update && apt-get install -y \
jq \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install yq (multi-arch binary)
RUN ARCH=$(dpkg --print-architecture) && \
curl -L https://github.com/mikefarah/yq/releases/download/v4.40.5/yq_linux_${ARCH} -o /usr/local/bin/yq && \
chmod +x /usr/local/bin/yq
# Copy the compliance-cli binary from builder
COPY --from=builder /build/compliance-cli /usr/local/bin/compliance-cli
RUN chmod +x /usr/local/bin/compliance-cli
WORKDIR /workspace
ENTRYPOINT ["/bin/bash"]