Skip to content

Commit 782a639

Browse files
authored
Produce a static dlv binary to work on alpine and glibc (#35)
1 parent d4040f3 commit 782a639

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

go/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM golang:1.14.1 as delve
22
RUN curl --location --output delve-1.4.0.tar.gz https://github.com/go-delve/delve/archive/v1.4.0.tar.gz \
3-
&& tar xzf delve-1.4.0.tar.gz
4-
RUN cd delve-1.4.0/cmd/dlv && go install
3+
&& tar xzf delve-1.4.0.tar.gz
4+
# Produce an as-static-as-possible dlv binary to work on musl and glibc
5+
RUN cd delve-1.4.0 && CGO_ENABLED=0 go build -o /go/dlv -ldflags '-extldflags "-static"' ./cmd/dlv/
56

67
# Now populate the duct-tape image with the language runtime debugging support files
78
# The debian image is about 95MB bigger
@@ -10,4 +11,4 @@ FROM busybox
1011
COPY install.sh /
1112
CMD ["/bin/sh", "/install.sh"]
1213
WORKDIR /duct-tape
13-
COPY --from=delve /go/bin/dlv go/bin/
14+
COPY --from=delve /go/dlv go/bin/

0 commit comments

Comments
 (0)