Skip to content

Commit bc3581d

Browse files
authored
Merge pull request #172 from bryanlatten/dep-unlock
Dep unlock
2 parents 91880ae + bc52752 commit bc3581d

18 files changed

Lines changed: 156 additions & 113 deletions

File tree

.test.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CFG_APP_DEBUG=1
2+
SERVER_LOG_MINIMAL=1
3+
PHP_FPM_MEMORY_LIMIT=257M
4+
PHP_FPM_MAX_EXECUTION_TIME=61
5+
PHP_FPM_UPLOAD_MAX_FILESIZE=100M
6+
SERVER_MAX_BODY_SIZE=100m
7+
SERVER_APP_NAME=docker-test
8+
REPLACE_NEWRELIC_APP=abcdefg
9+
REPLACE_NEWRELIC_LICENSE=hijklmno
10+
S6_KILL_FINISH_MAXTIME=1
11+
S6_KILL_GRACETIME=1

.travis.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
sudo: required
22

33
env:
4-
DOCKER_COMPOSE_VERSION: 1.17.1
5-
GOSS_PATH: ./goss
4+
- PHP_VARIANT=7.0
5+
- PHP_VARIANT=7.1
6+
- PHP_VARIANT=7.2
7+
- PHP_VARIANT=7.3
8+
- PHP_VARIANT=7.3-alpine
9+
- PHP_VARIANT=7.4
610

711
services:
812
- docker
913

1014
before_install:
11-
- sudo rm /usr/local/bin/docker-compose
12-
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
13-
- chmod +x docker-compose
14-
- sudo mv docker-compose /usr/local/bin
1515
- curl -L https://raw.githubusercontent.com/aelsabbahy/goss/master/extras/dgoss/dgoss -o dgoss
16-
- curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.6/goss-linux-amd64 -o goss
16+
- curl -L https://github.com/aelsabbahy/goss/releases/download/v0.3.9/goss-linux-amd64 -o goss
1717
- chmod 755 dgoss goss
1818

19-
# - Build and run all variants
20-
# - Ensure text from phpinfo is present in default response
21-
# - Create a 98MB tmp file
22-
# - Upload file to each variant
23-
# - Ensure text from phpinfo is present in response to upload, which is returned for everything
24-
# ---- mainly to check /tmp permission issues from nginx
2519
script:
26-
- bash ./test.sh localhost
20+
- ./test.sh localhost

Dockerfile-70 renamed to Dockerfile-7.0

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ RUN /bin/bash -e /security_updates.sh && \
5151
&& \
5252
/bin/bash /clean.sh
5353

54-
# Add PHP and support packages \
54+
# Add PHP and support packages
55+
COPY container/root/usr/local/bin/pecl-install /usr/local/bin
5556
RUN apt-get update -q && \
5657
# Ensure PHP 5.5 + 5.6 + 7.1 don't accidentally get added by PPA
5758
apt-mark hold \
@@ -67,6 +68,9 @@ RUN apt-get update -q && \
6768
php7.3-cli \
6869
php7.3-common \
6970
php7.3-json \
71+
php7.4-cli \
72+
php7.4-common \
73+
php7.4-json \
7074
&& \
7175
apt-get -yqq install \
7276
php7.0 \
@@ -103,10 +107,12 @@ RUN apt-get update -q && \
103107
rm -rf /usr/lib/php/20131226 && \
104108
rm -rf /usr/lib/php/20160303 && \
105109
rm -rf /usr/lib/php/20170718 && \
110+
rm -rf /usr/lib/php/20180731 && \
111+
rm -rf /usr/lib/php/20190902 && \
106112
curl -sS https://getcomposer.org/installer | php && \
107113
mv composer.phar /usr/local/bin/composer && \
108114
# Install new PHP7-stable version of Redis \
109-
pecl install redis-4.2.0 && \
115+
pecl install redis && \
110116
echo "extension=redis.so" > $CONF_PHPMODS/redis.ini && \
111117
# Remove dev packages that were only in place just to compile extensions
112118
apt-get remove --purge -yq \

Dockerfile-71 renamed to Dockerfile-7.1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ RUN /bin/bash -e /security_updates.sh && \
5151
&& \
5252
/bin/bash /clean.sh
5353

