-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
40 lines (29 loc) · 790 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
# Authors:
# Simon Gerber <[email protected]>
#
# License:
# Copyright (c) 2019, VSHN AG, <[email protected]>
# Licensed under "BSD 3-Clause". See LICENSE file.
#####################
# STEP 1 build binary
#####################
FROM golang:1.20 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
WORKDIR /
COPY --from=builder /src/signalilo/signalilo /usr/local/bin/
EXPOSE 8888
ENTRYPOINT ["/usr/local/bin/signalilo"]