-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
30 lines (20 loc) · 1.11 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
# This makefile is primarily used for building docker containers
SHELL=/bin/bash -e -o pipefail
BUILD_COMMAND=docker buildx bake -f docker-bake.hcl
GET_BUILDX_INFO_COMMAND=$(BUILD_COMMAND) --print
BUILD_TARGETS_COMMAND=xargs $(BUILD_COMMAND)
GET_TARGETS_FOR_ARCH_CMD=python3 $(CURDIR)/dockerfiles/get_targets_for_arch.py
# By default, load into the local docker registry, can be overriden with --push for production builds
BUILD_COMMAND_EXTRA_ARGS=--load
.PHONY: all_containers x86_containers arm_containers
# Users likely want to get containers that work on the current system,
# so that is the default.
default_containers: native_containers
all_containers:
$(BUILD_COMMAND) $(BUILD_COMMAND_EXTRA_ARGS)
x86_containers:
$(GET_BUILDX_INFO_COMMAND) | $(GET_TARGETS_FOR_ARCH_CMD) --arch x86 | $(BUILD_TARGETS_COMMAND) $(BUILD_COMMAND_EXTRA_ARGS)
arm_containers:
$(GET_BUILDX_INFO_COMMAND) | $(GET_TARGETS_FOR_ARCH_CMD) --arch arm | $(BUILD_TARGETS_COMMAND) $(BUILD_COMMAND_EXTRA_ARGS)
native_containers:
$(GET_BUILDX_INFO_COMMAND) | $(GET_TARGETS_FOR_ARCH_CMD) --arch native | $(BUILD_TARGETS_COMMAND) $(BUILD_COMMAND_EXTRA_ARGS)