Dockerfile 470 B

1234567891011121314
  1. FROM golang:1.21-bullseye AS builder
  2. RUN apt update && apt install -y libsystemd-dev
  3. WORKDIR /tmp/src
  4. COPY go.mod .
  5. COPY go.sum .
  6. RUN go mod download
  7. COPY . .
  8. ARG VERSION=unknown
  9. RUN CGO_ENABLED=1 go build -mod=readonly -ldflags "-X main.version=$VERSION" -o coroot-node-agent .
  10. FROM debian:bullseye
  11. RUN apt update && apt install -y ca-certificates && apt clean
  12. COPY --from=builder /tmp/src/coroot-node-agent /usr/bin/coroot-node-agent
  13. ENTRYPOINT ["coroot-node-agent"]