gagent/assets/docker/Dockerfile
James Wells 4717b49701
All checks were successful
G'Agent Scan, Build, and Test / scan (push) Successful in 1m36s
G'Agent Scan, Build, and Test / build_simple (push) Successful in 1m16s
G'Agent Scan, Build, and Test / test_simple (push) Successful in 15s
G'Agent Scan, Build, and Test / build_image (push) Successful in 1m30s
Version is not propagating on CI/CD build.
2024-12-26 18:26:41 -08:00

32 lines
830 B
Docker

FROM dragonheim/golang:1.23 as builder
ARG SEMVER=${SEMVER:-0.0.11}
WORKDIR /gagent
COPY . .
ARG GOOS=${GOOS:-linux}
# ARG GOARCH=${GOARCH:-amd64}
ARG CGO_ENABLED=1
RUN apk add --no-cache zeromq-dev build-base git
RUN go build -o /gagent/bin/gagent -ldflags "-X main.Version=${SEMVER}" cmd/gagent/main.go
RUN strip /gagent/bin/gagent
FROM alpine:3.20
ARG SEMVER
LABEL Name="G'Agent"
LABEL Maintainer="jwells@dragonheim.net"
LABEL License="MIT License"
LABEL version="${SEMVER}"
RUN apk add --no-cache zeromq && mkdir -p -m 0700 /etc/gagent
COPY --from=builder /gagent/assets/examples/gagent.hcl /etc/gagent/gagent.hcl
COPY --from=builder /gagent/bin/gagent /usr/bin/
# Router Client Worker Prometheus
EXPOSE 35570/tcp 35572/tcp 35571/tcp 9101/tcp
VOLUME /etc/gagent
CMD ["/usr/bin/gagent"]
HEALTHCHECK NONE