forked from vshn/signalilo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (28 loc) · 779 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
# Authors:
# Simon Gerber <simon.gerber@vshn.ch>
#
# License:
# Copyright (c) 2019, VSHN AG, <info@vshn.ch>
# Licensed under "BSD 3-Clause". See LICENSE file.
#####################
# STEP 1 build binary
#####################
FROM golang:1.14 as builder
ARG BINARY_VERSION
# Workdir must be outside of GOPATH because of go mod usage
WORKDIR /src/signalilo
# Download modules for leveraging docker build cache
COPY go.mod go.sum ./
RUN go mod download
# Add code
COPY . .
# Run tests and build Signalilo
RUN make test
RUN make build
############################
# STEP 2 build runtime image
############################
FROM gcr.io/distroless/static:nonroot
COPY --from=builder /src/signalilo/signalilo /usr/local/bin/
EXPOSE 8888
ENTRYPOINT ["/usr/local/bin/signalilo"]