Add build infra

This commit is contained in:
2021-12-06 17:33:53 +00:00
parent cee9a58e4c
commit 7174c924b5
5 changed files with 75 additions and 6 deletions

View File

@@ -1,7 +1,10 @@
FROM alpine
FROM golang:1.17.4-alpine3.15 as build
WORKDIR /build
COPY . .
RUN go get -d -v .
RUN go build -v ./cmd/aaisp_exporter .
COPY cmd/aaisp_exporter/aaisp_exporter /usr/local/bin/aaisp_exporter
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/aaisp_exporter"]
FROM alpine:3.15.0
WORKDIR /service
COPY --from=build /build/aaisp_exporter .
ENTRYPOINT ["./aaisp_exporter"]%