Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
merge changes to Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
steinhobelgruen committed Mar 10, 2019
2 parents da12774 + 31c9f0a commit 9dc87cb
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 61 deletions.
30 changes: 19 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
sudo: required

services:
- docker

language: bash
services: docker

env:
- VARIANT=apache
- VARIANT=fpm
- VARIANT=fpm-alpine

install:
- git clone https://github.com/docker-library/official-images.git ~/official-images

before_script:
- env | sort
- wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
- cd "$VARIANT"
- image="matomo:${VARIANT}"

script:
- travis_retry docker build -t piwik:fpm-alpine fpm-alpine
- ~/official-images/test/run.sh piwik:fpm-alpine
- travis_retry docker build -t piwik:fpm fpm
- ~/official-images/test/run.sh piwik:fpm
- travis_retry docker build -t piwik:apache apache
- ~/official-images/test/run.sh piwik:apache
- |
(
set -Eeuo pipefail
set -x
docker build -t "$image" .
~/official-images/test/run.sh "$image"
)
after_script:
- docker images
Expand Down
20 changes: 12 additions & 8 deletions Dockerfile-alpine.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.1-%%VARIANT%%
FROM php:7.2-%%VARIANT%%

LABEL maintainer="[email protected]"

Expand All @@ -8,7 +8,6 @@ RUN set -ex; \
$PHPIZE_DEPS \
autoconf \
freetype-dev \
geoip-dev \
icu-dev \
libjpeg-turbo-dev \
libpng-dev \
Expand All @@ -28,13 +27,11 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.12; \
pecl install geoip-1.1.1; \
pecl install APCu-5.1.17; \
pecl install redis-3.1.6; \
\
docker-php-ext-enable \
apcu \
geoip \
redis \
; \
\
Expand All @@ -59,7 +56,7 @@ RUN set -ex; \
curl -fsSL -o piwik.tar.gz.asc \
"https://builds.matomo.org/piwik-${MATOMO_VERSION}.tar.gz.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --verify piwik.tar.gz.asc piwik.tar.gz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" piwik.tar.gz.asc; \
Expand All @@ -70,8 +67,15 @@ RUN set -ex; \
COPY php.ini /usr/local/etc/php/conf.d/php-piwik.ini

RUN set -ex; \
curl -fsSL -o /usr/src/piwik/misc/GeoIPCity.dat.gz https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz; \
gunzip /usr/src/piwik/misc/GeoIPCity.dat.gz
curl -fsSL -o GeoIPCity.tar.gz \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"; \
curl -fsSL -o GeoIPCity.tar.gz.md5 \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz.md5"; \
echo "$(cat GeoIPCity.tar.gz.md5) GeoIPCity.tar.gz" | md5sum -c -; \
mkdir /usr/src/GeoIPCity; \
tar -xf GeoIPCity.tar.gz -C /usr/src/GeoIPCity --strip-components=1; \
mv /usr/src/GeoIPCity/GeoLite2-City.mmdb /usr/src/piwik/misc/GeoLite2-City.mmdb; \
rm -rf GeoIPCity*

COPY docker-entrypoint.sh /entrypoint.sh

Expand Down
20 changes: 12 additions & 8 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.1-%%VARIANT%%
FROM php:7.2-%%VARIANT%%

LABEL maintainer="[email protected]"

Expand All @@ -9,7 +9,6 @@ RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libgeoip-dev \
libjpeg-dev \
libldap2-dev \
libpng-dev \
Expand All @@ -28,13 +27,11 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.12; \
pecl install geoip-1.1.1; \
pecl install APCu-5.1.17; \
pecl install redis-3.1.6; \
\
docker-php-ext-enable \
apcu \
geoip \
redis \
; \
\
Expand Down Expand Up @@ -69,7 +66,7 @@ RUN set -ex; \
curl -fsSL -o piwik.tar.gz.asc \
"https://builds.matomo.org/piwik-${MATOMO_VERSION}.tar.gz.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --verify piwik.tar.gz.asc piwik.tar.gz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" piwik.tar.gz.asc; \
Expand All @@ -81,8 +78,15 @@ RUN set -ex; \
COPY php.ini /usr/local/etc/php/conf.d/php-piwik.ini

