mirror of
https://github.com/dragonheim/gagent.git
synced 2025-02-23 05:49:53 -08:00
refactor: reduced usage of fmt in favor of logs and string concatication. refactor: minor re-ordering of the data structures to reduce storage space required.
32 lines
826 B
Docker
32 lines
826 B
Docker
FROM nikatjef/golang:1.20 as builder
|
|
ARG SEMVER=${SEMVER:-0.0.8}
|
|
|
|
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.semVER=${SEMVER}" cmd/gagent/main.go
|
|
RUN strip /gagent/bin/gagent
|
|
|
|
FROM alpine:3.17
|
|
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
|