diff --git a/Makefile b/Makefile index 4382891bbc6..7af029d1a51 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ JAEGER_IMPORT_PATH = github.com/jaegertracing/jaeger # PLATFORMS is a list of all supported platforms PLATFORMS="linux/amd64,linux/arm64,linux/s390x,linux/ppc64le,darwin/amd64,darwin/arm64,windows/amd64" +LINUX_PLATFORMS=$(shell echo "$(PLATFORMS)" | tr ',' '\n' | grep linux | tr '\n' ',' | sed 's/,$$/\n/') # SRC_ROOT is the top of the source tree. SRC_ROOT := $(shell git rev-parse --show-toplevel) @@ -69,7 +70,6 @@ IMPORT_LOG=.import.log COLORIZE ?= | $(SED) 's/PASS/✅ PASS/g' | $(SED) 's/FAIL/❌ FAIL/g' | $(SED) 's/SKIP/🔕 SKIP/g' # import other Makefiles after the variables are defined -include docker/Makefile include Makefile.BuildBinaries.mk include Makefile.BuildInfo.mk include Makefile.Crossdock.mk @@ -99,7 +99,7 @@ echo-platforms: .PHONY: echo-linux-platforms echo-linux-platforms: - @echo "$(PLATFORMS)" | tr ',' '\n' | grep linux | tr '\n' ',' | sed 's/,$$/\n/' + @echo "$(LINUX_PLATFORMS)" .PHONY: echo-all-pkgs echo-all-pkgs: diff --git a/Makefile.Docker.mk b/Makefile.Docker.mk index d43f63bdef9..3c067f03f37 100644 --- a/Makefile.Docker.mk +++ b/Makefile.Docker.mk @@ -1,9 +1,38 @@ # Copyright (c) 2023 The Jaeger Authors. # SPDX-License-Identifier: Apache-2.0 -# These DOCKER_xxx vars are used when building Docker images. -DOCKER_NAMESPACE?=jaegertracing -DOCKER_TAG?=latest +DOCKER_NAMESPACE ?= jaegertracing +DOCKER_TAG ?= latest +DOCKER_REGISTRY ?= localhost:5000 +BASE_IMAGE ?= $(DOCKER_REGISTRY)/baseimg_alpine:latest +DEBUG_IMAGE ?= $(DOCKER_REGISTRY)/debugimg_alpine:latest + +create-baseimg-debugimg: create-baseimg create-debugimg + +create-baseimg: prepare-docker-buildx + docker buildx build -t $(BASE_IMAGE) --push \ + --platform=$(LINUX_PLATFORMS) \ + docker/base + +create-debugimg: prepare-docker-buildx + docker buildx build -t $(DEBUG_IMAGE) --push \ + --platform=$(LINUX_PLATFORMS) \ + docker/debug + +create-fake-debugimg: prepare-docker-buildx + docker buildx build -t $(DEBUG_IMAGE) --push \ + --platform=$(LINUX_PLATFORMS) \ + docker/base + +.PHONY: prepare-docker-buildx +prepare-docker-buildx: + docker buildx inspect jaeger-build > /dev/null || docker buildx create --use --name=jaeger-build --buildkitd-flags="--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host" --driver-opt="network=host" + docker inspect registry > /dev/null || docker run --rm -d -p 5000:5000 --name registry registry:2 + +.PHONY: clean-docker-buildx +clean-docker-buildx: + docker buildx rm jaeger-build + docker rm -f registry .PHONY: docker-hotrod docker-hotrod: diff --git a/docker/Makefile b/docker/Makefile deleted file mode 100644 index 777085d489b..00000000000 --- a/docker/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2024 The Jaeger Authors. -# SPDX-License-Identifier: Apache-2.0 - -VERSION := 1.0.0 - -DOCKER_REGISTRY ?= localhost:5000 -BASE_IMAGE ?= $(DOCKER_REGISTRY)/baseimg_alpine:latest -DEBUG_IMAGE ?= $(DOCKER_REGISTRY)/debugimg_alpine:latest -PLATFORMS ?= linux/amd64,linux/s390x,linux/ppc64le,linux/arm64 - -create-baseimg-debugimg: create-baseimg create-debugimg - -create-baseimg: prepare-docker-buildx - docker buildx build -t $(BASE_IMAGE) --push \ - --platform=$(PLATFORMS) \ - docker/base - -create-debugimg: prepare-docker-buildx - docker buildx build -t $(DEBUG_IMAGE) --push \ - --platform=$(PLATFORMS) \ - docker/debug - -create-fake-debugimg: prepare-docker-buildx - docker buildx build -t $(DEBUG_IMAGE) --push \ - --platform=$(PLATFORMS) \ - docker/base - -.PHONY: prepare-docker-buildx -prepare-docker-buildx: - docker buildx inspect jaeger-build > /dev/null || docker buildx create --use --name=jaeger-build --buildkitd-flags="--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host" --driver-opt="network=host" - docker inspect registry > /dev/null || docker run --rm -d -p 5000:5000 --name registry registry:2 - -.PHONY: clean-docker-buildx -clean-docker-buildx: - docker buildx rm jaeger-build - docker rm -f registry