54-
# Add PHP and support packages \
54+
# Add PHP and support packages
55+
COPY container/root/usr/local/bin/pecl-install /usr/local/bin
5556
RUN apt-get update -q && \
5657
# Ensure PHP 5.5 + 5.6 + 7.0 don't accidentally get added by PPA
5758
apt-mark hold \
@@ -67,6 +68,9 @@ RUN apt-get update -q && \
6768
php7.3-cli \
6869
php7.3-common \
6970
php7.3-json \
71+
php7.4-cli \
72+
php7.4-common \
73+
php7.4-json \
7074
&& \
7175
apt-get -yqq install \
7276
php7.1 \
@@ -103,11 +107,14 @@ RUN apt-get update -q && \
103107
rm -rf /usr/lib/php/20131226 && \
104108
rm -rf /usr/lib/php/20151012 && \
105109
rm -rf /usr/lib/php/20170718 && \
110+
rm -rf /usr/lib/php/20180731 && \
111+
rm -rf /usr/lib/php/20190902 && \
106112
curl -sS https://getcomposer.org/installer | php && \
107113
mv composer.phar /usr/local/bin/composer && \
108-
# Install new PHP 7.1-stable version of Redis
109-
pecl install redis-4.2.0 && \
110-
echo "extension=redis.so" > $CONF_PHPMODS/redis.ini && \
114+
# Install new stable versions of non-packaged extensions
115+
pecl-install \
116+
redis \
117+
&& \
111118
# Remove dev packages that were only in place just to compile extensions
112119
apt-get remove --purge -yq \
113120
php7.1-dev \

Dockerfile-72 renamed to Dockerfile-7.2

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ RUN /bin/bash -e /security_updates.sh && \
5151
&& \
5252
/bin/bash /clean.sh
5353

54-
# TODO: fix these packages:
55-
# php7.2-mcrypt
56-
57-
# Add PHP and support packages \
54+
# Add PHP and support packages
55+
COPY container/root/usr/local/bin/pecl-install /usr/local/bin
5856
RUN apt-get update -q && \
5957
# Ensure PHP 5.5 + 5.6 + 7.1 don't accidentally get added by PPA
6058
apt-mark hold \
@@ -70,6 +68,9 @@ RUN apt-get update -q && \
7068
php7.3-cli \
7169
php7.3-common \
7270
php7.3-json \
71+
php7.4-cli \
72+
php7.4-common \
73+
php7.4-json \
7374
&& \
7475
apt-get -yqq install \
7576
php7.2 \
@@ -106,11 +107,14 @@ RUN apt-get update -q && \
106107
rm -rf /usr/lib/php/20131226 && \
107108
rm -rf /usr/lib/php/20151012 && \
108109
rm -rf /usr/lib/php/20160303 && \
110+
rm -rf /usr/lib/php/20180731 && \
111+
rm -rf /usr/lib/php/20190902 && \
109112
curl -sS https://getcomposer.org/installer | php && \
110113
mv composer.phar /usr/local/bin/composer && \
111-
# Install new PHP 7.X-stable version of Redis
112-
pecl install redis-4.2.0 && \
113-
echo "extension=redis.so" > $CONF_PHPMODS/redis.ini && \
114+
# Install new stable versions of non-packaged extensions
115+
pecl-install \
116+
redis \
117+
&& \
114118
# Remove dev packages that were only in place just to compile extensions
115119
apt-get remove --purge -yq \
116120
php7.2-dev \

Dockerfile-73 renamed to Dockerfile-7.3

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ RUN /bin/bash -e /security_updates.sh && \
5151
&& \
5252
/bin/bash /clean.sh
5353

