Skip to content

Commit 043c0ef

Browse files
Copilotchefgs
andauthored
Add explicit Go tarball validation in Docker install
Agent-Logs-Url: https://github.com/cloudengine-labs/devops_os/sessions/9b0c799a-f3ea-4137-ae78-1b58c5743fb7 Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
1 parent 427f42f commit 043c0ef

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ RUN if [ "$INSTALL_JS" = "true" ]; then \
104104
RUN if [ "$INSTALL_GO" = "true" ]; then \
105105
GO_DOWNLOAD_VERSION="${GO_VERSION}" \
106106
&& case "${GO_DOWNLOAD_VERSION}" in *.*.*) ;; *.*) GO_DOWNLOAD_VERSION="${GO_DOWNLOAD_VERSION}.0" ;; esac \
107-
&& curl -fsSLO "https://go.dev/dl/go${GO_DOWNLOAD_VERSION}.linux-amd64.tar.gz" \
108-
&& tar -C /usr/local -xzf "go${GO_DOWNLOAD_VERSION}.linux-amd64.tar.gz" \
109-
&& rm "go${GO_DOWNLOAD_VERSION}.linux-amd64.tar.gz" \
107+
&& GO_TARBALL="go${GO_DOWNLOAD_VERSION}.linux-amd64.tar.gz" \
108+
&& curl -fsSLO "https://go.dev/dl/${GO_TARBALL}" \
109+
&& test -s "${GO_TARBALL}" \
110+
&& tar -C /usr/local -xzf "${GO_TARBALL}" \
111+
&& rm "${GO_TARBALL}" \
110112
&& echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/bash.bashrc \
111113
&& echo "export PATH=$PATH:/root/go/bin" >> /etc/bash.bashrc \
112114
&& /usr/local/go/bin/go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \

0 commit comments

Comments
 (0)