|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+###############################################################################
|
|
|
2
|
+# BUILD STAGE
|
|
|
3
|
+
|
|
|
4
|
+FROM golang:alpine
|
|
|
5
|
+
|
|
|
6
|
+RUN set -x \
|
|
|
7
|
+ && apk --no-cache --update add \
|
|
|
8
|
+ bash \
|
|
|
9
|
+ ca-certificates \
|
|
|
10
|
+ curl \
|
|
|
11
|
+ git \
|
|
|
12
|
+ make \
|
|
|
13
|
+ && update-ca-certificates
|
|
|
14
|
+
|
|
|
15
|
+ADD . /go/src/github.com/9seconds/mtg
|
|
|
16
|
+
|
|
|
17
|
+RUN set -x \
|
|
|
18
|
+ && cd /go/src/github.com/9seconds/mtg \
|
|
|
19
|
+ && make clean \
|
|
|
20
|
+ && make -j 4 static
|
|
|
21
|
+
|
|
|
22
|
+
|
|
|
23
|
+###############################################################################
|
|
|
24
|
+# PACKAGE STAGE
|
|
|
25
|
+
|
|
|
26
|
+FROM scratch
|
|
|
27
|
+
|
|
|
28
|
+ENTRYPOINT ["/usr/local/bin/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=3130
|
|
|
33
|
+EXPOSE 3128 3130
|
|
|
34
|
+
|
|
|
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 /usr/local/bin/mtg
|