54-
# TODO: fix these packages:
55-
# php7.3-mcrypt
56-
57-
# Add PHP and support packages \
54+
# Add PHP and support packages
55+
COPY container/root/usr/local/bin/pecl-install /usr/local/bin
5856
RUN apt-get update -q && \
5957
# Ensure PHP 5.5 + 5.6 + 7.1 don't accidentally get added by PPA
6058
apt-mark hold \
@@ -70,10 +68,13 @@ RUN apt-get update -q && \
7068
php7.2-cli \
7169
php7.2-common \
7270
php7.2-json \
71+
php7.4-cli \
72+
php7.4-common \
73+
php7.4-json \
7374
&& \
7475
apt-get -yqq install \
7576
php7.3 \
76-
# php7.3-apcu \
77+
php7.3-apcu \
7778
php7.3-bcmath \
7879
php7.3-bz2 \
7980
php7.3-curl \
@@ -107,14 +108,13 @@ RUN apt-get update -q && \
107108
rm -rf /usr/lib/php/20151012 && \
108109
rm -rf /usr/lib/php/20160303 && \
109110
rm -rf /usr/lib/php/20170718 && \
111+
rm -rf /usr/lib/php/20190902 && \
110112
curl -sS https://getcomposer.org/installer | php && \
111113
mv composer.phar /usr/local/bin/composer && \
112-
# Install new stable versions of non-packages extensions
113-
pecl install apcu && \
114-
echo "extension=apcu.so" > $CONF_PHPMODS/apcu.ini && \
115-
phpenmod apcu && \
116-
pecl install redis-4.2.0 && \
117-
echo "extension=redis.so" > $CONF_PHPMODS/redis.ini && \
114+
# Install new stable versions of non-packaged extensions
115+
pecl-install \
116+
redis \
117+
&& \
118118
# Remove dev packages that were only in place just to compile extensions
119119
apt-get remove --purge -yq \
120120
php7.3-dev \
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ RUN NEWRELIC_MUSL_PATH=$(curl -s https://download.newrelic.com/php_agent/release
9797
cd $NEWRELIC_DIRECTORY && \
9898
echo "\n" | ./newrelic-install install && \
9999
chown root:root $NEWRELIC_DIRECTORY/agent/x64/newrelic-20160303.so && \
100-
mv $NEWRELIC_DIRECTORY/agent/x64/newrelic-20170718.so /usr/lib/php7/modules/newrelic.so && \
100+
mv $NEWRELIC_DIRECTORY/agent/x64/newrelic-20180731.so /usr/lib/php7/modules/newrelic.so && \
101101
rm -rf $NEWRELIC_DIRECTORY/agent/x64 && \
102102
# Fix permissions on extracted folder \
103103
chown -R $NOT_ROOT_USER:$NOT_ROOT_USER * && \
@@ -117,15 +117,15 @@ RUN apk update && \
117117
autoconf file g++ gcc libc-dev make pkgconf re2c php7-dev php7-pear \
118118
&& \
119119
sed -i 's/^exec $PHP -C -n/exec $PHP -C/g' $(which pecl) && \
120-
pecl install igbinary-3.0.1 && \
120+
pecl install igbinary && \
121121
echo "extension=igbinary.so" > $CONF_PHPMODS/igbinary.ini && \
122-
pecl install yaml-2.0.4 && \
122+
pecl install yaml && \
123123
echo ";extension=yaml.so" > $CONF_PHPMODS/yaml.ini && \
124-
pecl install redis-4.2.0 && \
124+
pecl install redis && \
125125
echo ";extension=redis.so" > $CONF_PHPMODS/redis.ini && \
126-
pecl install msgpack-2.0.3 && \
126+
pecl install msgpack && \
127127
echo "extension=msgpack.so" > $CONF_PHPMODS/msgpack.ini && \
128-
pecl install memcached-3.1.3 && \
128+
pecl install memcached && \
129129
echo "extension=memcached.so" > $CONF_PHPMODS/memcached.ini && \
130130
rm -rf /usr/share/php7 && \
131131
apk del .phpize_deps && \
@@ -142,5 +142,5 @@ RUN cp /etc/php/7.0/mods-available/* $CONF_PHPMODS && \
142142
ln -s /usr/sbin/php-fpm7 /usr/sbin/php-fpm && \
143143
/bin/bash -e prep-php.sh
144144

145-
RUN goss -g /tests/php-fpm/7.2-alpine.goss.yaml validate && \
145+
RUN goss -g /tests/php-fpm/7.3-alpine.goss.yaml validate && \
146146
/aufs_hack.sh

Dockerfile-74 renamed to Dockerfile-7.4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ RUN apt-get update -q && \
114114
rm -rf /usr/lib/php/7.3 && \
115115
curl -sS https://getcomposer.org/installer | php && \
116116
mv composer.phar /usr/local/bin/composer && \
117-
# Install new stable versions of non-packages extensions
117+
# Install new stable versions of non-packaged extensions
118118
pecl-install \
119119
apcu \
120120
igbinary \

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Available on [Docker Hub](https://hub.docker.com/r/behance/docker-php/).
1616
- `docker run behance/docker-php:7.0 "php" "-v"`
1717
- `docker run behance/docker-php:7.1 "php" "-v"`
1818
- `docker run behance/docker-php:7.2 "php" "-v"`
19-
- `docker run behance/docker-php:7.2-alpine "php" "-v"`
19+
- `docker run behance/docker-php:7.3-alpine "php" "-v"`
2020
- `docker run behance/docker-php:7.3" "php" "-v"`
21+
- `docker run behance/docker-php:7.4" "php" "-v"`
2122

2223
Adding code to runtime, see [here](https://github.com/behance/docker-php#expectations).
2324
PHP tuning and configuration, see [here](https://github.com/behance/docker-php#downstream-configuration).
@@ -26,9 +27,9 @@ Adding startup logic, [basic](https://github.com/behance/docker-base#startuprunt
2627

2728
#### Container tag scheme: `PHP_MAJOR.PHP_MINOR(-Major.Minor.Patch)(-variant)`
2829

29-
- `PHP_MAJOR.PHP_MINOR`, required. Engine versions of PHP. ex. `docker-php:7.1`
30-
- `(Major.Minor.Patch)`, optional. Semantically versioned container provisioning code. ex. `docker-php:7.1-12.4.0`.
31-
- `(-variant)`, optional. Alpine variants are slim versions of the container. ex. `docker-php:7.1-alpine`.
30+
- `PHP_MAJOR.PHP_MINOR`, required. Engine versions of PHP. ex. `docker-php:7.4`
31+
- `(Major.Minor.Patch)`, optional. Semantically versioned container provisioning code. ex. `docker-php:7.3-13.4.0`.
32+
- `(-variant)`, optional. Alpine variants are slim versions of the container. ex. `docker-php:7.3-alpine`.
3233

3334
### Includes
3435
---
@@ -43,8 +44,7 @@ Adding startup logic, [basic](https://github.com/behance/docker-base#startuprunt
4344
For extension customization, including enabling and disabling defaults, see [here](https://github.com/behance/docker-php#downstream-configuration)
4445

4546
`^` - not available on `-alpine` variant
46-
`*` - not available on `7.2`
47-
`**` - not available on `7.3`
47+
`*` - not available on `7.2+`
4848
`~` - disabled by default
4949

5050
- apcu
@@ -63,7 +63,7 @@ For extension customization, including enabling and disabling defaults, see [her
6363
- intl
6464
- json
6565
- mbstring
66-
- mcrypt *,**
66+
- mcrypt *
6767
- memcache ^
6868
- memcached
6969
- msgpack
@@ -87,7 +87,7 @@ For extension customization, including enabling and disabling defaults, see [her
8787
- sysvsem
8888
- sysvshm
8989
- tokenizer
90-
- xdebug ~,*,**
90+
- xdebug ~,*
9191
- xml
9292
- xmlreader
9393
- xmlwriter
@@ -102,10 +102,10 @@ For extension customization, including enabling and disabling defaults, see [her
102102

103103
Sample `Dockerfile`
104104
```
105-
FROM behance/docker-php:7.1
105+
FROM behance/docker-php:7.4
106106
107107
# (optional, recommended) Verify everything is in order from the parent
108-
RUN goss -g /tests/php-fpm/7.1.goss.yaml validate && /aufs_hack.sh
108+
RUN goss -g /tests/php-fpm/7.4.goss.yaml validate && /aufs_hack.sh
109109
110110
# Layer local code into runtime
111111
COPY ./ /app/
@@ -208,14 +208,15 @@ PHP_FPM_LOG_BUFFERING | PHP_FPM_LOG_BUFFERING=no | yes | Experimental, PHP 7.3-o
208208

209209
### Testing
210210
---
211-
- Requires `docker` and `docker-compose`
211+
- Requires `docker`, `docker-compose`, and `dgoss`
212+
213+
To test locally, run `PHP_VARIANT=7.4 ./test.sh {docker engine IP}`.
212214

213-
To test locally, run `bash -e ./test.sh {docker-machine}` where `docker-machine` is the IP of the connected docker engine.
214215
This will:
215-
- Build all variants and engine versions.
216-
- [Goss](https://goss.rocks) runs at the end of each container build, confirming package, config, and extension installation.
217-
- Run each built container, check the default output from its live service.
218-
- Perform a large file upload
216+
- Build a single container `PHP_VARIANT` (7.0, 7.1, 7.2, 7.3, 7.3-alpine, 7.4)
217+
- Leverages [Goss](https://goss.rocks) to confirm package, config, and extension installation
218+
- Validates a large file upload
219+
- Boots container with specific NewRelic configuration overrides
219220

220-
These same tests get run automatically, per pull request, via Travis CI
221+
The test matrix is run automatically per pull request on Travis CI.
221222

container/root/tests/php-fpm/7.2-alpine.goss.yaml renamed to container/root/tests/php-fpm/7.3-alpine.goss.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ command:
88
stdout: [7]
99
php -r 'echo PHP_MINOR_VERSION;':
1010
exit-status: 0
11-
stdout: [2]
11+
stdout: [3]
1212
php-fpm7 -m:
1313
exit-status: 0
1414
stderr: ['!/./']
1515
php-fpm7 -v:
1616
exit-status: 0
17-
stdout: [PHP 7.2]
17+
stdout: [PHP 7.3]

0 commit comments

Comments
 (0)