Update Go to 1.17.8; tidy build image

Need to specify `-buster` otherwise libpcap gets unresolved symbols.

Add back a missing `&&` after installing packages, so temp files aren't
committed to the image.

Stop rebuilding various Go libraries since they are now cached
automatically for each different set of tags.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham
2022-03-14 18:04:53 +00:00
parent a774857ba2
commit 87988e5a31

View File

@@ -1,4 +1,4 @@
FROM golang:1.16.2 FROM golang:1.17.8-buster
ENV SCOPE_SKIP_UI_ASSETS true ENV SCOPE_SKIP_UI_ASSETS true
RUN set -eux; \ RUN set -eux; \
export arch_val="$(dpkg --print-architecture)"; \ export arch_val="$(dpkg --print-architecture)"; \
@@ -7,22 +7,14 @@ RUN set -eux; \
apt-get install -y libpcap-dev time file shellcheck git gcc-arm-linux-gnueabihf curl build-essential gcc-s390x-linux-gnu; \ apt-get install -y libpcap-dev time file shellcheck git gcc-arm-linux-gnueabihf curl build-essential gcc-s390x-linux-gnu; \
else \ else \
apt-get install -y libpcap-dev time file shellcheck git curl build-essential; \ apt-get install -y libpcap-dev time file shellcheck git curl build-essential; \
fi; \ fi && \
\
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN go clean -i net && \ RUN go get -tags netgo \
go install -tags netgo std && \
export arch_val="$(dpkg --print-architecture)"; \
if [ "$arch_val" != "ppc64el" ] && [ "$arch_val" != "s390x" ]; then \
go install -race -tags netgo std; \
fi; \
go get -tags netgo \
github.com/fzipp/gocyclo \ github.com/fzipp/gocyclo \
golang.org/x/lint/golint \ golang.org/x/lint/golint \
github.com/kisielk/errcheck \ github.com/kisielk/errcheck \
github.com/client9/misspell/cmd/misspell && \ github.com/client9/misspell/cmd/misspell && \
chmod a+wr --recursive /usr/local/go && \
rm -rf /go/pkg/ /go/src/ rm -rf /go/pkg/ /go/src/
# Only install shfmt on amd64, as the version v1.3.0 isn't supported for ppc64le # Only install shfmt on amd64, as the version v1.3.0 isn't supported for ppc64le