ARG VERSION FROM alpine as apps RUN apk add --no-cache jq curl bash COPY apps /apps WORKDIR /apps ARG VERSION RUN ./install.sh RUN rm ./install.sh ./install-list FROM libresh/nextcloud:$VERSION-upstream RUN set -ex; \ \ apk add --no-cache \ imagemagick \ ; RUN set -ex; \ \ apk add --no-cache --virtual .build-deps \ imap-dev \ libressl-dev \ bzip2-dev \ ; \ docker-php-ext-configure imap --with-imap-ssl; \ docker-php-ext-install imap; \ apk del .build-deps COPY redis.ini /usr/local/etc/php/conf.d/ COPY --chown=www-data:root config/* /var/www/html/config/ COPY --from=apps --chown=www-data:root /apps/* /var/www/html/apps/ RUN for app in $(cat /var/www/html/apps/remove-list);do \ echo "removing app $app"; \ rm -R /var/www/html/apps/$app; \ done RUN rm /var/www/html/apps/remove-list CMD ["php-fpm"]