2021-02-25 17:46:40 -08:00
|
|
|
FROM golang:1.16-alpine3.12 as builder
|
|
|
|
|
|
|
|
WORKDIR /gagent
|
|
|
|
COPY . .
|
2021-05-21 23:03:50 +00:00
|
|
|
|
|
|
|
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 gagent/main.go
|
|
|
|
RUN strip /gagent/bin/gagent
|
2021-02-25 17:46:40 -08:00
|
|
|
|
|
|
|
|
|
|
|
FROM alpine:3.12
|
2021-02-26 13:31:22 +00:00
|
|
|
LABEL Name="G'Agent"
|
|
|
|
LABEL Maintainer="jwells@dragonheim.net"
|
|
|
|
LABEL License="MIT License"
|
2021-05-21 23:03:50 +00:00
|
|
|
RUN apk add --no-cache zeromq && mkdir -p -m 0700 /etc/gagent
|
2021-02-25 17:46:40 -08:00
|
|
|
|
2021-05-21 23:03:50 +00:00
|
|
|
COPY --from=builder /gagent/examples/gagent.hcl /etc/gagent/gagent.hcl
|
2021-02-25 17:46:40 -08:00
|
|
|
COPY --from=builder /gagent/bin/gagent /usr/bin/
|
|
|
|
|
2021-05-21 23:03:50 +00:00
|
|
|
# Router Client Worker
|
|
|
|
EXPOSE 35570/tcp 35571/tcp 35572/tcp
|
2021-02-25 17:46:40 -08:00
|
|
|
VOLUME /etc/gagent
|
|
|
|
|
|
|
|
CMD ["/usr/bin/gagent"]
|