|
|
@@ -1,7 +1,7 @@
|
|
1
|
1
|
###############################################################################
|
|
2
|
2
|
# BUILD STAGE
|
|
3
|
3
|
|
|
4
|
|
-FROM golang:1.14-alpine
|
|
|
4
|
+FROM golang:1.14-alpine AS build
|
|
5
|
5
|
|
|
6
|
6
|
RUN set -x \
|
|
7
|
7
|
&& apk --no-cache --update add \
|
|
|
@@ -13,9 +13,9 @@ RUN set -x \
|
|
13
|
13
|
upx
|
|
14
|
14
|
|
|
15
|
15
|
COPY . /go/src/github.com/9seconds/mtg/
|
|
|
16
|
+WORKDIR /go/src/github.com/9seconds/mtg
|
|
16
|
17
|
|
|
17
|
18
|
RUN set -x \
|
|
18
|
|
- && cd /go/src/github.com/9seconds/mtg \
|
|
19
|
19
|
&& make -j 4 static \
|
|
20
|
20
|
&& upx --ultra-brute -qq ./mtg
|
|
21
|
21
|
|
|
|
@@ -26,11 +26,9 @@ RUN set -x \
|
|
26
|
26
|
FROM scratch
|
|
27
|
27
|
|
|
28
|
28
|
ENTRYPOINT ["/mtg"]
|
|
29
|
|
-ENV MTG_IP=0.0.0.0 \
|
|
30
|
|
- MTG_PORT=3128 \
|
|
31
|
|
- MTG_STATS_IP=0.0.0.0 \
|
|
32
|
|
- MTG_STATS_PORT=3129
|
|
|
29
|
+ENV MTG_BIND=0.0.0.0:3128 \
|
|
|
30
|
+ MTG_STATS_BIND=0.0.0.0:3129
|
|
33
|
31
|
EXPOSE 3128 3129
|
|
34
|
32
|
|
|
35
|
|
-COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
36
|
|
-COPY --from=0 /go/src/github.com/9seconds/mtg/mtg /mtg
|
|
|
33
|
+COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
34
|
+COPY --from=build /go/src/github.com/9seconds/mtg/mtg /mtg
|