RUN set -ex; \
curl -fsSL -o /usr/src/piwik/misc/GeoIPCity.dat.gz https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz; \
gunzip /usr/src/piwik/misc/GeoIPCity.dat.gz
curl -fsSL -o GeoIPCity.tar.gz \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"; \
curl -fsSL -o GeoIPCity.tar.gz.md5 \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz.md5"; \
echo "$(cat GeoIPCity.tar.gz.md5) GeoIPCity.tar.gz" | md5sum -c -; \
mkdir /usr/src/GeoIPCity; \
tar -xf GeoIPCity.tar.gz -C /usr/src/GeoIPCity --strip-components=1; \
mv /usr/src/GeoIPCity/GeoLite2-City.mmdb /usr/src/piwik/misc/GeoLite2-City.mmdb; \
rm -rf GeoIPCity*

COPY docker-entrypoint.sh /entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ docker run --rm --volumes-from="matomo_app_1" --link matomo_app_1 python:2-alpin

Pull requests are very welcome!

We'd love to hear your feedback and suggestions in the issue tracker: [github.com/motomo-org/docker/issues](https://github.com/matomo-org/docker/issues).
We'd love to hear your feedback and suggestions in the issue tracker: [github.com/matomo-org/docker/issues](https://github.com/matomo-org/docker/issues).

## GeoIP

Expand Down
28 changes: 13 additions & 15 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.1-apache
FROM php:7.2-apache

LABEL maintainer="[email protected]"

Expand All @@ -9,7 +9,6 @@ RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libgeoip-dev \
libjpeg-dev \
libldap2-dev \
libpng-dev \
Expand All @@ -28,7 +27,7 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.12; \
pecl install APCu-5.1.17; \
pecl install redis-3.1.6; \
\
docker-php-ext-enable \
Expand Down Expand Up @@ -69,8 +68,8 @@ RUN set -ex; \
curl -fsSL -o piwik.tar.gz.asc \
"https://builds.matomo.org/piwik-${MATOMO_VERSION}.tar.gz.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --no-tty --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --no-tty --batch --verify piwik.tar.gz.asc piwik.tar.gz; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --verify piwik.tar.gz.asc piwik.tar.gz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" piwik.tar.gz.asc; \
tar -xzf piwik.tar.gz -C /usr/src/; \
Expand All @@ -81,16 +80,15 @@ RUN set -ex; \
COPY php.ini /usr/local/etc/php/conf.d/php-piwik.ini

RUN set -ex; \
curl -fsSL -o GeoLite2-City.tar.gz http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz; \
tar zxvf GeoLite2-City.tar.gz; \
mv GeoLite2-City_*/GeoLite2-City.mmdb /usr/src/piwik/misc/; \
rm -rf GeoLite2-City.tar.gz GeoLite2-City_*

RUN set -ex; \
curl -fsSL -o GeoLite2-ASN.tar.gz http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz; \
tar zxvf GeoLite2-ASN.tar.gz; \
mv GeoLite2-ASN_*/GeoLite2-ASN.mmdb /usr/src/piwik/misc/; \
rm -rf GeoLite2-ASN.tar.gz GeoLite2-ASN_*
curl -fsSL -o GeoIPCity.tar.gz \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"; \
curl -fsSL -o GeoIPCity.tar.gz.md5 \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz.md5"; \
echo "$(cat GeoIPCity.tar.gz.md5) GeoIPCity.tar.gz" | md5sum -c -; \
mkdir /usr/src/GeoIPCity; \
tar -xf GeoIPCity.tar.gz -C /usr/src/GeoIPCity --strip-components=1; \
mv /usr/src/GeoIPCity/GeoLite2-City.mmdb /usr/src/piwik/misc/GeoLite2-City.mmdb; \
rm -rf GeoIPCity*

COPY docker-entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 13 additions & 9 deletions fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.1-fpm-alpine
FROM php:7.2-fpm-alpine

LABEL maintainer="[email protected]"

