just build web once for all arch

This commit is contained in:
Blake Blackshear 2022-04-24 08:08:10 -05:00
parent 732f2c9249
commit 37282e83f1
2 changed files with 13 additions and 16 deletions

View File

@ -1,30 +1,35 @@
default_target: frigate
default_target: local
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
VERSION = 0.11.0
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)
version:
echo "VERSION=\"$(VERSION)-$(COMMIT_HASH)\"" > frigate/version.py
build_web:
docker run --volume ${PWD}/web:/web -w /web --volume /etc/passwd:/etc/passwd:ro --volume /etc/group:/etc/group:ro -u $(CURRENT_UID):$(CURRENT_GID) node:16 /bin/bash -c "npm install && npm run build"
nginx_frigate:
docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate-nginx:1.0.2 --file docker/Dockerfile.nginx .
frigate: version
local:
DOCKER_BUILDKIT=1 docker build -t frigate -f docker/Dockerfile .
frigate_amd64: version
amd64:
docker buildx build --platform linux/amd64 --tag blakeblackshear/frigate:$(VERSION)-$(COMMIT_HASH) --file docker/Dockerfile .
frigate_arm64: version
arm64:
docker buildx build --platform linux/arm64 --tag blakeblackshear/frigate:$(VERSION)-$(COMMIT_HASH) --file docker/Dockerfile .
frigate_armv7: version
armv7:
docker buildx build --platform linux/arm/v7 --tag blakeblackshear/frigate:$(VERSION)-$(COMMIT_HASH) --file docker/Dockerfile .
frigate_build: frigate_amd64 frigate_arm64 frigate_armv7
build: version build_web amd64 arm64 armv7
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate:$(VERSION)-$(COMMIT_HASH) --file docker/Dockerfile .
frigate_push: frigate_build
push: build
docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate:$(VERSION)-$(COMMIT_HASH) --file docker/Dockerfile .
run_tests: frigate

View File

@ -1,13 +1,5 @@
FROM blakeblackshear/frigate-nginx:1.0.2 as nginx
FROM node:16 as web
WORKDIR /opt/frigate
COPY web/ .
RUN npm install && npm run build
FROM debian:11 as wheels
ARG TARGETARCH
@ -112,7 +104,7 @@ WORKDIR /opt/frigate/
ADD frigate frigate/
ADD migrations migrations/
COPY --from=web /opt/frigate/dist web/
COPY web/dist web/
COPY docker/rootfs/ /