Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ common-deps:
.PHONY: update-go-deps
update-go-deps:
@echo ">> updating Go dependencies"
# GOTOOLCHAIN prevents go get from pulling deps that require a newer Go version.
@for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
# Prevent go get from pulling deps that require a newer Go version.
GOTOOLCHAIN=go$$($(GO) mod edit -json | jq -r .Go) $(GO) get $$m; \
done
$(GO) mod tidy
Expand Down Expand Up @@ -247,6 +247,7 @@ common-docker-repo-name:

.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
common-docker: $(BUILD_DOCKER_ARCHS)
# DOCKER_ARCHS holds promu architecture names, which are not OCI platform strings.
$(BUILD_DOCKER_ARCHS): common-docker-%:
@for variant in $(DOCKERFILE_VARIANTS_WITH_NAMES); do \
dockerfile=$${variant#*:}; \
Expand All @@ -255,10 +256,16 @@ $(BUILD_DOCKER_ARCHS): common-docker-%:
if [ "$*" = "armv7" ]; then \
distroless_arch="arm"; \
fi; \
arch="$*"; \
case "$$arch" in \
armv*) docker_platform="linux/arm/v$${arch#armv}";; \
*) docker_platform="linux/$$arch";; \
esac; \
if [ "$$dockerfile" = "Dockerfile" ]; then \
echo "Building default variant ($$variant_name) for linux-$* using $$dockerfile"; \
docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \
-f $$dockerfile \
--platform "$$docker_platform" \
--build-arg ARCH="$*" \
--build-arg OS="linux" \
--build-arg DISTROLESS_ARCH="$$distroless_arch" \
Expand All @@ -272,6 +279,7 @@ $(BUILD_DOCKER_ARCHS): common-docker-%:
echo "Building $$variant_name variant for linux-$* using $$dockerfile"; \
docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)-$$variant_name" \
-f $$dockerfile \
--platform "$$docker_platform" \
--build-arg ARCH="$*" \
--build-arg OS="linux" \
--build-arg DISTROLESS_ARCH="$$distroless_arch" \
Expand Down
Loading