2019-02-26 15:59:40 +03:00
|
|
|
FROM ubuntu as builder
|
|
|
|
|
|
|
|
RUN apt-get update &&\
|
|
|
|
apt-get install -y software-properties-common git &&\
|
|
|
|
add-apt-repository ppa:longsleep/golang-backports &&\
|
|
|
|
apt-get update &&\
|
|
|
|
apt-get install -y golang-go
|
|
|
|
|
2019-03-22 14:36:53 +03:00
|
|
|
VOLUME /root/go
|
2019-02-26 15:59:40 +03:00
|
|
|
COPY ./ /server
|
2019-03-29 13:06:49 +03:00
|
|
|
RUN cd /server &&\
|
|
|
|
go generate &&\
|
2019-03-29 21:40:30 +03:00
|
|
|
go test ./... &&\
|
|
|
|
CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static -X mapserver/app.Version=docker"
|
2019-02-26 15:59:40 +03:00
|
|
|
|
2019-02-27 17:50:12 +03:00
|
|
|
FROM alpine:latest
|
2019-02-26 15:59:40 +03:00
|
|
|
RUN apk --no-cache add ca-certificates
|
|
|
|
WORKDIR /app
|
2019-03-29 13:09:37 +03:00
|
|
|
COPY --from=builder /server/mapserver /bin/mapserver
|
2019-02-26 15:59:40 +03:00
|
|
|
|
2019-02-27 17:50:12 +03:00
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["/bin/mapserver"]
|