2024-08-23 17:34:38 +00:00
|
|
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as base
|
2024-08-23 16:55:16 +00:00
|
|
|
|
2024-08-23 17:34:38 +00:00
|
|
|
FROM base as build
|
2024-08-23 16:55:16 +00:00
|
|
|
|
|
|
|
RUN \
|
2024-08-23 17:34:38 +00:00
|
|
|
echo "**** install build packages ****" && \
|
2024-08-23 16:55:16 +00:00
|
|
|
apk --no-cache add \
|
|
|
|
binutils-gold \
|
|
|
|
openssl \
|
|
|
|
zlib \
|
|
|
|
libstdc++ \
|
2024-08-23 17:34:38 +00:00
|
|
|
dotnet6-sdk
|
2024-08-23 16:55:16 +00:00
|
|
|
|
2024-08-23 17:34:38 +00:00
|
|
|
WORKDIR /app
|
2024-08-23 16:55:16 +00:00
|
|
|
|
2024-08-23 17:34:38 +00:00
|
|
|
COPY --chown=root:root . /app
|
2024-08-23 16:55:16 +00:00
|
|
|
|
2024-08-23 17:34:38 +00:00
|
|
|
RUN dotnet publish -c Release -r linux-musl-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true \
|
|
|
|
&& rm -f slsk-batchdl/bin/Release/net6.0/osx-x64/publish/*.pdb
|
2024-08-23 16:55:16 +00:00
|
|
|
|
2024-08-23 17:34:38 +00:00
|
|
|
FROM base as app
|
|
|
|
|
|
|
|
ENV TZ=Etc/GMT
|
2024-08-23 16:55:16 +00:00
|
|
|
|
2024-08-23 17:34:38 +00:00
|
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
echo "**** install runtime packages ****" && \
|
|
|
|
apk --no-cache add \
|
|
|
|
dotnet6-runtime && \
|
|
|
|
echo "**** cleanup ****" && \
|
|
|
|
rm -rf \
|
|
|
|
/root/.cache \
|
|
|
|
/tmp/*
|
|
|
|
|
|
|
|
ENV DOCKER_MODS=linuxserver/mods:universal-cron
|
|
|
|
|
|
|
|
COPY docker/root/ /
|
2024-08-23 16:55:16 +00:00
|
|
|
|
2024-08-23 17:34:38 +00:00
|
|
|
COPY --from=build /app/slsk-batchdl/bin/Release/net6.0/linux-musl-x64/publish/* /usr/bin/
|