mirror of
https://github.com/status-im/matterbridge.git
synced 2025-01-20 11:09:02 +00:00
improve the Dockerfile
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
768539255a
commit
4be225c388
29
Dockerfile
29
Dockerfile
@ -1,11 +1,22 @@
|
||||
FROM alpine:latest
|
||||
ENTRYPOINT ["/bin/matterbridge"]
|
||||
FROM alpine:latest AS builder
|
||||
|
||||
ENV CGOENABLE 1
|
||||
ENV GOPATH /go
|
||||
ENV GO111MODULE on
|
||||
|
||||
RUN apk update && apk add go git gcc musl-dev linux-headers
|
||||
|
||||
COPY . /go/src/github.com/42wim/matterbridge
|
||||
RUN apk update && apk add go git gcc musl-dev ca-certificates \
|
||||
&& cd /go/src/github.com/42wim/matterbridge \
|
||||
&& export GOPATH=/go \
|
||||
&& go get \
|
||||
&& go build -x -ldflags "-X main.githash=$(git log --pretty=format:'%h' -n 1)" -o /bin/matterbridge \
|
||||
&& rm -rf /go \
|
||||
&& apk del --purge git go gcc musl-dev
|
||||
|
||||
WORKDIR /go/src/github.com/42wim/matterbridge
|
||||
|
||||
RUN go get
|
||||
RUN go build -x -ldflags "-X main.githash=$(git log --pretty=format:'%h' -n 1)" -o /bin/matterbridge
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk update && apk add ca-certificates
|
||||
|
||||
COPY --from=builder /bin/matterbridge /bin/matterbridge
|
||||
|
||||
ENTRYPOINT ["/bin/matterbridge"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user