From 8a3635b7d45659e66331a8b73cc681cce84c6a07 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sat, 21 Dec 2019 14:15:46 +0100 Subject: [PATCH 1/4] Add ext-meminfo to PHP 7.4 images --- .hadolint.yaml | 5 +---- Dockerfile-nts | 6 ++---- Dockerfile-zts | 6 ++---- test/container/test_php_dev.py | 4 ++-- test/container/test_php_ext.py | 2 +- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index b89ea081..17229482 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -6,7 +6,4 @@ ignored: - DL3022 - DL3019 - SC2006 - - DL3013 # So we can install the latest docker-compose - - SC2126 - - DL4006 - - DL3003 \ No newline at end of file + - DL3013 # So we can install the latest docker-compose \ No newline at end of file diff --git a/Dockerfile-nts b/Dockerfile-nts index 02c516a6..63977b77 100644 --- a/Dockerfile-nts +++ b/Dockerfile-nts @@ -16,9 +16,7 @@ RUN sha256sum /uv.so FROM php:7.4-cli-alpine3.10 AS build-meminfo RUN apk update && \ apk add --no-cache $PHPIZE_DEPS git libuv-dev && \ - git clone https://github.com/tony2001/php-meminfo.git && \ - cd php-meminfo && \ - git checkout -b php74_support origin/php74_support + git clone https://github.com/BitOne/php-meminfo.git WORKDIR /php-meminfo/extension/php7 RUN phpize RUN ./configure --enable-meminfo @@ -104,7 +102,7 @@ RUN true RUN EXTENSION_DIR=`php-config --extension-dir 2>/dev/null` \ && mv /*.so "$EXTENSION_DIR/" \ - && if [ $(php -v | grep 7.4 | wc -l) != 0 ] ; then rm "$EXTENSION_DIR/meminfo.so"; else docker-php-ext-enable meminfo; fi \ + && docker-php-ext-enable meminfo \ && apk add --no-cache \ make \ git \ diff --git a/Dockerfile-zts b/Dockerfile-zts index b513dfd0..979efbe7 100644 --- a/Dockerfile-zts +++ b/Dockerfile-zts @@ -30,9 +30,7 @@ RUN sha256sum /uv.so FROM php:7.4-zts-alpine3.10 AS build-meminfo RUN apk update && \ apk add --no-cache $PHPIZE_DEPS git libuv-dev && \ - git clone https://github.com/tony2001/php-meminfo.git && \ - cd php-meminfo && \ - git checkout -b php74_support origin/php74_support + git clone https://github.com/BitOne/php-meminfo.git WORKDIR /php-meminfo/extension/php7 RUN phpize RUN ./configure --enable-meminfo @@ -125,7 +123,7 @@ RUN true RUN EXTENSION_DIR=`php-config --extension-dir 2>/dev/null` \ && mv /*.so "$EXTENSION_DIR/" \ - && if [ $(php -v | grep 7.4 | wc -l) != 0 ] ; then rm "$EXTENSION_DIR/meminfo.so"; else docker-php-ext-enable meminfo; fi \ + && docker-php-ext-enable meminfo \ && apk add --no-cache \ make \ git \ diff --git a/test/container/test_php_dev.py b/test/container/test_php_dev.py index 1544ba42..639255bd 100644 --- a/test/container/test_php_dev.py +++ b/test/container/test_php_dev.py @@ -24,7 +24,7 @@ def test_configuration_is_not_effective(host): @pytest.mark.php_dev def test_php_meminfo_is_enabled(host): - output = host.run('if [ $(php -v | grep 7.4 | wc -l) != 0 ] ; then php -r "echo(\'meminfo\');"; else php -r "exit(function_exists(\'meminfo_dump\') ? 0 : 255);"; fi') + output = host.run('php -r "exit(function_exists(\'meminfo_dump\') ? 0 : 255);') assert output.rc == 0 @pytest.mark.php_no_dev @@ -34,6 +34,6 @@ def test_php_meminfo_is_not_enabled(host): @pytest.mark.php_dev def test_php_ext_meminfo_is_functional(host): - output = host.run('if [ $(php -v | grep 7.4 | wc -l) != 0 ] ; then php -r "echo(\'meminfo\');"; else php /tests/container/functional/meminfo.php; fi') + output = host.run('php /tests/container/functional/meminfo.php') assert output.stdout == 'meminfo' assert output.rc == 0 diff --git a/test/container/test_php_ext.py b/test/container/test_php_ext.py index 980f0bf8..4e678fde 100644 --- a/test/container/test_php_ext.py +++ b/test/container/test_php_ext.py @@ -22,7 +22,7 @@ def test_iconv_is_loaded(host): @pytest.mark.php_dev def test_meminfo_is_loaded(host): - assert 'meminfo' in host.run('if [ $(php -v | grep 7.4 | wc -l) != 0 ] ; then echo "meminfo"; else php -m; fi').stdout + assert 'meminfo' in host.run('php -m').stdout @pytest.mark.php_zts def test_parallel_is_loaded(host): From 3c067f173c7062a023a3a4575d33898f279e6b6c Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 23 Dec 2019 10:42:25 +0100 Subject: [PATCH 2/4] TMP --- Dockerfile-nts | 4 +++- Dockerfile-zts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile-nts b/Dockerfile-nts index 63977b77..cd312432 100644 --- a/Dockerfile-nts +++ b/Dockerfile-nts @@ -16,7 +16,9 @@ RUN sha256sum /uv.so FROM php:7.4-cli-alpine3.10 AS build-meminfo RUN apk update && \ apk add --no-cache $PHPIZE_DEPS git libuv-dev && \ - git clone https://github.com/BitOne/php-meminfo.git + git clone https://github.com/tony2001/php-meminfo.git && \ + cd php-meminfo && \ + git checkout -b php74_support origin/php74_support WORKDIR /php-meminfo/extension/php7 RUN phpize RUN ./configure --enable-meminfo diff --git a/Dockerfile-zts b/Dockerfile-zts index 979efbe7..03573065 100644 --- a/Dockerfile-zts +++ b/Dockerfile-zts @@ -30,7 +30,9 @@ RUN sha256sum /uv.so FROM php:7.4-zts-alpine3.10 AS build-meminfo RUN apk update && \ apk add --no-cache $PHPIZE_DEPS git libuv-dev && \ - git clone https://github.com/BitOne/php-meminfo.git + git clone https://github.com/tony2001/php-meminfo.git && \ + cd php-meminfo && \ + git checkout -b php74_support origin/php74_support WORKDIR /php-meminfo/extension/php7 RUN phpize RUN ./configure --enable-meminfo From fff72cd842a2251fa27ca921c188198f4cbd8c24 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 23 Dec 2019 10:43:32 +0100 Subject: [PATCH 3/4] TMP --- .hadolint.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 17229482..9e900c9a 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -6,4 +6,5 @@ ignored: - DL3022 - DL3019 - SC2006 - - DL3013 # So we can install the latest docker-compose \ No newline at end of file + - DL3013 # So we can install the latest docker-compose + - DL3003 \ No newline at end of file From 6142ad48cbab1e40ce70287432e76759ba8c470f Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 23 Dec 2019 11:27:21 +0100 Subject: [PATCH 4/4] Missing "" --- test/container/test_php_dev.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/container/test_php_dev.py b/test/container/test_php_dev.py index 639255bd..c6b05ced 100644 --- a/test/container/test_php_dev.py +++ b/test/container/test_php_dev.py @@ -24,7 +24,7 @@ def test_configuration_is_not_effective(host): @pytest.mark.php_dev def test_php_meminfo_is_enabled(host): - output = host.run('php -r "exit(function_exists(\'meminfo_dump\') ? 0 : 255);') + output = host.run('php -r "exit(function_exists(\'meminfo_dump\') ? 0 : 255);"') assert output.rc == 0 @pytest.mark.php_no_dev