mirror of
https://github.com/fiso64/slsk-batchdl.git
synced 2024-12-22 14:32:40 +00:00
Use musl release and refactor dockerfile stages
This commit is contained in:
parent
e56136104e
commit
222c750bfb
1 changed files with 28 additions and 16 deletions
44
Dockerfile
44
Dockerfile
|
@ -1,28 +1,40 @@
|
||||||
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as base
|
||||||
|
|
||||||
|
FROM base as build
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
echo "**** install build packages ****" && \
|
||||||
|
apk --no-cache add \
|
||||||
|
binutils-gold \
|
||||||
|
openssl \
|
||||||
|
zlib \
|
||||||
|
libstdc++ \
|
||||||
|
dotnet6-sdk
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --chown=root:root . /app
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
FROM base as app
|
||||||
|
|
||||||
ENV TZ=Etc/GMT
|
ENV TZ=Etc/GMT
|
||||||
|
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
echo "**** install packages ****" && \
|
echo "**** install runtime packages ****" && \
|
||||||
apk --no-cache add \
|
apk --no-cache add \
|
||||||
binutils-gold \
|
dotnet6-runtime && \
|
||||||
openssl \
|
echo "**** cleanup ****" && \
|
||||||
zlib \
|
rm -rf \
|
||||||
libstdc++ \
|
/root/.cache \
|
||||||
dotnet6-sdk \
|
/tmp/*
|
||||||
aspnetcore6-runtime \
|
|
||||||
bash
|
|
||||||
|
|
||||||
ENV DOCKER_MODS=linuxserver/mods:universal-cron
|
ENV DOCKER_MODS=linuxserver/mods:universal-cron
|
||||||
|
|
||||||
COPY docker/root/ /
|
COPY docker/root/ /
|
||||||
|
|
||||||
WORKDIR /app
|
COPY --from=build /app/slsk-batchdl/bin/Release/net6.0/linux-musl-x64/publish/* /usr/bin/
|
||||||
|
|
||||||
COPY --chown=abc:abc . /app
|
|
||||||
|
|
||||||
RUN rm -rf /app/docker
|
|
||||||
|
|
||||||
RUN dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true
|
|
Loading…
Reference in a new issue