-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
36 lines (30 loc) · 1.35 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
# Docker names (DN) for the images
DN_OPTIMIZER := "cosmwasm/optimizer"
DN_RUST_OPTIMIZER := "cosmwasm/rust-optimizer"
DN_WORKSPACE_OPTIMIZER := "cosmwasm/workspace-optimizer"
DOCKER_TAG := 0.16.1
# Native arch
BUILDARCH := $(shell uname -m)
# Build the native CPU arch images
.PHONY: build
build: build-$(BUILDARCH)
.PHONY: build-x86_64
build-x86_64:
docker buildx build --pull --platform linux/amd64 -t $(DN_OPTIMIZER):$(DOCKER_TAG) --target rust-optimizer --load .
docker tag $(DN_OPTIMIZER):$(DOCKER_TAG) $(DN_RUST_OPTIMIZER):$(DOCKER_TAG)
docker tag $(DN_OPTIMIZER):$(DOCKER_TAG) $(DN_WORKSPACE_OPTIMIZER):$(DOCKER_TAG)
.PHONY: build-arm64
build-arm64:
docker buildx build --pull --platform linux/arm64/v8 -t $(DN_OPTIMIZER)-arm64:$(DOCKER_TAG) --target rust-optimizer --load .
docker tag $(DN_OPTIMIZER)-arm64:$(DOCKER_TAG) $(DN_RUST_OPTIMIZER)-arm64:$(DOCKER_TAG)
docker tag $(DN_OPTIMIZER)-arm64:$(DOCKER_TAG) $(DN_WORKSPACE_OPTIMIZER)-arm64:$(DOCKER_TAG)
.PHONY: publish-x86_64
publish-x86_64: build-x86_64
docker push $(DN_OPTIMIZER):$(DOCKER_TAG)
docker push $(DN_RUST_OPTIMIZER):$(DOCKER_TAG)
docker push $(DN_WORKSPACE_OPTIMIZER):$(DOCKER_TAG)
.PHONY: publish-arm64
publish-arm64: build-arm64
docker push $(DN_OPTIMIZER)-arm64:$(DOCKER_TAG)
docker push $(DN_RUST_OPTIMIZER)-arm64:$(DOCKER_TAG)
docker push $(DN_WORKSPACE_OPTIMIZER)-arm64:$(DOCKER_TAG)