-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Build Navidrome image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- navidrome/** | ||
- .github/workflows/build-navidrome.yml | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
strategy: | ||
matrix: | ||
version: ['0.51.1'] | ||
steps: | ||
- name: Check-out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push image to registry | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64 | ||
context: ./navidrome | ||
file: ./navidrome/Dockerfile | ||
push: true | ||
build-args: | | ||
VERSION=${{ matrix.version }} | ||
tags: | | ||
ghcr.io/f-bn/navidrome:${{ matrix.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# --- Build stage --- | ||
FROM docker.io/gcc:13.2 AS ffmpeg-build | ||
|
||
ARG FFMPEG_VERSION=6.1.1 | ||
|
||
RUN set -ex ; \ | ||
export DEBIAN_FRONTEND=noninteractive ; \ | ||
apt update ; \ | ||
apt install -y --no-install-recommends \ | ||
libmp3lame-dev \ | ||
libopus-dev \ | ||
yasm \ | ||
cmake \ | ||
automake \ | ||
build-essential | ||
|
||
WORKDIR /build | ||
|
||
ADD https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz /build/ | ||
|
||
RUN tar -xf ffmpeg-${FFMPEG_VERSION}.tar.xz --strip-components=1 | ||
|
||
RUN set -ex ; \ | ||
./configure \ | ||
--prefix=/usr \ | ||
--libdir=/usr/lib \ | ||
--disable-doc \ | ||
--disable-network \ | ||
--disable-autodetect \ | ||
--disable-everything \ | ||
--enable-encoder=libopus,aac \ | ||
--enable-decoder=flac,libopus \ | ||
--enable-parser=flac \ | ||
--enable-muxer=flac,opus,adts \ | ||
--enable-demuxer=flac \ | ||
--enable-filter=aresample \ | ||
--enable-protocol=file,pipe \ | ||
--enable-shared \ | ||
--enable-gpl \ | ||
--enable-libopus ; \ | ||
make -j2 DESTDIR=./dist install | ||
|
||
# --- Build stage --- | ||
FROM cgr.dev/chainguard/wolfi-base:latest AS build | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ARG VERSION=0.51.1 | ||
|
||
WORKDIR /build | ||
|
||
ADD https://github.com/navidrome/navidrome/releases/download/v${VERSION}/navidrome_${VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz /build/ | ||
|
||
RUN tar -xzf /build/navidrome_${VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz | ||
|
||
# --- Final stage --- | ||
FROM cgr.dev/chainguard/wolfi-base:latest | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
COPY --from=ffmpeg-build /build/dist/ / | ||
COPY --from=build /build/navidrome /usr/bin/navidrome | ||
|
||
RUN set -ex ; \ | ||
mkdir -p /etc/navidrome /var/lib/navidrome /media/music ; \ | ||
chown nonroot:nonroot /var/lib/navidrome | ||
|
||
RUN apk add --no-cache opus | ||
|
||
ENV ND_MUSICFOLDER=/media/music | ||
ENV ND_DATAFOLDER=/var/lib/navidrome | ||
ENV ND_CACHEFOLDER=${ND_DATAFOLDER}/cache | ||
|
||
USER nonroot | ||
|
||
EXPOSE 4533/tcp | ||
|
||
VOLUME [ "/var/lib/navidrome" ] | ||
|
||
ENTRYPOINT [ "/usr/bin/navidrome" ] | ||
|
||
LABEL \ | ||
org.opencontainers.image.title="navidrome" \ | ||
org.opencontainers.image.source="https://github.com/f-bn/containers-images/navidrome" \ | ||
org.opencontainers.image.description="Modern Music Server and Streamer compatible with Subsonic/Airsonic" \ | ||
org.opencontainers.image.licenses="GPL-3.0-or-later" \ | ||
org.opencontainers.image.authors="Florian Bobin <[email protected]>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## General informations | ||
|
||
Custom Navidrome image with a minimal ffpmeg audio-only build. | ||
|
||
### ffmpeg notes | ||
|
||
This image contains a custom ffmpeg **audio-only** build with a limited audio plugins available (video plugins are not needed at all by Navidrome). | ||
|
||
There was two goal to build ffmpeg from sources for Navidrome: | ||
- Keep Navidrome image as minimal as possible since ffmpeg can require a lot of dependencies when compiled with a large set of audio/video plugins (like in standard Linux distributions repositories). | ||
- Support for Opus Audio codec for audio transcoding (since native WolfiOS ffmpeg package is not built with Opus support) | ||
|
||
## Navidrome configuration | ||
|
||
This image doesn't come with a default Navidrome configuration. You can bring your own configuration to the container (e.g using Docker): | ||
|
||
```shell | ||
$ docker run [options] -v navidrome.toml:/etc/navidrome/config.toml \ | ||
ghcr.io/f-bn/navidrome:0.51.0 --configfile /etc/navidrome/config.toml | ||
``` | ||
|
||
More informations about Navidrome configuration [here](https://www.navidrome.org/docs/usage/configuration-options/). |