-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
46 lines (35 loc) · 965 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# This Dockerfile builds topographer image based on Alpine Linux.
# This is minimal image as possible
#
# Please visit https://github.com/9seconds/topographer for the details.
###############################################################################
# BUILD STAGE
FROM golang:1.16-alpine AS build-env
ENV CGO_ENABLED=0
RUN set -x \
&& apk --update add \
bash \
ca-certificates \
git \
make
ADD . /app
WORKDIR /app
RUN set -x \
&& make clean \
&& git submodule update --init \
&& make -j 4 static-build
###############################################################################
# PACKAGE STAGE
FROM scratch
ENTRYPOINT ["/topographer"]
CMD ["-config", "/config.hjson"]
EXPOSE 80
COPY --from=build-env \
/etc/ssl/certs/ca-certificates.crt \
/etc/ssl/certs/ca-certificates.crt
COPY --from=build-env \
/app/topographer \
/topographer
COPY --from=build-env \
/app/example.config.hjson \
/config.hjson