forked from Yakifo/amqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (32 loc) · 784 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (32 loc) · 784 Bytes
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
# Image name and tag
IMAGE_NAME := amqtt
IMAGE_TAG := latest
VERSION_TAG := 0.12.0
REGISTRY := amqtt/$(IMAGE_NAME)
# Platforms to build for
PLATFORMS := linux/amd64,linux/arm64
# Default target
.PHONY: all
all: build
# Build multi-platform image
.PHONY: build
build:
docker buildx build \
--platform $(PLATFORMS) \
--tag $(REGISTRY):$(IMAGE_TAG) \
--tag $(REGISTRY):$(VERSION_TAG) \
--file Dockerfile \
--push .
# Optional: build without pushing (for local testing)
.PHONY: build-local
build-local:
docker buildx build \
--tag $(REGISTRY):$(IMAGE_TAG) \
--tag $(REGISTRY):$(VERSION_TAG) \
--file Dockerfile \
--load .
# Create builder if not exists
.PHONY: init
init:
docker buildx create --use --name multi-builder || true
docker buildx inspect --bootstrap