docker-build: cache ffmpeg if stock

This commit is contained in:
ed 2026-05-08 00:02:54 +00:00
parent 2a4c82c742
commit 139ef1851e
8 changed files with 26 additions and 53 deletions

View file

@ -495,7 +495,8 @@ to get started, first `cd` into the `scripts` folder
* if you want to build a docker-image, you have two options: * if you want to build a docker-image, you have two options:
* if you want to use podman to build all docker-images for all supported architectures, now run `(cd docker; make -C base; ./make.sh hclean; ./make.sh hclean pull img)` * if you want to use podman to build all docker-images for all supported architectures, now run `(cd docker; make -C base; ./make.sh hclean; ./make.sh hclean pull img)`
* if you want to use docker to build all docker-images for your native architecture, now run `sudo make -C docker` * if you want to use docker to build just the `ac` docker-image for your native architecture, now run `sudo make -C docker`
* to use docker to build something other than `ac`, list the image variants you want; `sudo make -C docker min im ac iv dj`
* if you want to do something else, please take a look at `docker/make.sh` or `docker/Makefile` for inspiration * if you want to do something else, please take a look at `docker/make.sh` or `docker/Makefile` for inspiration
* beware of the following: * beware of the following:
* if you build with docker, you get the [stock alpine-provided ffmpeg](https://github.com/9001/copyparty/blob/hovudstraum/docs/bad-codecs.md), which makes the docker-image almost twice as big * if you build with docker, you get the [stock alpine-provided ffmpeg](https://github.com/9001/copyparty/blob/hovudstraum/docs/bad-codecs.md), which makes the docker-image almost twice as big

View file

@ -6,8 +6,9 @@ LABEL org.opencontainers.image.url="https://github.com/9001/copyparty" \
org.opencontainers.image.title="copyparty-ac" \ org.opencontainers.image.title="copyparty-ac" \
org.opencontainers.image.description="copyparty with Pillow and FFmpeg (image/audio/video thumbnails, audio transcoding, media tags)" org.opencontainers.image.description="copyparty with Pillow and FFmpeg (image/audio/video thumbnails, audio transcoding, media tags)"
ENV XDG_CONFIG_HOME=/cfg ENV XDG_CONFIG_HOME=/cfg
ARG ADD_PKG=""
RUN apk --no-cache add !pyc \ RUN apk --no-cache add !pyc ${ADD_PKG} \
tzdata wget mimalloc2 mimalloc2-insecure \ tzdata wget mimalloc2 mimalloc2-insecure \
py3-jinja2 py3-argon2-cffi py3-pyzmq \ py3-jinja2 py3-argon2-cffi py3-pyzmq \
py3-openssl py3-paramiko py3-pillow py3-openssl py3-paramiko py3-pillow

View file

@ -6,11 +6,12 @@ LABEL org.opencontainers.image.url="https://github.com/9001/copyparty" \
org.opencontainers.image.title="copyparty-dj" \ org.opencontainers.image.title="copyparty-dj" \
org.opencontainers.image.description="copyparty with all optional dependencies, including musical key / bpm detection" org.opencontainers.image.description="copyparty with all optional dependencies, including musical key / bpm detection"
ENV XDG_CONFIG_HOME=/cfg ENV XDG_CONFIG_HOME=/cfg
ARG ADD_PKG=""
COPY i/bin/mtag/install-deps.sh ./ COPY i/bin/mtag/install-deps.sh ./
COPY i/bin/mtag/audio-bpm.py /mtag/ COPY i/bin/mtag/audio-bpm.py /mtag/
COPY i/bin/mtag/audio-key.py /mtag/ COPY i/bin/mtag/audio-key.py /mtag/
RUN apk add -U !pyc \ RUN apk add -U !pyc ${ADD_PKG} \
tzdata wget mimalloc2 mimalloc2-insecure \ tzdata wget mimalloc2 mimalloc2-insecure \
py3-jinja2 py3-argon2-cffi py3-pyzmq \ py3-jinja2 py3-argon2-cffi py3-pyzmq \
py3-openssl py3-paramiko py3-pillow \ py3-openssl py3-paramiko py3-pillow \

View file

@ -6,8 +6,9 @@ LABEL org.opencontainers.image.url="https://github.com/9001/copyparty" \
org.opencontainers.image.title="copyparty-im" \ org.opencontainers.image.title="copyparty-im" \
org.opencontainers.image.description="copyparty with Pillow and Mutagen (image thumbnails, media tags)" org.opencontainers.image.description="copyparty with Pillow and Mutagen (image thumbnails, media tags)"
ENV XDG_CONFIG_HOME=/cfg ENV XDG_CONFIG_HOME=/cfg
ARG ADD_PKG=""
RUN apk --no-cache add !pyc \ RUN apk --no-cache add !pyc ${ADD_PKG} \
tzdata wget mimalloc2 mimalloc2-insecure \ tzdata wget mimalloc2 mimalloc2-insecure \
py3-jinja2 py3-argon2-cffi \ py3-jinja2 py3-argon2-cffi \
py3-openssl py3-paramiko py3-pillow py3-mutagen py3-openssl py3-paramiko py3-pillow py3-mutagen

View file

@ -6,8 +6,9 @@ LABEL org.opencontainers.image.url="https://github.com/9001/copyparty" \
org.opencontainers.image.title="copyparty-iv" \ org.opencontainers.image.title="copyparty-iv" \
org.opencontainers.image.description="copyparty with Pillow, FFmpeg, libvips (image/audio/video thumbnails, audio transcoding, media tags)" org.opencontainers.image.description="copyparty with Pillow, FFmpeg, libvips (image/audio/video thumbnails, audio transcoding, media tags)"
ENV XDG_CONFIG_HOME=/cfg ENV XDG_CONFIG_HOME=/cfg
ARG ADD_PKG=""
RUN apk add -U !pyc \ RUN apk add -U !pyc ${ADD_PKG} \
tzdata wget mimalloc2 mimalloc2-insecure \ tzdata wget mimalloc2 mimalloc2-insecure \
py3-jinja2 py3-argon2-cffi py3-pyzmq \ py3-jinja2 py3-argon2-cffi py3-pyzmq \
py3-openssl py3-paramiko py3-pillow \ py3-openssl py3-paramiko py3-pillow \

View file

@ -6,8 +6,9 @@ LABEL org.opencontainers.image.url="https://github.com/9001/copyparty" \
org.opencontainers.image.title="copyparty-min" \ org.opencontainers.image.title="copyparty-min" \
org.opencontainers.image.description="just copyparty, no thumbnails / media tags / audio transcoding" org.opencontainers.image.description="just copyparty, no thumbnails / media tags / audio transcoding"
ENV XDG_CONFIG_HOME=/cfg ENV XDG_CONFIG_HOME=/cfg
ARG ADD_PKG=""
RUN apk --no-cache add !pyc \ RUN apk --no-cache add !pyc ${ADD_PKG} \
py3-jinja2 py3-jinja2
COPY i innvikler.sh ./ COPY i innvikler.sh ./

View file

@ -1,62 +1,32 @@
self := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) self := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
all: .PHONY: i min im ac iv dj clean hclean purge sh
-service docker start
-systemctl start docker
all: ac
i:
rm -rf i rm -rf i
mkdir i mkdir i
tar -cC../../dist copyparty-sfx.py | tar -xvCi tar -cC../../dist copyparty-sfx.py | tar -xvCi
tar -cC../.. bin/mtag | tar -xvCi tar -cC../.. bin/mtag | tar -xvCi
# # use stock ffmpeg because ./base/Makefile requires podman; # # use stock ffmpeg because ./base/Makefile requires podman;
# # beware: https://github.com/9001/copyparty/blob/hovudstraum/docs/bad-codecs.md # # beware: https://github.com/9001/copyparty/blob/hovudstraum/docs/bad-codecs.md
touch i/stock_ffmpeg touch i/stock_ffmpeg
min: i
docker build -t copyparty/min:latest -f Dockerfile.min . docker build -t copyparty/min:latest -f Dockerfile.min .
echo 'scale=1;'`docker save copyparty/min:latest | pigz -c | wc -c`/1024/1024 | bc
# docker build -t copyparty/min-pip:latest -f Dockerfile.min.pip .
# echo 'scale=1;'`docker save copyparty/min-pip:latest | pigz -c | wc -c`/1024/1024 | bc
im: i
docker build -t copyparty/im:latest -f Dockerfile.im . docker build -t copyparty/im:latest -f Dockerfile.im .
echo 'scale=1;'`docker save copyparty/im:latest | pigz -c | wc -c`/1024/1024 | bc
docker build -t copyparty/iv:latest -f Dockerfile.iv . ac: i
echo 'scale=1;'`docker save copyparty/iv:latest | pigz -c | wc -c`/1024/1024 | bc docker build -t copyparty/ac:latest -f Dockerfile.ac --build-arg ADD_PKG=ffmpeg .
docker build -t copyparty/ac:latest -f Dockerfile.ac . iv: i
echo 'scale=1;'`docker save copyparty/ac:latest | pigz -c | wc -c`/1024/1024 | bc docker build -t copyparty/iv:latest -f Dockerfile.iv --build-arg ADD_PKG=ffmpeg .
docker build -t copyparty/dj:latest -f Dockerfile.dj . dj: i
echo 'scale=1;'`docker save copyparty/dj:latest | pigz -c | wc -c`/1024/1024 | bc docker build -t copyparty/dj:latest -f Dockerfile.dj --build-arg ADD_PKG=ffmpeg .
docker image ls
min:
rm -rf i
mkdir i
tar -cC../.. dist/copyparty-sfx.py bin/mtag | tar -xvCi
podman build --squash --pull=always -t copyparty/min:latest -f Dockerfile.min .
echo 'scale=1;'`podman save copyparty/min:latest | pigz -c | wc -c`/1024/1024 | bc
push:
docker push copyparty/min
docker push copyparty/im
docker push copyparty/iv
docker push copyparty/ac
docker push copyparty/dj
docker image tag copyparty/min:latest ghcr.io/9001/copyparty-min:latest
docker image tag copyparty/im:latest ghcr.io/9001/copyparty-im:latest
docker image tag copyparty/iv:latest ghcr.io/9001/copyparty-iv:latest
docker image tag copyparty/ac:latest ghcr.io/9001/copyparty-ac:latest
docker image tag copyparty/dj:latest ghcr.io/9001/copyparty-dj:latest
docker push ghcr.io/9001/copyparty-min:latest
docker push ghcr.io/9001/copyparty-im:latest
docker push ghcr.io/9001/copyparty-iv:latest
docker push ghcr.io/9001/copyparty-ac:latest
docker push ghcr.io/9001/copyparty-dj:latest
clean: clean:
-docker kill `docker ps -q` -docker kill `docker ps -q`

View file

@ -14,9 +14,6 @@ ised() {
tmv "$2" tmv "$2"
} }
# use stock ffmpeg if requested
echo $1 | grep -qE 'ac|iv|dj' && [ -e "/z/stock_ffmpeg" ] && apk add ffmpeg
# use custom ffmpeg if relevant # use custom ffmpeg if relevant
echo $1 | grep -qE 'ac|iv|dj' && [ ! -e "/z/stock_ffmpeg" ] && ( echo $1 | grep -qE 'ac|iv|dj' && [ ! -e "/z/stock_ffmpeg" ] && (
cp -pv /z/packages/*.pub /etc/apk/keys/ cp -pv /z/packages/*.pub /etc/apk/keys/