mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
just build web once for all arch
This commit is contained in:
parent
732f2c9249
commit
37282e83f1
19
Makefile
19
Makefile
@ -1,30 +1,35 @@
|
|||||||
default_target: frigate
|
default_target: local
|
||||||
|
|
||||||
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
||||||
VERSION = 0.11.0
|
VERSION = 0.11.0
|
||||||
|
CURRENT_UID := $(shell id -u)
|
||||||
|
CURRENT_GID := $(shell id -g)
|
||||||
|
|
||||||
version:
|
version:
|
||||||
echo "VERSION=\"$(VERSION)-$(COMMIT_HASH)\"" > frigate/version.py
|
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:
|
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 .
|
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 .
|
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 .
|
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 .
|
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 .
|
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 .
|
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 .
|
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
|
run_tests: frigate
|
||||||
|
|||||||
@ -1,13 +1,5 @@
|
|||||||
FROM blakeblackshear/frigate-nginx:1.0.2 as nginx
|
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
|
FROM debian:11 as wheels
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
@ -112,7 +104,7 @@ WORKDIR /opt/frigate/
|
|||||||
ADD frigate frigate/
|
ADD frigate frigate/
|
||||||
ADD migrations migrations/
|
ADD migrations migrations/
|
||||||
|
|
||||||
COPY --from=web /opt/frigate/dist web/
|
COPY web/dist web/
|
||||||
|
|
||||||
COPY docker/rootfs/ /
|
COPY docker/rootfs/ /
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user