Dockerfile 512 B

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