-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
Makefile.Docker.mk
73 lines (61 loc) · 2.99 KB
/
Makefile.Docker.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright (c) 2023 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0
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
@echo "::group:: create-baseimg"
docker buildx build -t $(BASE_IMAGE) --push \
--platform=$(LINUX_PLATFORMS) \
docker/base
@echo "::endgroup::"
create-debugimg: prepare-docker-buildx
@echo "::group:: create-debugimg"
docker buildx build -t $(DEBUG_IMAGE) --push \
--platform=$(LINUX_PLATFORMS) \
docker/debug
@echo "::endgroup::"
create-fake-debugimg: prepare-docker-buildx
@echo "::group:: create-fake-debugimg"
docker buildx build -t $(DEBUG_IMAGE) --push \
--platform=$(LINUX_PLATFORMS) \
docker/base
@echo "::endgroup::"
.PHONY: prepare-docker-buildx
prepare-docker-buildx:
@echo "::group:: 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
@echo "::endgroup::"
.PHONY: clean-docker-buildx
clean-docker-buildx:
docker buildx rm jaeger-build
docker rm -f registry
.PHONY: docker-hotrod
docker-hotrod:
GOOS=linux $(MAKE) build-examples
docker build -t $(DOCKER_NAMESPACE)/example-hotrod:${DOCKER_TAG} ./examples/hotrod --build-arg TARGETARCH=$(GOARCH)
@echo "Finished building hotrod =============="
.PHONY: docker-images-tracegen
docker-images-tracegen:
docker build -t $(DOCKER_NAMESPACE)/jaeger-tracegen:${DOCKER_TAG} cmd/tracegen/ --build-arg TARGETARCH=$(GOARCH)
@echo "Finished building jaeger-tracegen =============="
.PHONY: docker-images-anonymizer
docker-images-anonymizer:
docker build -t $(DOCKER_NAMESPACE)/jaeger-anonymizer:${DOCKER_TAG} cmd/anonymizer/ --build-arg TARGETARCH=$(GOARCH)
@echo "Finished building jaeger-anonymizer =============="
.PHONY: docker-images-cassandra
docker-images-cassandra:
docker build -t $(DOCKER_NAMESPACE)/jaeger-cassandra-schema:${DOCKER_TAG} plugin/storage/cassandra/
@echo "Finished building jaeger-cassandra-schema =============="
.PHONY: docker-images-elastic
docker-images-elastic: create-baseimg
GOOS=linux GOARCH=$(GOARCH) $(MAKE) build-esmapping-generator
GOOS=linux GOARCH=$(GOARCH) $(MAKE) build-es-index-cleaner
GOOS=linux GOARCH=$(GOARCH) $(MAKE) build-es-rollover
docker build -t $(DOCKER_NAMESPACE)/jaeger-es-index-cleaner:${DOCKER_TAG} --build-arg base_image=$(BASE_IMAGE) --build-arg TARGETARCH=$(GOARCH) cmd/es-index-cleaner
docker build -t $(DOCKER_NAMESPACE)/jaeger-es-rollover:${DOCKER_TAG} --build-arg base_image=$(BASE_IMAGE) --build-arg TARGETARCH=$(GOARCH) cmd/es-rollover
@echo "Finished building jaeger-elasticsearch tools =============="