Skip to content

Commit

Permalink
feat(): dockerfile multi stage
Browse files Browse the repository at this point in the history
  • Loading branch information
al3xLvs committed Jun 3, 2020
1 parent ce41ae7 commit 82cec8a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 43 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
uses: actions/checkout@v2
-
name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
uses: crazy-max/ghaction-docker-buildx@v2
with:
buildx-version: latest
skip-cache: false
qemu-version: latest
-
name: Dockerhub login
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/tags.yml

This file was deleted.

27 changes: 25 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
FROM alpine:3.12 AS builder

RUN apk add --no-progress --no-cache \
curl \
git \
php7 \
php7-ctype \
php7-iconv \
php7-json \
php7-mbstring \
php7-openssl \
php7-phar \
php7-simplexml \
php7-tokenizer \
php7-xmlrpc \
&& cd /tmp \
&& curl -s http://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& chmod +x /usr/local/bin/composer \
&& git clone https://github.com/Magicalex/rtorrent-cleaner.git /tmp/rtorrent-cleaner \
&& cd /tmp/rtorrent-cleaner \
&& composer build \
&& mv rtorrent-cleaner-php7.2.phar /usr/local/bin/rtorrent-cleaner

FROM alpine:3.12

LABEL description="rtorrent-cleaner is a tool to clean up unnecessary files in rtorrent" \
maintainer="magicalex <magicalex@mondedie.fr>"

ENV PHP_MEMORY_LIMIT=128M PHP_TIMEZONE=UTC

COPY --from=builder /usr/local/bin /usr/local/bin

RUN apk add --no-progress --no-cache \
php7 \
php7-iconv \
Expand All @@ -14,8 +39,6 @@ RUN apk add --no-progress --no-cache \
php7-xmlrpc \
&& sed -i 's/memory_limit = .*/memory_limit = ${PHP_MEMORY_LIMIT}/' /etc/php7/php.ini \
&& sed -i 's/;date.timezone =/date.timezone = ${PHP_TIMEZONE}/' /etc/php7/php.ini \
&& wget https://github.com/Magicalex/rtorrent-cleaner/releases/download/0.9.7/rtorrent-cleaner-php7.2.phar \
&& mv rtorrent-cleaner-php7.2.phar /usr/local/bin/rtorrent-cleaner \
&& chmod +x /usr/local/bin/rtorrent-cleaner

ENTRYPOINT ["rtorrent-cleaner"]

0 comments on commit 82cec8a

Please # to comment.