-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (21 loc) · 734 Bytes
/
Dockerfile
File metadata and controls
33 lines (21 loc) · 734 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
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.9.0 AS xx
FROM --platform=$BUILDPLATFORM golang:1.26.2-trixie AS builder
COPY --from=xx / /
WORKDIR /usr/src/app
COPY go.mod go.sum *.go ./
COPY cmd ./cmd
COPY internal ./internal
ARG PROJECT_VERSION
RUN test -n "${PROJECT_VERSION}"
ARG TARGETPLATFORM
ENV CGO_ENABLED=0
RUN xx-go build -ldflags "-X main.projectVersion=${PROJECT_VERSION}" -o bin/ -v ./... && \
xx-verify bin/*
# hadolint ignore=DL3006
FROM gcr.io/distroless/static-debian13
COPY --from=builder /usr/src/app/bin/* /usr/local/bin/
HEALTHCHECK CMD ["/usr/local/bin/healthcheck"]
EXPOSE 2375
USER nonroot
CMD ["/usr/local/bin/docker-socket-proxy", "-api-listen", "0.0.0.0:2375"]