From 4ff30331f1906412e4d00cb53d5143e90dd8e9be Mon Sep 17 00:00:00 2001 From: Mateus Dutra Dadalto Date: Tue, 2 Aug 2022 19:45:56 -0300 Subject: [PATCH 1/3] build: create php-cli images (#59) --- .github/workflows/docker-images.yml | 17 +++++- php/7.2/alpine-cli/Dockerfile | 41 +++++++++++++ php/7.2/alpine-cli/conf/php.ini | 89 +++++++++++++++++++++++++++++ php/7.3/alpine-cli/Dockerfile | 40 +++++++++++++ php/7.3/alpine-cli/conf/php.ini | 84 +++++++++++++++++++++++++++ php/7.4/alpine-cli/Dockerfile | 41 +++++++++++++ php/7.4/alpine-cli/conf/php.ini | 84 +++++++++++++++++++++++++++ 7 files changed, 394 insertions(+), 2 deletions(-) create mode 100644 php/7.2/alpine-cli/Dockerfile create mode 100644 php/7.2/alpine-cli/conf/php.ini create mode 100644 php/7.3/alpine-cli/Dockerfile create mode 100644 php/7.3/alpine-cli/conf/php.ini create mode 100644 php/7.4/alpine-cli/Dockerfile create mode 100644 php/7.4/alpine-cli/conf/php.ini diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 05a9333..5060e63 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -31,7 +31,12 @@ jobs: run: docker build ./php/${{ matrix.php }}/alpine-develop-xdebug -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug - + + - name: Build the graycore/magento-php:${{ matrix.php }}-cli-alpine image + run: docker build ./php/${{ matrix.php }}/alpine-cli + -t graycore/magento-php:${{ matrix.php }}-cli-alpine-${GITHUB_REF##*/} + -t graycore/magento-php:${{ matrix.php }}-cli-alpine + - name: Login to registry run: docker login -u $DOCKER_USER -p $DOCKER_PASS if: ${{ github.event_name == 'release' }} @@ -61,7 +66,15 @@ jobs: - name: Publish tag graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} image if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} + run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} + + - name: Publish latest graycore/magento-php:${{ matrix.php }}-cli-alpine image + if: ${{ github.event_name == 'release' }} + run: docker push graycore/magento-php:${{ matrix.php }}-cli-alpine + + - name: Publish tag graycore/magento-php:${{ matrix.php }}-cli-alpine-${GITHUB_REF##*/} image + if: ${{ github.event_name == 'release' }} + run: docker push graycore/magento-php:${{ matrix.php }}-cli-alpine-${GITHUB_REF##*/} build-nginx: strategy: matrix: diff --git a/php/7.2/alpine-cli/Dockerfile b/php/7.2/alpine-cli/Dockerfile new file mode 100644 index 0000000..7f64c7b --- /dev/null +++ b/php/7.2/alpine-cli/Dockerfile @@ -0,0 +1,41 @@ +FROM php:7.2-cli-alpine + +LABEL maintainer="damien@graycore.io" + +RUN apk add --no-cache \ + gzip \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + libxslt-dev \ + lsof \ + curl-dev \ + libsodium-dev \ + mysql-client \ + procps \ + zip + +# https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html#required-php-extensions +# This layer must be run as one, not two - See: https://github.com/docker-library/php/issues/855 +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install \ + bcmath \ + gd \ + intl \ + opcache \ + pdo_mysql \ + soap \ + xsl \ + zip \ + sockets + +RUN curl -sS https://getcomposer.org/installer | \ + php -- --install-dir=/usr/local/bin --filename=composer && \ + composer self-update --1 + +COPY conf/php.ini /usr/local/etc/php/ + +RUN chmod 775 /var/www/html && chown root:root /var/www/html + +WORKDIR /var/www/html \ No newline at end of file diff --git a/php/7.2/alpine-cli/conf/php.ini b/php/7.2/alpine-cli/conf/php.ini new file mode 100644 index 0000000..442eb56 --- /dev/null +++ b/php/7.2/alpine-cli/conf/php.ini @@ -0,0 +1,89 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Stock PHP Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. +; Value "stderr" sends the errors to stderr instead of stdout. +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. +log_errors = On + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This sets the maximum amount of memory in bytes that a script is allowed to allocate. +; This helps prevent poorly written scripts for eating up all available memory on a server. +; Note that to have no memory limit, set this directive to -1. +memory_limit = 4G + +; This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. +; This helps prevent poorly written scripts from tying up the server. +; The default setting is 30. When running PHP from the command line the default setting is 0. +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +max_input_time = 30 + +; The maximum size of an uploaded file. When an integer is used, the value is measured in bytes. +; Shorthand notation may also be used. +upload_max_filesize = 20M + +; Sets max size of post data allowed. This setting also affects file upload. To upload large files, +; this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be +; larger than post_max_size. When an integer is used, the value is measured in bytes. Shorthand notation may also be used. +post_max_size = 20M + +; Whether to transparently compress pages. If this option is set to "On" in php.ini or the Apache configuration, +; pages are compressed if the browser sends an "Accept-Encoding: gzip" or "deflate" header. +; "Content-Encoding: gzip" (respectively "deflate") and "Vary: Accept-Encoding" headers are added to the output. +zlib.output_compression = On + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPcache Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Determines if Zend OPCache is enabled +opcache.enable = 1 + +; The maximum number of keys (and therefore scripts) in the OPcache hash table. +; The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 } +; that is greater than or equal to the configured value. The minimum value is 200. +; The maximum value is 1000000. Values outside of this range are clamped to the permissible range. +; +; After running some tests on Magento 2 instances, the typical file count is around 30000. We use double, just in case. +opcache.max_accelerated_files = 65407 + +; When enabled, the opcode cache will be checked for whether a file has already been cached when file_exists(), is_file() and is_readable() are called. +; This may increase performance in applications that check the existence and readability of PHP scripts, but risks returning stale data if opcache.validate_timestamps is disabled. +opcache.enable_file_override = 1 + +;The amount of memory used to store interned strings, in megabytes. +opcache.interned_strings_buffer = 32 + +; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set. +opcache.memory_consumption = 200 + +; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request. +; This configuration directive is ignored if opcache.validate_timestamps is disabled. + +; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds. When this directive is disabled, you must reset OPcache manually via opcache_reset(), +; opcache_invalidate() or by restarting the Web server for changes to the filesystem to take effect. +; +; Since we're using a dockerized environment, we're assuming that the final environment is immutable, and therefore validating timestamps +; is unnecessary. +opcache.validate_timestamps = 0 + +; If disabled, all documentation comments will be discarded from the opcode cache to reduce the size of the optimised code. +; Disabling this configuration directive may break applications and frameworks that rely on comment parsing for annotations, +; including Doctrine, Zend Framework 2, PHPUnit, and Magento 2. +opcache.save_comments = 1 \ No newline at end of file diff --git a/php/7.3/alpine-cli/Dockerfile b/php/7.3/alpine-cli/Dockerfile new file mode 100644 index 0000000..3c36333 --- /dev/null +++ b/php/7.3/alpine-cli/Dockerfile @@ -0,0 +1,40 @@ +FROM php:7.3-cli-alpine + +LABEL maintainer="damien@graycore.io" + +RUN apk add --no-cache \ + gzip \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + libxslt-dev \ + lsof \ + curl-dev \ + libsodium-dev \ + libzip-dev \ + mysql-client \ + procps + +# https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html#required-php-extensions +# This layer must be run as one, not two - See: https://github.com/docker-library/php/issues/855 +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install \ + bcmath \ + gd \ + intl \ + opcache \ + pdo_mysql \ + soap \ + xsl \ + zip \ + sockets + +RUN curl -sS https://getcomposer.org/installer | \ + php -- --install-dir=/usr/local/bin --filename=composer + +COPY conf/php.ini /usr/local/etc/php/ + +RUN chmod 775 /var/www/html && chown root:root /var/www/html + +WORKDIR /var/www/html \ No newline at end of file diff --git a/php/7.3/alpine-cli/conf/php.ini b/php/7.3/alpine-cli/conf/php.ini new file mode 100644 index 0000000..db31a66 --- /dev/null +++ b/php/7.3/alpine-cli/conf/php.ini @@ -0,0 +1,84 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Stock PHP Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. +; Value "stderr" sends the errors to stderr instead of stdout. +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. +log_errors = On + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This sets the maximum amount of memory in bytes that a script is allowed to allocate. +; This helps prevent poorly written scripts for eating up all available memory on a server. +; Note that to have no memory limit, set this directive to -1. +memory_limit = 4G + +; This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. +; This helps prevent poorly written scripts from tying up the server. +; The default setting is 30. When running PHP from the command line the default setting is 0. +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +max_input_time = 30 + +; The maximum size of an uploaded file. When an integer is used, the value is measured in bytes. +; Shorthand notation may also be used. +upload_max_filesize = 20M + +; Sets max size of post data allowed. This setting also affects file upload. To upload large files, +; this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be +; larger than post_max_size. When an integer is used, the value is measured in bytes. Shorthand notation may also be used. +post_max_size = 20M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPcache Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Determines if Zend OPCache is enabled +opcache.enable = 1 + +; The maximum number of keys (and therefore scripts) in the OPcache hash table. +; The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 } +; that is greater than or equal to the configured value. The minimum value is 200. +; The maximum value is 1000000. Values outside of this range are clamped to the permissible range. +; +; After running some tests on Magento 2 instances, the typical file count is around 30000. We use double, just in case. +opcache.max_accelerated_files = 65407 + +; When enabled, the opcode cache will be checked for whether a file has already been cached when file_exists(), is_file() and is_readable() are called. +; This may increase performance in applications that check the existence and readability of PHP scripts, but risks returning stale data if opcache.validate_timestamps is disabled. +opcache.enable_file_override = 1 + +;The amount of memory used to store interned strings, in megabytes. +opcache.interned_strings_buffer = 32 + +; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set. +opcache.memory_consumption = 200 + +; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request. +; This configuration directive is ignored if opcache.validate_timestamps is disabled. + +; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds. When this directive is disabled, you must reset OPcache manually via opcache_reset(), +; opcache_invalidate() or by restarting the Web server for changes to the filesystem to take effect. +; +; Since we're using a dockerized environment, we're assuming that the final environment is immutable, and therefore validating timestamps +; is unnecessary. +opcache.validate_timestamps = 0 + +; If disabled, all documentation comments will be discarded from the opcode cache to reduce the size of the optimised code. +; Disabling this configuration directive may break applications and frameworks that rely on comment parsing for annotations, +; including Doctrine, Zend Framework 2, PHPUnit, and Magento 2. +opcache.save_comments = 1 \ No newline at end of file diff --git a/php/7.4/alpine-cli/Dockerfile b/php/7.4/alpine-cli/Dockerfile new file mode 100644 index 0000000..8a9bc5c --- /dev/null +++ b/php/7.4/alpine-cli/Dockerfile @@ -0,0 +1,41 @@ +FROM php:7.4-cli-alpine + +LABEL maintainer="damien@graycore.io" + +RUN apk add --no-cache \ + gzip \ + freetype-dev \ + icu-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + libxslt-dev \ + lsof \ + curl-dev \ + libzip-dev \ + libsodium-dev \ + mysql-client \ + procps + +# https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html#required-php-extensions +# This layer must be run as one, not two - See: https://github.com/docker-library/php/issues/855 +RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ + && docker-php-ext-install \ + bcmath \ + gd \ + intl \ + opcache \ + pdo_mysql \ + soap \ + xsl \ + zip \ + sockets + +RUN curl -sS https://getcomposer.org/installer | \ + php -- --install-dir=/usr/local/bin --filename=composer && \ + composer self-update + +COPY conf/php.ini /usr/local/etc/php/ + +RUN chmod 775 /var/www/html && chown root:root /var/www/html + +WORKDIR /var/www/html \ No newline at end of file diff --git a/php/7.4/alpine-cli/conf/php.ini b/php/7.4/alpine-cli/conf/php.ini new file mode 100644 index 0000000..db31a66 --- /dev/null +++ b/php/7.4/alpine-cli/conf/php.ini @@ -0,0 +1,84 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Stock PHP Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. +; Value "stderr" sends the errors to stderr instead of stdout. +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. +log_errors = On + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This sets the maximum amount of memory in bytes that a script is allowed to allocate. +; This helps prevent poorly written scripts for eating up all available memory on a server. +; Note that to have no memory limit, set this directive to -1. +memory_limit = 4G + +; This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. +; This helps prevent poorly written scripts from tying up the server. +; The default setting is 30. When running PHP from the command line the default setting is 0. +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +max_input_time = 30 + +; The maximum size of an uploaded file. When an integer is used, the value is measured in bytes. +; Shorthand notation may also be used. +upload_max_filesize = 20M + +; Sets max size of post data allowed. This setting also affects file upload. To upload large files, +; this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be +; larger than post_max_size. When an integer is used, the value is measured in bytes. Shorthand notation may also be used. +post_max_size = 20M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; OPcache Settings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Determines if Zend OPCache is enabled +opcache.enable = 1 + +; The maximum number of keys (and therefore scripts) in the OPcache hash table. +; The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 } +; that is greater than or equal to the configured value. The minimum value is 200. +; The maximum value is 1000000. Values outside of this range are clamped to the permissible range. +; +; After running some tests on Magento 2 instances, the typical file count is around 30000. We use double, just in case. +opcache.max_accelerated_files = 65407 + +; When enabled, the opcode cache will be checked for whether a file has already been cached when file_exists(), is_file() and is_readable() are called. +; This may increase performance in applications that check the existence and readability of PHP scripts, but risks returning stale data if opcache.validate_timestamps is disabled. +opcache.enable_file_override = 1 + +;The amount of memory used to store interned strings, in megabytes. +opcache.interned_strings_buffer = 32 + +; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set. +opcache.memory_consumption = 200 + +; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request. +; This configuration directive is ignored if opcache.validate_timestamps is disabled. + +; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds. When this directive is disabled, you must reset OPcache manually via opcache_reset(), +; opcache_invalidate() or by restarting the Web server for changes to the filesystem to take effect. +; +; Since we're using a dockerized environment, we're assuming that the final environment is immutable, and therefore validating timestamps +; is unnecessary. +opcache.validate_timestamps = 0 + +; If disabled, all documentation comments will be discarded from the opcode cache to reduce the size of the optimised code. +; Disabling this configuration directive may break applications and frameworks that rely on comment parsing for annotations, +; including Doctrine, Zend Framework 2, PHPUnit, and Magento 2. +opcache.save_comments = 1 \ No newline at end of file From 4690f0405812e8f4e5cf9bf544bf7b34f55603d3 Mon Sep 17 00:00:00 2001 From: Mateus Dutra Dadalto Date: Wed, 3 Aug 2022 15:45:55 -0300 Subject: [PATCH 2/3] build: refactor php directory names (#59) --- .github/workflows/docker-images.yml | 10 +++++----- php/7.2/{alpine-cli => cli-alpine}/Dockerfile | 0 php/7.2/{alpine-cli => cli-alpine}/conf/php.ini | 0 .../Dockerfile | 0 .../conf/php.ini | 0 .../{alpine-develop => fpm-alpine-develop}/Dockerfile | 0 .../conf/php.ini | 0 php/7.2/{alpine => fpm-alpine}/Dockerfile | 0 php/7.2/{alpine => fpm-alpine}/conf/php.ini | 0 php/7.3/{alpine-cli => cli-alpine}/Dockerfile | 0 php/7.3/{alpine-cli => cli-alpine}/conf/php.ini | 0 .../Dockerfile | 0 .../conf/php.ini | 0 .../{alpine-develop => fpm-alpine-develop}/Dockerfile | 0 .../conf/php.ini | 0 php/7.3/{alpine => fpm-alpine}/Dockerfile | 0 php/7.3/{alpine => fpm-alpine}/conf/php.ini | 0 php/7.4/{alpine-cli => cli-alpine}/Dockerfile | 0 php/7.4/{alpine-cli => cli-alpine}/conf/php.ini | 0 .../Dockerfile | 0 .../conf/php.ini | 0 .../{alpine-develop => fpm-alpine-develop}/Dockerfile | 0 .../conf/php.ini | 0 php/7.4/{alpine => fpm-alpine}/Dockerfile | 0 php/7.4/{alpine => fpm-alpine}/conf/php.ini | 0 25 files changed, 5 insertions(+), 5 deletions(-) rename php/7.2/{alpine-cli => cli-alpine}/Dockerfile (100%) rename php/7.2/{alpine-cli => cli-alpine}/conf/php.ini (100%) rename php/7.2/{alpine-develop-xdebug => fpm-alpine-develop-xdebug}/Dockerfile (100%) rename php/7.2/{alpine-develop-xdebug => fpm-alpine-develop-xdebug}/conf/php.ini (100%) rename php/7.2/{alpine-develop => fpm-alpine-develop}/Dockerfile (100%) rename php/7.2/{alpine-develop => fpm-alpine-develop}/conf/php.ini (100%) rename php/7.2/{alpine => fpm-alpine}/Dockerfile (100%) rename php/7.2/{alpine => fpm-alpine}/conf/php.ini (100%) rename php/7.3/{alpine-cli => cli-alpine}/Dockerfile (100%) rename php/7.3/{alpine-cli => cli-alpine}/conf/php.ini (100%) rename php/7.3/{alpine-develop-xdebug => fpm-alpine-develop-xdebug}/Dockerfile (100%) rename php/7.3/{alpine-develop-xdebug => fpm-alpine-develop-xdebug}/conf/php.ini (100%) rename php/7.3/{alpine-develop => fpm-alpine-develop}/Dockerfile (100%) rename php/7.3/{alpine-develop => fpm-alpine-develop}/conf/php.ini (100%) rename php/7.3/{alpine => fpm-alpine}/Dockerfile (100%) rename php/7.3/{alpine => fpm-alpine}/conf/php.ini (100%) rename php/7.4/{alpine-cli => cli-alpine}/Dockerfile (100%) rename php/7.4/{alpine-cli => cli-alpine}/conf/php.ini (100%) rename php/7.4/{alpine-develop-xdebug => fpm-alpine-develop-xdebug}/Dockerfile (100%) rename php/7.4/{alpine-develop-xdebug => fpm-alpine-develop-xdebug}/conf/php.ini (100%) rename php/7.4/{alpine-develop => fpm-alpine-develop}/Dockerfile (100%) rename php/7.4/{alpine-develop => fpm-alpine-develop}/conf/php.ini (100%) rename php/7.4/{alpine => fpm-alpine}/Dockerfile (100%) rename php/7.4/{alpine => fpm-alpine}/conf/php.ini (100%) diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 5060e63..ecabac5 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -18,22 +18,22 @@ jobs: steps: - uses: actions/checkout@v1 - name: Build the graycore/magento-php:${{ matrix.php }}-fpm-alpine image - run: docker build ./php/${{ matrix.php }}/alpine + run: docker build ./php/${{ matrix.php }}/fpm-alpine -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-${GITHUB_REF##*/} -t graycore/magento-php:${{ matrix.php }}-fpm-alpine - name: Build the graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop image - run: docker build ./php/${{ matrix.php }}/alpine-develop + run: docker build ./php/${{ matrix.php }}/fpm-alpine-develop -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-${GITHUB_REF##*/} -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop - name: Build the graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug image - run: docker build ./php/${{ matrix.php }}/alpine-develop-xdebug + run: docker build ./php/${{ matrix.php }}/fpm-alpine-develop-xdebug -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} - -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug + -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug+ - name: Build the graycore/magento-php:${{ matrix.php }}-cli-alpine image - run: docker build ./php/${{ matrix.php }}/alpine-cli + run: docker build ./php/${{ matrix.php }}/cli-alpine -t graycore/magento-php:${{ matrix.php }}-cli-alpine-${GITHUB_REF##*/} -t graycore/magento-php:${{ matrix.php }}-cli-alpine diff --git a/php/7.2/alpine-cli/Dockerfile b/php/7.2/cli-alpine/Dockerfile similarity index 100% rename from php/7.2/alpine-cli/Dockerfile rename to php/7.2/cli-alpine/Dockerfile diff --git a/php/7.2/alpine-cli/conf/php.ini b/php/7.2/cli-alpine/conf/php.ini similarity index 100% rename from php/7.2/alpine-cli/conf/php.ini rename to php/7.2/cli-alpine/conf/php.ini diff --git a/php/7.2/alpine-develop-xdebug/Dockerfile b/php/7.2/fpm-alpine-develop-xdebug/Dockerfile similarity index 100% rename from php/7.2/alpine-develop-xdebug/Dockerfile rename to php/7.2/fpm-alpine-develop-xdebug/Dockerfile diff --git a/php/7.2/alpine-develop-xdebug/conf/php.ini b/php/7.2/fpm-alpine-develop-xdebug/conf/php.ini similarity index 100% rename from php/7.2/alpine-develop-xdebug/conf/php.ini rename to php/7.2/fpm-alpine-develop-xdebug/conf/php.ini diff --git a/php/7.2/alpine-develop/Dockerfile b/php/7.2/fpm-alpine-develop/Dockerfile similarity index 100% rename from php/7.2/alpine-develop/Dockerfile rename to php/7.2/fpm-alpine-develop/Dockerfile diff --git a/php/7.2/alpine-develop/conf/php.ini b/php/7.2/fpm-alpine-develop/conf/php.ini similarity index 100% rename from php/7.2/alpine-develop/conf/php.ini rename to php/7.2/fpm-alpine-develop/conf/php.ini diff --git a/php/7.2/alpine/Dockerfile b/php/7.2/fpm-alpine/Dockerfile similarity index 100% rename from php/7.2/alpine/Dockerfile rename to php/7.2/fpm-alpine/Dockerfile diff --git a/php/7.2/alpine/conf/php.ini b/php/7.2/fpm-alpine/conf/php.ini similarity index 100% rename from php/7.2/alpine/conf/php.ini rename to php/7.2/fpm-alpine/conf/php.ini diff --git a/php/7.3/alpine-cli/Dockerfile b/php/7.3/cli-alpine/Dockerfile similarity index 100% rename from php/7.3/alpine-cli/Dockerfile rename to php/7.3/cli-alpine/Dockerfile diff --git a/php/7.3/alpine-cli/conf/php.ini b/php/7.3/cli-alpine/conf/php.ini similarity index 100% rename from php/7.3/alpine-cli/conf/php.ini rename to php/7.3/cli-alpine/conf/php.ini diff --git a/php/7.3/alpine-develop-xdebug/Dockerfile b/php/7.3/fpm-alpine-develop-xdebug/Dockerfile similarity index 100% rename from php/7.3/alpine-develop-xdebug/Dockerfile rename to php/7.3/fpm-alpine-develop-xdebug/Dockerfile diff --git a/php/7.3/alpine-develop-xdebug/conf/php.ini b/php/7.3/fpm-alpine-develop-xdebug/conf/php.ini similarity index 100% rename from php/7.3/alpine-develop-xdebug/conf/php.ini rename to php/7.3/fpm-alpine-develop-xdebug/conf/php.ini diff --git a/php/7.3/alpine-develop/Dockerfile b/php/7.3/fpm-alpine-develop/Dockerfile similarity index 100% rename from php/7.3/alpine-develop/Dockerfile rename to php/7.3/fpm-alpine-develop/Dockerfile diff --git a/php/7.3/alpine-develop/conf/php.ini b/php/7.3/fpm-alpine-develop/conf/php.ini similarity index 100% rename from php/7.3/alpine-develop/conf/php.ini rename to php/7.3/fpm-alpine-develop/conf/php.ini diff --git a/php/7.3/alpine/Dockerfile b/php/7.3/fpm-alpine/Dockerfile similarity index 100% rename from php/7.3/alpine/Dockerfile rename to php/7.3/fpm-alpine/Dockerfile diff --git a/php/7.3/alpine/conf/php.ini b/php/7.3/fpm-alpine/conf/php.ini similarity index 100% rename from php/7.3/alpine/conf/php.ini rename to php/7.3/fpm-alpine/conf/php.ini diff --git a/php/7.4/alpine-cli/Dockerfile b/php/7.4/cli-alpine/Dockerfile similarity index 100% rename from php/7.4/alpine-cli/Dockerfile rename to php/7.4/cli-alpine/Dockerfile diff --git a/php/7.4/alpine-cli/conf/php.ini b/php/7.4/cli-alpine/conf/php.ini similarity index 100% rename from php/7.4/alpine-cli/conf/php.ini rename to php/7.4/cli-alpine/conf/php.ini diff --git a/php/7.4/alpine-develop-xdebug/Dockerfile b/php/7.4/fpm-alpine-develop-xdebug/Dockerfile similarity index 100% rename from php/7.4/alpine-develop-xdebug/Dockerfile rename to php/7.4/fpm-alpine-develop-xdebug/Dockerfile diff --git a/php/7.4/alpine-develop-xdebug/conf/php.ini b/php/7.4/fpm-alpine-develop-xdebug/conf/php.ini similarity index 100% rename from php/7.4/alpine-develop-xdebug/conf/php.ini rename to php/7.4/fpm-alpine-develop-xdebug/conf/php.ini diff --git a/php/7.4/alpine-develop/Dockerfile b/php/7.4/fpm-alpine-develop/Dockerfile similarity index 100% rename from php/7.4/alpine-develop/Dockerfile rename to php/7.4/fpm-alpine-develop/Dockerfile diff --git a/php/7.4/alpine-develop/conf/php.ini b/php/7.4/fpm-alpine-develop/conf/php.ini similarity index 100% rename from php/7.4/alpine-develop/conf/php.ini rename to php/7.4/fpm-alpine-develop/conf/php.ini diff --git a/php/7.4/alpine/Dockerfile b/php/7.4/fpm-alpine/Dockerfile similarity index 100% rename from php/7.4/alpine/Dockerfile rename to php/7.4/fpm-alpine/Dockerfile diff --git a/php/7.4/alpine/conf/php.ini b/php/7.4/fpm-alpine/conf/php.ini similarity index 100% rename from php/7.4/alpine/conf/php.ini rename to php/7.4/fpm-alpine/conf/php.ini From 1f00d6be6a1472a5e259812fc989d16e5b1df98a Mon Sep 17 00:00:00 2001 From: Mateus Dutra Dadalto Date: Wed, 3 Aug 2022 15:50:42 -0300 Subject: [PATCH 3/3] build: matrix php images across image kind (#59) --- .github/workflows/docker-images.yml | 56 +++++------------------------ 1 file changed, 9 insertions(+), 47 deletions(-) diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index ecabac5..d4e192e 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -14,29 +14,15 @@ jobs: strategy: matrix: php: [7.2, 7.3, 7.4] + kind: [fpm-alpine, fpm-alpine-develop, fpm-alpine-develop-xdebug, cli-alpine] runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Build the graycore/magento-php:${{ matrix.php }}-fpm-alpine image - run: docker build ./php/${{ matrix.php }}/fpm-alpine - -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-${GITHUB_REF##*/} - -t graycore/magento-php:${{ matrix.php }}-fpm-alpine + - name: Build the graycore/magento-php:${{ matrix.php }}-${{ matrix.kind }} image + run: docker build ./php/${{ matrix.php }}/${{ matrix.kind }} + -t graycore/magento-php:${{ matrix.php }}-${{ matrix.kind }}-${GITHUB_REF##*/} + -t graycore/magento-php:${{ matrix.php }}-${{ matrix.kind }} - - name: Build the graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop image - run: docker build ./php/${{ matrix.php }}/fpm-alpine-develop - -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-${GITHUB_REF##*/} - -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop - - - name: Build the graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug image - run: docker build ./php/${{ matrix.php }}/fpm-alpine-develop-xdebug - -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} - -t graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug+ - - - name: Build the graycore/magento-php:${{ matrix.php }}-cli-alpine image - run: docker build ./php/${{ matrix.php }}/cli-alpine - -t graycore/magento-php:${{ matrix.php }}-cli-alpine-${GITHUB_REF##*/} - -t graycore/magento-php:${{ matrix.php }}-cli-alpine - - name: Login to registry run: docker login -u $DOCKER_USER -p $DOCKER_PASS if: ${{ github.event_name == 'release' }} @@ -44,37 +30,13 @@ jobs: DOCKER_USER: ${{ secrets.DOCKER_USER }} DOCKER_PASS: ${{ secrets.DOCKER_PASS }} - - name: Publish latest graycore/magento-php:${{ matrix.php }}-fpm-alpine image - if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine - - - name: Publish tag graycore/magento-php:${{ matrix.php }}-fpm-alpine-${GITHUB_REF##*/} image - if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine-${GITHUB_REF##*/} - - - name: Publish latest graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop image - if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop - - - name: Publish tag graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-${GITHUB_REF##*/} image - if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-${GITHUB_REF##*/} - - - name: Publish latest graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug image - if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug - - - name: Publish tag graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} image - if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-fpm-alpine-develop-xdebug-${GITHUB_REF##*/} - - - name: Publish latest graycore/magento-php:${{ matrix.php }}-cli-alpine image + - name: Publish latest graycore/magento-php:${{ matrix.php }}-${{ matrix.kind }} image if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-cli-alpine + run: docker push graycore/magento-php:${{ matrix.php }}-${{ matrix.kind }} - - name: Publish tag graycore/magento-php:${{ matrix.php }}-cli-alpine-${GITHUB_REF##*/} image + - name: Publish tag graycore/magento-php:${{ matrix.php }}-${{ matrix.kind }}-${GITHUB_REF##*/} image if: ${{ github.event_name == 'release' }} - run: docker push graycore/magento-php:${{ matrix.php }}-cli-alpine-${GITHUB_REF##*/} + run: docker push graycore/magento-php:${{ matrix.php }}-${{ matrix.kind }}-${GITHUB_REF##*/} build-nginx: strategy: matrix: