Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Nextcloud #2185

Merged
merged 1 commit into from
Dec 30, 2016
Merged

Adds Nextcloud #2185

merged 1 commit into from
Dec 30, 2016

Conversation

pierreozoux
Copy link
Contributor

@pierreozoux pierreozoux commented Sep 25, 2016

Checklist for Review

NOTE: This checklist is intended for the use of the Official Images maintainers both to track the status of your PR and to help inform you and others of where we're at. As such, please leave the "checking" of items to the repository maintainers. If there is a point below for which you would like to provide additional information or note completion, please do so by commenting on the PR. Thanks! (and thanks for staying patient with us ❤️)

  • associated with or contacted upstream?
  • does it fit into one of the common categories? ("service", "language stack", "base distribution")
  • is it reasonably popular, or does it solve a particular use case well?
  • does a documentation PR exist? (should be reviewed and merged at roughly the same time so that we don't have an empty image page on the Hub for very long)
  • dockerization review for best practices and cache gotchas/improvements (ala the official review guidelines)?
  • 2+ dockerization review?
  • existing official images have been considered as a base? (ie, if foobar needs Node.js, has FROM node:... instead of grabbing node via other means been considered?)
    • FROM php
  • if FROM scratch, tarballs only exist in a single commit within the associated history?
  • passes current tests? any simple new tests that might be appropriate to add? (https://github.com/docker-library/official-images/tree/master/test)

@pierreozoux
Copy link
Contributor Author

Any news on that?

@tianon
Copy link
Member

tianon commented Nov 23, 2016

Dockerization looks OK at a quick glance, but Travis is complaining about your formatting here -- I think you've got an extraneous newline in there (either the one before or the one after the GitRepo line -- it shouldn't matter much which one you remove).

@pierreozoux pierreozoux force-pushed the nextcloud branch 3 times, most recently from 16abed6 to be5eea9 Compare November 24, 2016 10:24
@pierreozoux
Copy link
Contributor Author

Ok, all good here :)

@tianon
Copy link
Member

tianon commented Nov 30, 2016

Excellent 👍

diff --git a/nextcloud_latest/Dockerfile b/nextcloud_latest/Dockerfile
new file mode 100644
index 0000000..8a666ad
--- /dev/null
+++ b/nextcloud_latest/Dockerfile
@@ -0,0 +1,56 @@
+FROM php:5.6-fpm
+
+RUN apt-get update && apt-get install -y \
+  bzip2 \
+  libcurl4-openssl-dev \
+  libfreetype6-dev \
+  libicu-dev \
+  libjpeg-dev \
+  libmcrypt-dev \
+  libmemcached-dev \
+  libpng12-dev \
+  libpq-dev \
+  libxml2-dev \
+  && rm -rf /var/lib/apt/lists/*
+
+# https://docs.nextcloud.com/server/9/admin_manual/installation/source_installation.html
+RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
+  && docker-php-ext-install gd exif intl mbstring mcrypt mysql opcache pdo_mysql pdo_pgsql pgsql zip
+
+# set recommended PHP.ini settings
+# see https://secure.php.net/manual/en/opcache.installation.php
+RUN { \
+    echo 'opcache.memory_consumption=128'; \
+    echo 'opcache.interned_strings_buffer=8'; \
+    echo 'opcache.max_accelerated_files=4000'; \
+    echo 'opcache.revalidate_freq=60'; \
+    echo 'opcache.fast_shutdown=1'; \
+    echo 'opcache.enable_cli=1'; \
+  } > /usr/local/etc/php/conf.d/opcache-recommended.ini
+
+# PECL extensions
+RUN set -ex \
+ && pecl install APCu-4.0.10 \
+ && pecl install memcached-2.2.0 \
+ && pecl install redis-2.2.8 \
+ && docker-php-ext-enable apcu redis memcached
+
+ENV NEXTCLOUD_VERSION 10.0.0
+VOLUME /var/www/html
+
+RUN curl -fsSL -o nextcloud.tar.bz2 \
+    "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2" \
+ && curl -fsSL -o nextcloud.tar.bz2.asc \
+    "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc" \
+ && export GNUPGHOME="$(mktemp -d)" \
+# gpg key from https://nextcloud.com/nextcloud.asc
+ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A \
+ && gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2 \
+ && rm -r "$GNUPGHOME" nextcloud.tar.bz2.asc \
+ && tar -xjf nextcloud.tar.bz2 -C /usr/src/ \
+ && rm nextcloud.tar.bz2
+
+COPY docker-entrypoint.sh /entrypoint.sh
+
+ENTRYPOINT ["/entrypoint.sh"]
+CMD ["php-fpm"]
diff --git a/nextcloud_latest/docker-entrypoint.sh b/nextcloud_latest/docker-entrypoint.sh
new file mode 100755
index 0000000..62d1625
--- /dev/null
+++ b/nextcloud_latest/docker-entrypoint.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+
+if [ ! -e '/var/www/html/version.php' ]; then
+    tar cf - --one-file-system -C /usr/src/nextcloud . | tar xf -
+    chown -R www-data /var/www/html
+fi
+
+exec "$@"

@yosifkit
Copy link
Member

Sorry I am so sloooow. 😞

LGTM! Just some notes soon over in the docs.
Build test of #2185; edb70d5 (nextcloud):

$ bashbrew build nextcloud:10.0.0
Building bashbrew/cache:77e417500c722e85a4e877a0b998b25c838937b1ada02543b40a75de0e9c8e94 (nextcloud:10.0.0)
Tagging nextcloud:10.0.0
Tagging nextcloud:10.0
Tagging nextcloud:10
Tagging nextcloud:latest

$ test/run.sh nextcloud:10.0.0
testing nextcloud:10.0.0
	'utc' [1/4]...passed
	'cve-2014--shellshock' [2/4]...passed
	'no-hard-coded-passwords' [3/4]...passed
	'override-cmd' [4/4]...passed

@yosifkit yosifkit merged commit c2fa05e into docker-library:master Dec 30, 2016
@pierreozoux
Copy link
Contributor Author

Great! Thank you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants