Closed kpostekk closed 2 years ago
- Could use multistage build to speedup build process and reduce image size (compile in a builder, copy binary to runner, install ffmpeg)
- Using alpine linux based images is overall better than using debian based ones
Apperantly there are FFmpeg Alpine images for Docker (https://github.com/jrottenberg/ffmpeg)
TL;DR - musl
has several issues with multi-threading (+ performance overhead in heap allocation) and as it is main C library on Alpine Linux, building Docker image on that distro is not possible - bot crashes when trying to lock the mutex inside songbird
.
Switching base image to minimal Ubuntu (glib) + static ffmpeg libraries + multi-stage build resulted in decreasing 2.5 GB image into ~215 MB
Mostly major tasks were completed. Closing
Dockerfile
related possible improvments:Other quirks:
.dockerignore
not.DockerIgnore
Cargo.lock
should be copied into image