-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (32 loc) · 1.16 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
.PHONY: build push
REPO=renderedtext/protoc
IMAGE_LATEST=$(REPO):latest
DOCKER_IMAGE_TAG=$(shell git rev-parse --short HEAD)
PLATFORMS=linux/amd64,linux/arm64
ELIXIR_VERSION=1.11.4
PROTOC_VERSION=3.17.3
PROTOBUF_VERSION=
DOCKER_IMAGE_VERSIONS_TAG=$(ELIXIR_VERSION)-$(PROTOC_VERSION)-$(PROTOBUF_VERSION)
image.build.versions:
docker build \
-t $(REPO) -t $(IMAGE_LATEST) . \
--build-arg ELIXIR_VERSION=$(ELIXIR_VERSION) \
--build-arg PROTOC_VERSION=$(PROTOC_VERSION) \
--build-arg PROTOBUF_VERSION=$(PROTOBUF_VERSION) \
build:
$(MAKE) image.build.versions PROTOBUF_VERSION="0.5.4" ELIXIR_VERSION="1.8.2" PROTOC_VERSION=3.3.0
push:
docker tag $(IMAGE_LATEST) $(REPO):$(DOCKER_IMAGE_TAG)
docker push $(REPO):$(DOCKER_IMAGE_TAG)
docker push $(IMAGE_LATEST)
buildx:
docker buildx build \
--platform $(PLATFORMS) \
-t $(REPO):$(DOCKER_IMAGE_VERSIONS_TAG) \
--build-arg ELIXIR_VERSION=$(ELIXIR_VERSION) \
--build-arg PROTOC_VERSION=$(PROTOC_VERSION) \
--build-arg PROTOBUF_VERSION=$(PROTOBUF_VERSION) \
--push -- .
push.tagged.versions:
docker tag $(IMAGE_LATEST) $(REPO):$(DOCKER_IMAGE_VERSIONS_TAG)
docker push $(REPO):$(DOCKER_IMAGE_VERSIONS_TAG)