diff --git a/Dockerfile b/Dockerfile index 9fe3896c..2614781c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,26 +41,11 @@ FROM alpine:3.20 AS build-sysroot WORKDIR /root # Fetch runtime dependencies -RUN apk --no-cache add \ - binutils \ +RUN mkdir -p /sysroot/etc/apk && cp -r /etc/apk/* /sysroot/etc/apk/ +RUN apk add --no-cache --initdb -p /sysroot \ + alpine-baselayout \ + busybox \ ca-certificates \ - curl \ - ncurses-terminfo-base - -# Install rTorrent and dependencies to new system root -RUN mkdir -p /root/sysroot/etc/ssl/certs -COPY --from=build /root/rtorrent/dist/rtorrent-deb.deb . -RUN ar -xv rtorrent-deb.deb -RUN tar xvf data.tar.* -C /root/sysroot/ - -RUN mkdir -p /root/sysroot/download /root/sysroot/session /root/sysroot/watch - -FROM alpine:3.20 AS rtorrent - -RUN apk --no-cache add \ - binutils \ - ca-certificates \ - jq \ mktorrent \ ncurses-terminfo-base \ tini \ @@ -70,7 +55,16 @@ RUN apk --no-cache add \ -X https://dl-cdn.alpinelinux.org/alpine/v3.14/main \ unrar -COPY --from=build-sysroot /root/sysroot / +# Install rTorrent to new system root +COPY --from=build /root/rtorrent/dist/rtorrent-deb.deb . +RUN ar -xv rtorrent-deb.deb +RUN tar xvf data.tar.* -C /sysroot/ + +RUN mkdir -p /sysroot/download /sysroot/session /sysroot/watch + +FROM scratch AS rtorrent + +COPY --from=build-sysroot /sysroot / EXPOSE 5000