Skip to content

Commit 3896758

Browse files
committed
Switch runtime image to Debian
1 parent 73c7ae7 commit 3896758

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ RUN mvn -q -DskipTests package && \
1212
FROM golang:1.25-bookworm AS golibrespot-build
1313
WORKDIR /src
1414

15-
RUN apt-get update && apt-get install -y --no-install-recommends \
15+
ARG APT_FLAGS="-o Acquire::Retries=5 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30"
16+
17+
RUN apt-get ${APT_FLAGS} update && apt-get ${APT_FLAGS} install -y --no-install-recommends \
1618
git \
1719
pkg-config \
1820
libogg-dev \
@@ -26,21 +28,26 @@ RUN git clone --depth 1 --branch v0.7.1 https://github.com/devgianlu/go-librespo
2628
WORKDIR /src/go-librespot
2729
RUN go build -o /out/go-librespot ./cmd/daemon
2830

29-
FROM eclipse-temurin:17-jre
31+
FROM debian:bookworm-slim
3032
WORKDIR /app
3133

32-
RUN apt-get update && apt-get install -y --no-install-recommends \
34+
ARG APT_FLAGS="-o Acquire::Retries=5 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30"
35+
36+
RUN apt-get ${APT_FLAGS} update && apt-get ${APT_FLAGS} install -y --no-install-recommends \
3337
ffmpeg \
3438
ca-certificates \
35-
libasound2t64 && \
39+
libasound2 && \
3640
rm -rf /var/lib/apt/lists/*
3741

42+
COPY --from=build /opt/java/openjdk /opt/java/openjdk
3843
COPY --from=build /out/JMusicBot.jar /app/JMusicBot.jar
3944
COPY --from=golibrespot-build /out/go-librespot /usr/local/bin/go-librespot
4045
COPY docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
4146

4247
RUN chmod +x /usr/local/bin/docker-entrypoint.sh /usr/local/bin/go-librespot
4348

49+
ENV JAVA_HOME=/opt/java/openjdk
50+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
4451
ENV JMUSICBOT_HOME=/data
4552
VOLUME ["/data"]
4653

0 commit comments

Comments
 (0)