From 0f83d6987a36c055601965654c3695ae35157f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xo=C3=A1n=20Mall=C3=B3n?= Date: Tue, 31 May 2022 23:15:00 +0200 Subject: [PATCH] fix: change way of generate build-tools image and way of check golang checksum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Xoán Mallón --- Makefile | 8 ++------ tools/build-tools.Dockerfile | 8 +++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index d3e1b488d06..21ab651de9c 100644 --- a/Makefile +++ b/Makefile @@ -305,13 +305,9 @@ endef help: ## Display this help. @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) -.PHONY: docker-build-tools -docker-build-tools: ## Build build-tools image - docker build -f tools/build-tools.Dockerfile -t $(IMAGE_BUILD_TOOLS) . - .PHONY: publish-build-tools -publish-build-tools: docker-build-tools ## Publish build-tools image - docker push $(IMAGE_BUILD_TOOLS) +publish-build-tools: ## Build and push multi-arch Docker image for build-tools. + docker buildx build --platform=${BUILD_PLATFORMS} -f tools/build-tools.Dockerfile -t ${IMAGE_BUILD_TOOLS} . .PHONY: docker-build-dev-containers docker-build-dev-containers: ## Build dev-containers image diff --git a/tools/build-tools.Dockerfile b/tools/build-tools.Dockerfile index 542496a84a4..cd31947dcce 100644 --- a/tools/build-tools.Dockerfile +++ b/tools/build-tools.Dockerfile @@ -30,11 +30,13 @@ RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent soft apt-get update &&\ apt-get install -y docker-ce-cli +ENV ARCH=$(dpkg --print-architecture) + # Install golang RUN GO_VERSION=1.17.9 && \ curl -LO https://golang.org/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz && \ - # go_sha256=9dacf782028fdfc79120576c872dee488b81257b1c48e9032d122cfdb379cca6 && \ - # echo "$go_sha256 go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" | sha256sum -c - && \ + ARCH=$(dpkg --print-architecture) && if [ ${ARCH} == "amd64" ]; then go_sha256="9dacf782028fdfc79120576c872dee488b81257b1c48e9032d122cfdb379cca6" ; elif [ ${ARCH} == "arm64" ]; then go_sha256="44dcdcd4f0fa6f83c15ef70b31580f1e3f95895c2f11a00e36c440c3554b6ad5" ; fi && \ + echo "$go_sha256 go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" | sha256sum -c - && \ tar -C /usr/local -xvzf go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz && \ rm -rf go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz @@ -65,7 +67,7 @@ ENV GOPATH=/go ENV PATH=${PATH}:${GOPATH}/bin # Install FOSSA tooling -RUN curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash +# RUN curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash # Install gh RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \