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 nextcloud:${VERSION}-fpm-alpine RUN set -ex; \ \ apk add --no-cache \ imagemagick \ imap-dev \ ; RUN set -ex; \ \ apk add --no-cache --virtual .build-deps \ 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/* /usr/src/nextcloud/config/ COPY --from=apps --chown=www-data:root /apps/* /usr/src/nextcloud/apps/ RUN for app in $(cat /usr/src/nextcloud/apps/remove-list);do \ echo "removing app $app"; \ rm -R /usr/src/nextcloud/apps/$app; \ done; \ chown www-data:root /usr/src/nextcloud; \ rm /usr/src/nextcloud/apps/remove-list; \ rm -rf custom_apps/; \ rm /usr/src/nextcloud/config/autoconfig.php /usr/src/nextcloud/config/config.sample.php; COPY install.sh /install.sh USER www-data ENTRYPOINT [""] CMD [""]