feat: containerize agent

This commit is contained in:
Aarnav Tale 2025-01-15 10:17:30 +05:30
parent af919b2d34
commit 5bc313e5fe
No known key found for this signature in database

15
agent.Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM golang:1.23 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY agent/ ./agent
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags "-s -w" \
-o /app/hp_agent ./agent/cmd/hp_agent
FROM scratch
COPY --from=builder /app/hp_agent /hp_agent
ENTRYPOINT ["/hp_agent"]