-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
32 lines (26 loc) · 1.01 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
IMAGES = $(shell find * -name Dockerfile | grep -vE "(armv7-plexmediaserver|mediaproxy-|softether-)" | xargs -I {} dirname {})
BUILDX_NAME := docker-libs
# Unsupported linux/386,linux/arm/v6 for ubuntu:20.04
BUILDX_PLATFORMS := linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7
BUILDX_LOAD := true
DOCKER_BUILDKIT := 1
DOCKER_HOST :=
lint:
@for name in $(IMAGES); do \
echo linting $${name}; \
docker run --rm -i hadolint/hadolint /bin/hadolint - < $${name}/Dockerfile; \
done
pre:
-docker run --rm --name bimfmt --privileged tonistiigi/binfmt:latest --install "$(BUILDX_PLATFORMS)"
-docker buildx create --name $(BUILDX_NAME)
docker buildx use $(BUILDX_NAME)
build-all: pre
for name in $(IMAGES); do \
echo building $${name}; \
env BUILDX_PLATFORMS=$(BUILDX_PLATFORMS) BUILDX_LOAD=$(BUILDX_LOAD) ./build.sh $${name}; \
done
build-%: pre
env BUILDX_PLATFORMS=$(BUILDX_PLATFORMS) BUILDX_LOAD=$(BUILDX_LOAD) ./build.sh $(subst build-,,$@)
clean:
docker buildx rm $(BUILDX_NAME)
docker stop bimfmt