forked from temporalio/docker-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (40 loc) · 2.56 KB
/
Makefile
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
.ONESHELL:
.PHONY:
all: install
##### Variables ######
COLOR := "\e[1;36m%s\e[0m\n"
DOCKER_IMAGE_TAG ?= latest
# Pass "registry" to automatically push image to the docker hub.
DOCKER_BUILDX_OUTPUT ?= image
TEMPORAL_ROOT := temporal
TCTL_ROOT := tctl
##### Scripts ######
install: install-submodules
update: update-submodules
install-submodules:
@printf $(COLOR) "Installing temporal and tctl submodules..."
git submodule update --init $(TEMPORAL_ROOT) $(TCTL_ROOT)
update-submodules:
@printf $(COLOR) "Updatinging temporal and tctl submodules..."
git submodule update --force --remote $(TEMPORAL_ROOT) $(TCTL_ROOT)
##### Docker #####
docker-server:
@printf $(COLOR) "Building docker image temporalio/server:$(DOCKER_IMAGE_TAG)..."
docker build . -f server.Dockerfile -t temporalio/server:$(DOCKER_IMAGE_TAG)
docker-admin-tools: docker-server
@printf $(COLOR) "Build docker image temporalio/admin-tools:$(DOCKER_IMAGE_TAG)..."
docker build . -f admin-tools.Dockerfile -t temporalio/admin-tools:$(DOCKER_IMAGE_TAG) --build-arg SERVER_IMAGE=temporalio/server:$(DOCKER_IMAGE_TAG)
docker-auto-setup: docker-admin-tools
@printf $(COLOR) "Build docker image temporalio/auto-setup:$(DOCKER_IMAGE_TAG)..."
docker build . -f auto-setup.Dockerfile -t temporalio/auto-setup:$(DOCKER_IMAGE_TAG) --build-arg SERVER_IMAGE=temporalio/server:$(DOCKER_IMAGE_TAG) --build-arg ADMIN_TOOLS_IMAGE=temporalio/admin-tools:$(DOCKER_IMAGE_TAG)
docker-buildx-container:
docker buildx create --name builder-x --driver docker-container --use
docker-server-x:
@printf $(COLOR) "Building cross-platform docker image temporalio/server:$(DOCKER_IMAGE_TAG)..."
docker buildx build . -f server.Dockerfile -t temporalio/server:$(DOCKER_IMAGE_TAG) --platform linux/amd64,linux/arm64 --output type=$(DOCKER_BUILDX_OUTPUT)
docker-admin-tools-x: docker-server-x
@printf $(COLOR) "Build cross-platform docker image temporalio/admin-tools:$(DOCKER_IMAGE_TAG)..."
docker buildx build . -f admin-tools.Dockerfile -t temporalio/admin-tools:$(DOCKER_IMAGE_TAG) --platform linux/amd64,linux/arm64 --output type=$(DOCKER_BUILDX_OUTPUT) --build-arg SERVER_IMAGE=temporalio/server:$(DOCKER_IMAGE_TAG)
docker-auto-setup-x: docker-admin-tools-x
@printf $(COLOR) "Build cross-platform docker image temporalio/auto-setup:$(DOCKER_IMAGE_TAG)..."
docker buildx build . -f auto-setup.Dockerfile -t temporalio/auto-setup:$(DOCKER_IMAGE_TAG) --platform linux/amd64,linux/arm64 --output type=$(DOCKER_BUILDX_OUTPUT) --build-arg SERVER_IMAGE=temporalio/server:$(DOCKER_IMAGE_TAG) --build-arg ADMIN_TOOLS_IMAGE=temporalio/admin-tools:$(DOCKER_IMAGE_TAG)