feat: add cap for supporting dlv debug

This commit is contained in:
wencaiwulue
2023-02-20 21:38:33 +08:00
parent 85405c1a0f
commit 9c73aabcce
5 changed files with 16 additions and 6 deletions

7
build/dlv.Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM golang:1.19 as delve
RUN curl --location --output delve-1.20.1.tar.gz https://github.com/go-delve/delve/archive/v1.20.1.tar.gz \
&& tar xzf delve-1.20.1.tar.gz
RUN cd delve-1.20.1 && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /go/dlv -ldflags '-extldflags "-static"' ./cmd/dlv/
FROM busybox
WORKDIR /duct-tape
COPY --from=delve /go/dlv go/bin/