Expand All @@ -8,7 +8,6 @@ RUN set -ex; \
$PHPIZE_DEPS \
autoconf \
freetype-dev \
geoip-dev \
icu-dev \
libjpeg-turbo-dev \
libpng-dev \
Expand All @@ -28,13 +27,11 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.12; \
pecl install geoip-1.1.1; \
pecl install APCu-5.1.17; \
pecl install redis-3.1.6; \
\
docker-php-ext-enable \
apcu \
geoip \
redis \
; \
\
Expand All @@ -47,7 +44,7 @@ RUN set -ex; \
apk add --virtual .piwik-phpext-rundeps $runDeps; \
apk del .build-deps

ENV MATOMO_VERSION 3.6.1
ENV MATOMO_VERSION 3.8.1

RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
Expand All @@ -59,7 +56,7 @@ RUN set -ex; \
curl -fsSL -o piwik.tar.gz.asc \
"https://builds.matomo.org/piwik-${MATOMO_VERSION}.tar.gz.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --verify piwik.tar.gz.asc piwik.tar.gz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" piwik.tar.gz.asc; \
Expand All @@ -70,8 +67,15 @@ RUN set -ex; \
COPY php.ini /usr/local/etc/php/conf.d/php-piwik.ini

RUN set -ex; \
curl -fsSL -o /usr/src/piwik/misc/GeoIPCity.dat.gz https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz; \
gunzip /usr/src/piwik/misc/GeoIPCity.dat.gz
curl -fsSL -o GeoIPCity.tar.gz \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"; \
curl -fsSL -o GeoIPCity.tar.gz.md5 \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz.md5"; \
echo "$(cat GeoIPCity.tar.gz.md5) GeoIPCity.tar.gz" | md5sum -c -; \
mkdir /usr/src/GeoIPCity; \
tar -xf GeoIPCity.tar.gz -C /usr/src/GeoIPCity --strip-components=1; \
mv /usr/src/GeoIPCity/GeoLite2-City.mmdb /usr/src/piwik/misc/GeoLite2-City.mmdb; \
rm -rf GeoIPCity*

COPY docker-entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 13 additions & 9 deletions fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.1-fpm
FROM php:7.2-fpm

LABEL maintainer="[email protected]"

Expand All @@ -9,7 +9,6 @@ RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libgeoip-dev \
libjpeg-dev \
libldap2-dev \
libpng-dev \
Expand All @@ -28,13 +27,11 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.12; \
pecl install geoip-1.1.1; \
pecl install APCu-5.1.17; \
pecl install redis-3.1.6; \
\
docker-php-ext-enable \
apcu \
geoip \
redis \
; \
\
Expand All @@ -52,7 +49,7 @@ RUN set -ex; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

ENV MATOMO_VERSION 3.6.1
ENV MATOMO_VERSION 3.8.1

RUN set -ex; \
fetchDeps=" \
Expand All @@ -69,7 +66,7 @@ RUN set -ex; \
curl -fsSL -o piwik.tar.gz.asc \
"https://builds.matomo.org/piwik-${MATOMO_VERSION}.tar.gz.asc"; \
export GNUPGHOME="$(mktemp -d)"; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237; \
gpg --batch --verify piwik.tar.gz.asc piwik.tar.gz; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME" piwik.tar.gz.asc; \
Expand All @@ -81,8 +78,15 @@ RUN set -ex; \
COPY php.ini /usr/local/etc/php/conf.d/php-piwik.ini

RUN set -ex; \
curl -fsSL -o /usr/src/piwik/misc/GeoIPCity.dat.gz https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz; \
gunzip /usr/src/piwik/misc/GeoIPCity.dat.gz
curl -fsSL -o GeoIPCity.tar.gz \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"; \
curl -fsSL -o GeoIPCity.tar.gz.md5 \
"https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz.md5"; \
echo "$(cat GeoIPCity.tar.gz.md5) GeoIPCity.tar.gz" | md5sum -c -; \
mkdir /usr/src/GeoIPCity; \
tar -xf GeoIPCity.tar.gz -C /usr/src/GeoIPCity --strip-components=1; \
mv /usr/src/GeoIPCity/GeoLite2-City.mmdb /usr/src/piwik/misc/GeoLite2-City.mmdb; \
rm -rf GeoIPCity*

COPY docker-entrypoint.sh /entrypoint.sh

Expand Down

0 comments on commit 9dc87cb

Please sign in to comment.