-
Notifications
You must be signed in to change notification settings - Fork 213
/
Dockerfile
40 lines (25 loc) · 902 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
ARG BASE_IMAGE=scratch
# --------------------- dev (build) image --------------------- #
FROM golang:1.14-alpine as builder
RUN apk add git
RUN apk add make
RUN mkdir -p /opt/gobetween
WORKDIR /opt/gobetween
RUN mkdir ./src
COPY ./src/go.mod ./src/go.mod
COPY ./src/go.sum ./src/go.sum
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN make build-static
# --------------------- final image --------------------- #
FROM $BASE_IMAGE
WORKDIR /
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /opt/gobetween/bin/gobetween .
CMD ["/gobetween", "-c", "/etc/gobetween/conf/gobetween.toml"]
LABEL org.label-schema.vendor="gobetween" \
org.label-schema.url="http://gobetween.io" \
org.label-schema.name="gobetween" \
org.label-schema.description="Modern & minimalistic load balancer for the Сloud era"