-
Notifications
You must be signed in to change notification settings - Fork 3
/
debug.Dockerfile
40 lines (27 loc) · 1.04 KB
/
debug.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
# This is a compy from the dockerfile that adds support for debugging. It is used in the 3NodeTest to debug nodeB
# building the binary
FROM golang:1.22-buster as golang
LABEL maintainer="[email protected]"
WORKDIR /go/src/git.tu-berlin.de/mcc-fred/fred/
RUN apt update && apt install -y ca-certificates git && rm -rf /var/cache/apk/*
RUN update-ca-certificates
RUN go get github.com/go-delve/delve/cmd/dlv
# Make an extra layer for the installed packages so that they dont have to be downloaded everytime
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY cmd/frednode cmd/frednode
COPY pkg pkg
COPY proto proto
RUN CGO_ENABLED=0 go install -gcflags="all=-N -l" ./cmd/frednode/
# actual Docker image
FROM debian:buster
WORKDIR /
COPY --from=golang /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=golang /go/bin/frednode frednode
COPY --from=golang /go/bin/dlv dlv
EXPOSE 443
EXPOSE 5555
EXPOSE 40000
ENTRYPOINT ["./dlv"]
CMD ["--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "./frednode", "--"]