Skip to content

Commit

Permalink
fix: change way of generate build-tools image and way of check golang…
Browse files Browse the repository at this point in the history
… checksum

Signed-off-by: Xoán Mallón <[email protected]>
  • Loading branch information
xoanmm committed May 31, 2022
1 parent 3764fa7 commit 0f83d69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,9 @@ endef
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\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
Expand Down
8 changes: 5 additions & 3 deletions tools/build-tools.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 && \
Expand Down

0 comments on commit 0f83d69

Please sign in to comment.