update Dockerfile
This commit is contained in:
17
Dockerfile
17
Dockerfile
@ -1,12 +1,15 @@
|
|||||||
FROM alpine:latest
|
FROM golang:1.18-alpine3.16 AS base
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go mod tidy && go build -o nsq_exporter .
|
||||||
|
|
||||||
|
FROM alpine:3.16
|
||||||
|
|
||||||
EXPOSE 9117
|
EXPOSE 9117
|
||||||
|
|
||||||
ENV GOPATH /go
|
COPY --from=base /app/nsq_exporter /nsq_exporter
|
||||||
ENV APPPATH $GOPATH/src/github.com/lovoo/nsq_exporter
|
|
||||||
COPY . $APPPATH
|
|
||||||
RUN apk add --update -t build-deps go git mercurial libc-dev gcc libgcc \
|
|
||||||
&& cd $APPPATH && go get -d && go build -o /nsq_exporter \
|
|
||||||
&& apk del --purge build-deps && rm -rf $GOPATH
|
|
||||||
|
|
||||||
ENTRYPOINT ["/nsq_exporter"]
|
ENTRYPOINT ["/nsq_exporter"]
|
||||||
|
Reference in New Issue
Block a user