1
0
Fork 0
mirror of https://github.com/fiso64/slsk-batchdl.git synced 2024-12-22 22:42:41 +00:00
slsk-batchdl/Dockerfile

45 lines
1.1 KiB
Text
Raw Permalink Normal View History

FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as base
FROM base as build
2024-08-23 18:03:43 +00:00
ARG TARGETPLATFORM
ARG DOCKER_ARCH
RUN \
echo "**** install build packages ****" && \
apk --no-cache add \
binutils-gold \
openssl \
zlib \
libstdc++ \
dotnet6-sdk
WORKDIR /app
COPY --chown=root:root . /app
2024-08-23 18:03:43 +00:00
RUN if [ "$DOCKER_ARCH" = "amd64" ] || [ "$TARGETPLATFORM" = "linux/amd64" ]; then export DN_RUNTIME=linux-musl-x64; echo 'Building x64'; fi \
&& if [ "$DOCKER_ARCH" = "arm64" ] || [ "$TARGETPLATFORM" = "linux/arm64" ]; then export DN_RUNTIME=linux-musl-arm64; echo 'Build ARM'; fi \
&& dotnet publish -c Release -r "$DN_RUNTIME" -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true -o build \
&& rm -f build/*.pdb
FROM base as app
ENV TZ=Etc/GMT
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 18:03:43 +00:00
COPY --from=build /app/build/* /usr/bin/