forked from datastax/zdm-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (30 loc) · 815 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
##########
# NOTE: When building this image, there is an assumption that you are in the top level directory of the repository.
# $ docker build . -f ./Dockerfile -t zdm-proxy
##########
FROM golang:1.19-bullseye AS builder
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
# Move to working directory /build
WORKDIR /build
COPY go.mod .
COPY go.sum .
COPY proxy ./proxy
COPY antlr ./antlr
RUN ls
# Build the application
RUN go build -o main ./proxy
# Move to /dist directory as the place for resulting binary folder
WORKDIR /dist
# Copy binary from /build to /dist
RUN cp /build/main .
# Build a small image
FROM alpine
COPY --from=builder /dist/main /
COPY LICENSE /
ENV ZDM_PROXY_LISTEN_ADDRESS="0.0.0.0"
ENV ZDM_METRICS_ADDRESS="0.0.0.0"
# Command to run
ENTRYPOINT ["/main"]