Files
HellreigN/agent/dockerfile
T
2026-04-04 05:15:10 +03:00

25 lines
477 B
Docker

FROM golang:1.26.1 as builder
WORKDIR /app
COPY proto/ proto/
COPY agent/ agent/
WORKDIR /app/agent
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go mod download && \
CGO_ENABLED=0 go build -ldflags "-s -w" -o /agent .
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
systemd \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /agent .
CMD ["./agent"]