fix: use a glibc base image for sqlite-jdbc
CI / test (push) Successful in 2m34s
CI / smoke (push) Failing after 1m13s
CI / chart (push) Successful in 14s
CI / image (push) Skipped

Alpine/musl cannot load sqlite-jdbc's bundled native library, so the
container failed at startup. Switch the runtime image to
eclipse-temurin:21-jre-jammy and verify the image end-to-end, including
transcoding, against a read-only root filesystem.

The smoke fixture now uses a 192 kbps source so the maxBitRate check
actually proves transcoding instead of direct play.
This commit is contained in:
TapTap committed 2026-11-13 13:12:13 +00:00
1 parent 25331ec0e1
commit 7d98bc1d3a
3 files changed
+14 -9

No files matched your search

+7 -4
View File
@@ -10,11 +10,14 @@ RUN ./gradlew --no-daemon dependencies > /dev/null
COPY src ./src
RUN ./gradlew --no-daemon shadowJar
FROM eclipse-temurin:21-jre-alpine
# glibc (not Alpine/musl): sqlite-jdbc ships no native library for Linux-Musl.
FROM eclipse-temurin:21-jre-jammy
RUN apk add --no-cache ffmpeg \
&& addgroup -g 10001 -S app \
&& adduser -u 10001 -S -G app app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 10001 app \
&& useradd -u 10001 -g app -M -s /usr/sbin/nologin app
WORKDIR /app
COPY --from=build /src/build/libs/*-all.jar /app/musicmanager.jar
+2 -2
View File
@@ -165,7 +165,7 @@ Build a lightweight, self-hosted **OpenSubsonic-compatible music server** in **K
## 2. Tech Stack & Dependencies
- **Language & runtime:** Kotlin 2.x on JVM 21 (`eclipse-temurin:21-jre-alpine`)
- **Language & runtime:** Kotlin 2.x on JVM 21 (`eclipse-temurin:21-jre-jammy`)
- **Build:** Gradle Kotlin DSL (`build.gradle.kts`), ShadowJar fat JAR
- **Web:** Ktor Server (Netty)
- `ktor-server-core`, `ktor-server-netty`
@@ -626,7 +626,7 @@ Cover extraction order: embedded APIC frame -> `cover.jpg`/`folder.jpg`/`front.j
### 9.1 Image
- Multi-stage Dockerfile: Gradle build -> `eclipse-temurin:21-jre-alpine` with `ffmpeg` installed.
- Multi-stage Dockerfile: Gradle build -> glibc-based `eclipse-temurin:21-jre-jammy` with `ffmpeg` installed (Alpine/musl is unsupported by sqlite-jdbc's bundled native library).
- Runtime flags: `-XX:+UseSerialGC -Xmx256m` (adjustable via Helm).
- Non-root user (UID 10001), read-only root filesystem, `/tmp` as `emptyDir`, `/data` as PVC.
- Image: `gitea.tap-tap.win/tap-tap/audiomanager:<tag>` (registry paths must be lowercase).
+5 -3
View File
@@ -37,7 +37,7 @@ ffmpeg -hide_banner -loglevel error -y \
-metadata genre="Rock" \
-metadata track="1" \
-metadata date="2026" \
-q:a 9 "$WORK/music/Smoke Artist/Smoke Album/01 - Smoke Song.mp3"
-b:a 192k "$WORK/music/Smoke Artist/Smoke Album/01 - Smoke Song.mp3"
ffmpeg -hide_banner -loglevel error -y \
-f lavfi -i "color=c=red:s=64x64" -frames:v 1 \
@@ -210,14 +210,16 @@ if [[ "$RANGE_STATUS" == "206" ]]; then pass "stream range"; else fail "stream r
TRANSCODE_STATUS="$(curl -s -D "$WORK/transcode.headers" -o "$WORK/transcoded.mp3" -w '%{http_code}' "$BASE/rest/stream.view?$AUTH&id=$SONG_ID&maxBitRate=64")"
if [[ "$TRANSCODE_STATUS" == "200" && -s "$WORK/transcoded.mp3" ]] \
&& grep -qi '^content-type: audio/mpeg' "$WORK/transcode.headers"; then
&& grep -qi '^content-type: audio/mpeg' "$WORK/transcode.headers" \
&& [[ $(wc -c < "$WORK/transcoded.mp3") -lt $(wc -c < "$WORK/stream.mp3") ]]; then
pass "stream transcode (maxBitRate)"
else
fail "stream transcode (maxBitRate)" "HTTP $TRANSCODE_STATUS, $(wc -c < "$WORK/transcoded.mp3" 2>/dev/null || echo 0) bytes"
fi
OFFSET_STATUS="$(curl -s -o "$WORK/offset.mp3" -w '%{http_code}' "$BASE/rest/stream.view?$AUTH&id=$SONG_ID&timeOffset=1")"
if [[ "$OFFSET_STATUS" == "200" && -s "$WORK/offset.mp3" ]]; then
if [[ "$OFFSET_STATUS" == "200" && -s "$WORK/offset.mp3" ]] \
&& [[ $(wc -c < "$WORK/offset.mp3") -lt $(wc -c < "$WORK/stream.mp3") ]]; then
pass "stream transcode (timeOffset)"
else
fail "stream transcode (timeOffset)" "HTTP $OFFSET_STATUS"