-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 708 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (26 loc) · 708 Bytes
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
FROM golang:1.19-alpine AS builder
WORKDIR /go/src/github.com/Max-Sum/fcbreak
ARG GOPROXY=https://goproxy.io,direct
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build ./cmd/client \
&& CGO_ENABLED=0 go build ./cmd/server
RUN ls
# Server Image
FROM scratch as server
WORKDIR /
COPY --from=builder \
/go/src/github.com/Max-Sum/fcbreak/server /server
EXPOSE 8707
ENTRYPOINT [ "/server" ]
CMD ["-l", ":8707"]
# Client Image
FROM scratch as client
WORKDIR /
COPY --from=builder \
/go/src/github.com/Max-Sum/fcbreak/client /client
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT [ "/client" ]
CMD ["-c", "config.ini", "-f"]