Skip to content

Commit

Permalink
build(docker): reduce dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Elegant996 committed Aug 27, 2024
1 parent 0a19869 commit 88265f7
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down

0 comments on commit 88265f7

Please sign in to comment.