forked from wfxiang08/micro
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (22 loc) · 785 Bytes
/
Dockerfile
File metadata and controls
34 lines (22 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM alpine:latest as builder
ENV GOOS linux
ENV GOARCH amd64
RUN apk --no-cache add make git go gcc libtool musl-dev
# Configure Go
ENV GOROOT /usr/lib/go
ENV GOPATH /go
ENV PATH /go/bin:$PATH
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
WORKDIR /go/build/micro
COPY . .
COPY --from=localhost:32000/go-micro:dkozlov /go/build/go-micro go-micro
COPY --from=localhost:32000/nakama-go:dkozlov /go/build/nakama-go nakama-go
COPY --from=localhost:32000/nakama-apigrpc:dkozlov /go/build/nakama-apigrpc apigrpc
RUN go mod download
RUN make
FROM alpine:latest
RUN apk add ca-certificates && \
rm -rf /var/cache/apk/* /tmp/* && \
[ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
COPY --from=builder /go/build/micro/micro micro
ENTRYPOINT ["/micro"]