forked from seata/seata-go-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (18 loc) · 852 Bytes
/
Dockerfile
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
FROM golang:1.12.1 as builder
ARG RELEASE=dev
ARG TARGET=seata
COPY . /go/src/seata.io/server
WORKDIR /go/src/seata.io/server
RUN make ${TARGET} 'release_version=${RELEASE}'
FROM alpine:latest
COPY --from=builder /go/src/seata.io/server/dist/${TARGET} /usr/local/bin/${TARGET}
COPY dist/ui/dist /app/seata/ui
RUN mkdir -p /var/${TARGET}/
RUN mkdir -p /var/lib/${TARGET}/
# Alpine Linux doesn't use pam, which means that there is no /etc/nsswitch.conf,
# but Golang relies on /etc/nsswitch.conf to check the order of DNS resolving
# (see https://github.com/golang/go/commit/9dee7771f561cf6aee081c0af6658cc81fac3918)
# To fix this we just create /etc/nsswitch.conf and add the following line:
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
# Define default command.
ENTRYPOINT ["/usr/local/bin/#TARGET#"]