Skip to content

Commit 4c79f5f

Browse files
authored
chore: refactor Dockerfile to shorted iteration times (#93)
1 parent 4257d47 commit 4c79f5f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

go/helper-image/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ ARG TARGETARCH
66

77
ARG DELVE_VERSION=1.7.2
88

9-
RUN curl --location --output delve-$DELVE_VERSION.tar.gz https://github.com/go-delve/delve/archive/v$DELVE_VERSION.tar.gz \
10-
&& tar xzf delve-$DELVE_VERSION.tar.gz \
11-
&& mv delve-$DELVE_VERSION delve-source
12-
139
# Patch delve to change default for --only-same-user to false
1410
# Required as `kubectl port-forward` to dlv port is refused.
1511
# We must install patch(1) to apply the patch.
16-
COPY delve-*.patch .
1712
RUN apt-get update && apt-get install -y --no-install-recommends \
18-
patch \
19-
&& patch -p0 -d delve-source < delve-only-same-user.patch \
13+
patch
14+
RUN curl --location --output delve.tar.gz https://github.com/go-delve/delve/archive/v$DELVE_VERSION.tar.gz \
15+
&& tar xzf delve.tar.gz \
16+
&& mv delve-$DELVE_VERSION delve-source
17+
COPY delve-*.patch .
18+
RUN patch -p0 -d delve-source < delve-only-same-user.patch \
2019
&& patch -p0 -d delve-source < delve-pr2684.patch
2120

2221
# Produce an as-static-as-possible dlv binary to work on musl and glibc
23-
RUN cd delve-source && CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /go/dlv -ldflags '-s -w -extldflags "-static"' ./cmd/dlv/
22+
RUN cd delve-source \
23+
&& CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /go/dlv -ldflags '-s -w -extldflags "-static"' ./cmd/dlv/
2424

2525
# Now populate the duct-tape image with the language runtime debugging support files
2626
# The debian image is about 95MB bigger

0 commit comments

Comments
 (0)