Dockerfile: retry go install up to 5x with backoff — DNS to 192.168.0.1:53 flakes intermittently for proxy.golang.org
This commit is contained in:
parent
6cd599079b
commit
a1b3c72c8f
1 changed files with 6 additions and 2 deletions
|
|
@ -237,8 +237,12 @@ ENV PATH=/home/crafter/go/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.li
|
|||
|
||||
# 17. Go user tooling: govulncheck + staticcheck
|
||||
# ============================================================
|
||||
RUN go install golang.org/x/vuln/cmd/govulncheck@latest \
|
||||
&& go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
RUN for i in 1 2 3 4 5; do \
|
||||
go install golang.org/x/vuln/cmd/govulncheck@latest \
|
||||
&& go install honnef.co/go/tools/cmd/staticcheck@latest \
|
||||
&& break || { echo "go install attempt $i failed, sleeping $((i*10))s"; sleep $((i*10)); }; \
|
||||
done; \
|
||||
command -v govulncheck && command -v staticcheck || { echo "go install failed after 5 attempts"; exit 1; }
|
||||
|
||||
# Make GOPATH bin discoverable for the crafter user
|
||||
ENV PATH=/home/crafter/go/bin:$PATH \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue