Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Adds fpm, closes #25 #28

Merged
merged 2 commits into from
Oct 8, 2015
Merged

Adds fpm, closes #25 #28

merged 2 commits into from
Oct 8, 2015

Conversation

pierreozoux
Copy link
Contributor

I did move apache to a new subdir, I thought it was cleaner.

Waiting for your comments.

(since the beginning I think the docker official library is a complicated piece of software, now I had to put my hand dirty, I can confirm that this is horribly complicated and counter intuitive, any plans to make it better?)

sed -ri -e 's/^(ENV OWNCLOUD_VERSION) .*/\1 '"$latest"'/' "$version/Dockerfile"

travisEnv='\n - VERSION='"$version$travisEnv"
travisEnv='\n - VERSION='"$version"' VARIANT='"$travisEnv"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just drop the blank VARIANT since it is just the same as apache.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was cool to have the owncloud image default to apache or owncloud:8. But as you want, I can delete it.

Wordpress is doing it this way, that's why I wanted to stay consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is how we want to tag the images, but this is just generating the travis test so it would build it twice for no benefit. Tags and which Dockerfile(s) for the official builds are specified in a "library" file in docker-library/official-images; generate-stackbrew-library.sh generates that library file for this repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During the night, I understood my mistake :)

@pierreozoux pierreozoux force-pushed the master branch 3 times, most recently from 01bb517 to 9a4f180 Compare September 23, 2015 08:52
@yosifkit
Copy link
Member

A few more comments:

@pierreozoux
Copy link
Contributor Author

@yosifkit ok, merged :)

About the whitespace/tabs, I think I followed what was in place. If not, can you point me where it needs to be updated please?

For the "horribly" complicated, here is a blog post: https://microblog.pierre-o.fr/2015/docker-hub-and-official-images-are-complicated
I really hope we can make it better :) Do you want me to put these comments somewhere else to keep track of them? let me know!

Best,

Pierre

libpng12-dev \
libpq-dev \
libxml2-dev \
&& rm -rf /var/lib/apt/lists/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swap the spaces to tabs lines 4-14. Applies to 6.0, 7.0, 8.0, and 8.1 Dockerfiles.

This was referenced Sep 29, 2015
@yosifkit
Copy link
Member

Sorry for that flood of comments, I noticed a few other things as I was running through and wanted to minimize the back-and-forth so that we can get this merged soon 🎉.

@pierreozoux
Copy link
Contributor Author

Thanks for your helpful comments. I addressed all of them :)

@yosifkit
Copy link
Member

Great! LGTM

ping @tianon

@pierreozoux
Copy link
Contributor Author

Any update?

I have to say, that I'm an happy user with this ownCloud instance (1600 users already)
https://framadrive.org/

Pierre

@tianon
Copy link
Member

tianon commented Oct 8, 2015

Pulled this locally to see if I could get a cleaner diff and was successful. 👍

LGTM

diff --git a/.travis.yml b/.travis.yml
index 29616dc..06aa4c9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,10 +4,14 @@ language: bash
 sudo: 9000

 env:
-  - VERSION=8.1
-  - VERSION=8.0
-  - VERSION=7.0
-  - VERSION=6.0
+  - VERSION=8.1 VARIANT=fpm
+  - VERSION=8.1 VARIANT=apache
+  - VERSION=8.0 VARIANT=fpm
+  - VERSION=8.0 VARIANT=apache
+  - VERSION=7.0 VARIANT=fpm
+  - VERSION=7.0 VARIANT=apache
+  - VERSION=6.0 VARIANT=fpm
+  - VERSION=6.0 VARIANT=apache

 install:
   - git clone https://github.com/docker-library/official-images.git ~/official-images
@@ -15,10 +19,10 @@ install:
 before_script:
   - env | sort
   - cd "$VERSION"
-  - image="owncloud:$VERSION"
+  - image="owncloud:${VERSION}${VARIANT:+-$VARIANT}"

 script:
-  - docker build -t "$image" .
+  - docker build -t "$image" "${VARIANT}"
   - ~/official-images/test/run.sh "$image"

 after_script:
diff --git a/6.0/Dockerfile b/6.0/apache/Dockerfile
similarity index 100%
copy from 6.0/Dockerfile
copy to 6.0/apache/Dockerfile
diff --git a/8.1/docker-entrypoint.sh b/6.0/apache/docker-entrypoint.sh
similarity index 100%
copy from 8.1/docker-entrypoint.sh
copy to 6.0/apache/docker-entrypoint.sh
diff --git a/6.0/Dockerfile b/6.0/fpm/Dockerfile
similarity index 95%
rename from 6.0/Dockerfile
rename to 6.0/fpm/Dockerfile
index 55bdf16..9f34ac4 100644
--- a/6.0/Dockerfile
+++ b/6.0/fpm/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:5.6-apache
+FROM php:5.6-fpm

 RUN apt-get update && apt-get install -y \
    bzip2 \
@@ -30,8 +30,6 @@ RUN { \
        echo 'opcache.enable_cli=1'; \
    } > /usr/local/etc/php/conf.d/opcache-recommended.ini

-RUN a2enmod rewrite
-
 ENV OWNCLOUD_VERSION 6.0.9
 VOLUME /var/www/html

@@ -46,4 +44,4 @@ RUN curl -fsSL -o owncloud.tar.bz2 \
 COPY docker-entrypoint.sh /entrypoint.sh

 ENTRYPOINT ["/entrypoint.sh"]
-CMD ["apache2-foreground"]
+CMD ["php-fpm"]
diff --git a/8.0/docker-entrypoint.sh b/6.0/fpm/docker-entrypoint.sh
similarity index 100%
rename from 8.0/docker-entrypoint.sh
rename to 6.0/fpm/docker-entrypoint.sh
diff --git a/7.0/Dockerfile b/7.0/apache/Dockerfile
similarity index 100%
copy from 7.0/Dockerfile
copy to 7.0/apache/Dockerfile
diff --git a/7.0/docker-entrypoint.sh b/7.0/apache/docker-entrypoint.sh
similarity index 100%
rename from 7.0/docker-entrypoint.sh
rename to 7.0/apache/docker-entrypoint.sh
diff --git a/7.0/Dockerfile b/7.0/fpm/Dockerfile
similarity index 95%
rename from 7.0/Dockerfile
rename to 7.0/fpm/Dockerfile
index dd109c9..35677b6 100644
--- a/7.0/Dockerfile
+++ b/7.0/fpm/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:5.6-apache
+FROM php:5.6-fpm

 RUN apt-get update && apt-get install -y \
    bzip2 \
@@ -30,8 +30,6 @@ RUN { \
        echo 'opcache.enable_cli=1'; \
    } > /usr/local/etc/php/conf.d/opcache-recommended.ini

-RUN a2enmod rewrite
-
 ENV OWNCLOUD_VERSION 7.0.10
 VOLUME /var/www/html

@@ -46,4 +44,4 @@ RUN curl -fsSL -o owncloud.tar.bz2 \
 COPY docker-entrypoint.sh /entrypoint.sh

 ENTRYPOINT ["/entrypoint.sh"]
-CMD ["apache2-foreground"]
+CMD ["php-fpm"]
diff --git a/6.0/docker-entrypoint.sh b/7.0/fpm/docker-entrypoint.sh
similarity index 100%
rename from 6.0/docker-entrypoint.sh
rename to 7.0/fpm/docker-entrypoint.sh
diff --git a/8.0/Dockerfile b/8.0/apache/Dockerfile
similarity index 100%
copy from 8.0/Dockerfile
copy to 8.0/apache/Dockerfile
diff --git a/8.1/docker-entrypoint.sh b/8.0/apache/docker-entrypoint.sh
similarity index 100%
copy from 8.1/docker-entrypoint.sh
copy to 8.0/apache/docker-entrypoint.sh
diff --git a/8.0/Dockerfile b/8.0/fpm/Dockerfile
similarity index 95%
rename from 8.0/Dockerfile
rename to 8.0/fpm/Dockerfile
index c5c2089..3f912c4 100644
--- a/8.0/Dockerfile
+++ b/8.0/fpm/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:5.6-apache
+FROM php:5.6-fpm

 RUN apt-get update && apt-get install -y \
    bzip2 \
@@ -34,8 +34,6 @@ RUN { \
 RUN pecl install APCu-beta \
    && docker-php-ext-enable apcu

-RUN a2enmod rewrite
-
 ENV OWNCLOUD_VERSION 8.0.8
 VOLUME /var/www/html

@@ -50,4 +48,4 @@ RUN curl -fsSL -o owncloud.tar.bz2 \
 COPY docker-entrypoint.sh /entrypoint.sh

 ENTRYPOINT ["/entrypoint.sh"]
-CMD ["apache2-foreground"]
+CMD ["php-fpm"]
diff --git a/8.1/docker-entrypoint.sh b/8.0/fpm/docker-entrypoint.sh
similarity index 100%
copy from 8.1/docker-entrypoint.sh
copy to 8.0/fpm/docker-entrypoint.sh
diff --git a/8.1/Dockerfile b/8.1/apache/Dockerfile
similarity index 100%
copy from 8.1/Dockerfile
copy to 8.1/apache/Dockerfile
diff --git a/8.1/docker-entrypoint.sh b/8.1/apache/docker-entrypoint.sh
similarity index 100%
copy from 8.1/docker-entrypoint.sh
copy to 8.1/apache/docker-entrypoint.sh
diff --git a/8.1/Dockerfile b/8.1/fpm/Dockerfile
similarity index 96%
rename from 8.1/Dockerfile
rename to 8.1/fpm/Dockerfile
index 5c24276..b2943bf 100644
--- a/8.1/Dockerfile
+++ b/8.1/fpm/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:5.6-apache
+FROM php:5.6-fpm

 RUN apt-get update && apt-get install -y \
    bzip2 \
@@ -35,8 +35,6 @@ RUN { \
 RUN pecl install APCu-beta redis memcached \
    && docker-php-ext-enable apcu redis memcached

-RUN a2enmod rewrite
-
 ENV OWNCLOUD_VERSION 8.1.3
 VOLUME /var/www/html

@@ -51,4 +49,4 @@ RUN curl -fsSL -o owncloud.tar.bz2 \
 COPY docker-entrypoint.sh /entrypoint.sh

 ENTRYPOINT ["/entrypoint.sh"]
-CMD ["apache2-foreground"]
+CMD ["php-fpm"]
diff --git a/8.1/docker-entrypoint.sh b/8.1/fpm/docker-entrypoint.sh
similarity index 100%
rename from 8.1/docker-entrypoint.sh
rename to 8.1/fpm/docker-entrypoint.sh
diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index 4788990..1b7681b 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -17,18 +17,27 @@ url='git://github.com/docker-library/owncloud'
 echo '# maintainer: InfoSiftr <[email protected]> (@infosiftr)'

 for version in "${versions[@]}"; do
-   commit="$(cd "$version" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
-   fullVersion="$(grep -m1 'ENV OWNCLOUD_VERSION ' "$version/Dockerfile" | cut -d' ' -f3)"
-   
-   versionAliases=()
-   while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
-       versionAliases+=( $fullVersion )
-       fullVersion="${fullVersion%[.-]*}"
-   done
-   versionAliases+=( $version ${aliases[$version]} )
-   
-   echo
-   for va in "${versionAliases[@]}"; do
-       echo "$va: ${url}@${commit} $version"
+   for variant in apache fpm; do
+       commit="$(cd "$version/$variant" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
+       fullVersion="$(grep -m1 'ENV OWNCLOUD_VERSION ' "$version/$variant/Dockerfile" | cut -d' ' -f3)"
+
+       versionAliases=()
+       while [ "$fullVersion" != "$version" -a "${fullVersion%[.-]*}" != "$fullVersion" ]; do
+           versionAliases+=( $fullVersion )
+           fullVersion="${fullVersion%[.-]*}"
+       done
+       versionAliases+=( $version ${aliases[$version]} )
+
+       echo
+       for va in "${versionAliases[@]}"; do
+           echo "$va-$variant: ${url}@${commit} $version/$variant"
+           if [ "${variant}" == "apache" ]; then
+               echo "$va: ${url}@${commit} $version/$variant"
+           else
+               if [ "$va" == "latest" ]; then
+                   echo "$variant: ${url}@${commit} $version/$variant"
+               fi
+           fi
+       done
    done
 done
diff --git a/update.sh b/update.sh
index 086459e..42656cc 100755
--- a/update.sh
+++ b/update.sh
@@ -13,9 +13,10 @@ versions=( "${versions[@]%/}" )
 travisEnv=
 for version in "${versions[@]}"; do
    latest=$(curl -sSL 'https://owncloud.org/changelog/' |tac|tac| grep -o -m 1 "\(Version\|Release\) ${version}.[[:digit:]]\+" | sed -rn 's/(Version|Release) (.*)/\2/p')
-   sed -ri -e 's/^(ENV OWNCLOUD_VERSION) .*/\1 '"$latest"'/' "$version/Dockerfile"
-   
-   travisEnv='\n  - VERSION='"$version$travisEnv"
+   for variant in apache fpm; do
+       sed -ri -e 's/^(ENV OWNCLOUD_VERSION) .*/\1 '"$latest"'/' "$version/$variant/Dockerfile"
+       travisEnv='\n  - VERSION='"$version"' VARIANT='"$variant$travisEnv"
+   done
 done

 travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"

tianon added a commit that referenced this pull request Oct 8, 2015
@tianon tianon merged commit e111cac into docker-library:master Oct 8, 2015
tianon added a commit to infosiftr/stackbrew that referenced this pull request Oct 14, 2015
- `docker`: 1.8.3, 1.9.0-rc1
- `docker-dev`: 1.8.3
- `drupal`: add PHP zip extension (docker-library/drupal#7)
- `httpd`: 2.4.17
- `mariadb`: 5.5.46+maria-1~wheezy
- `mongo`: 3.0.7
- `owncloud`: add FPM variants (docker-library/owncloud#28)
- `postgres`: explicit uid/gid (docker-library/postgres#93)
- `tomcat`: 8.0.28
RichardScothern pushed a commit to RichardScothern/official-images that referenced this pull request Jun 14, 2016
- `docker`: 1.8.3, 1.9.0-rc1
- `docker-dev`: 1.8.3
- `drupal`: add PHP zip extension (docker-library/drupal#7)
- `httpd`: 2.4.17
- `mariadb`: 5.5.46+maria-1~wheezy
- `mongo`: 3.0.7
- `owncloud`: add FPM variants (docker-library/owncloud#28)
- `postgres`: explicit uid/gid (docker-library/postgres#93)
- `tomcat`: 8.0.28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants