From b8ef15781d3ab49072af4c0019de25edf6d2e289 Mon Sep 17 00:00:00 2001 From: Keywan Ghadami Date: Mon, 9 May 2022 14:10:45 +0200 Subject: [PATCH 01/10] use php 8.1 and mysql 8 --- .github/workflows/main.yml | 6 ++-- extensions/php8.1/Dockerfile | 55 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 extensions/php8.1/Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87dc31d..3799410 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,10 +8,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ["7.4","8.0"] + php: ["8.0","8.1"] services: mysql: - image: mysql:5.7 + image: mysql:8 env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: oxid @@ -41,7 +41,7 @@ jobs: - name: test image run: docker exec oxid composer -v - name: install oxid - run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-6.4-ce + run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-7.0-rc-ce # - name: run oxid console # run: docker exec oxid vendor/bin/oe-console - name: Docker Login diff --git a/extensions/php8.1/Dockerfile b/extensions/php8.1/Dockerfile new file mode 100644 index 0000000..f24c914 --- /dev/null +++ b/extensions/php8.1/Dockerfile @@ -0,0 +1,55 @@ +ARG PHP=8.1 +ARG SERVER=apache +FROM php:$PHP-apache + +#libs: +#libzip4 need this to enable extensions +#libmemcached-libs zlib libmemcachedutil2 for memcached +ARG libs="libfreetype6 libjpeg62-turbo liblz4-tool libzip4 libjudydebian1 libmemcached11 zlib1g libmemcachedutil2" + +#libjudy-dev need this for memprof +#libzip4 need this to enable extensions +#zlib-dev libmemcached-dev cyrus-sasl-dev for memcached +ARG BUILD_PACKAGE_DEPS="libzip-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libxml2-dev libonig-dev libssl-dev libjudy-dev zlib1g-dev libmemcached-dev" +#without core modules like json,curl because they are already part of php 8 see https://github.com/docker-library/php/issues/102 and https://github.com/docker-library/php/issues/1049 +ARG PHP_EXT_DEPS="xml zip bcmath soap pdo_mysql gd mysqli exif opcache" + +#php8 compatible xdebug is xdebug-3.0 +ARG PECL_DEPS_INSTALL="memprof xdebug memcached apcu" +ARG PHP_MEMORY_LIMIT="-1" + +RUN apt-get update -y \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $BUILD_PACKAGE_DEPS $libs \ + && docker-php-source extract \ + && docker-php-ext-configure zip \ + && docker-php-ext-configure gd --with-jpeg=/usr/local/ \ + && docker-php-ext-install -j$(nproc) $PHP_EXT_DEPS \ + && pecl install $PECL_DEPS_INSTALL \ + && docker-php-source delete \ + && apt-get purge -y --auto-remove $BUILD_PACKAGE_DEPS + +ARG PECL_DEPS_ENABLE="memprof xdebug memcached apcu" +RUN docker-php-ext-enable $PECL_DEPS_ENABLE +RUN ln -s /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini + +# remove memory limit +RUN echo "memory_limit = $PHP_MEMORY_LIMIT" > /usr/local/etc/php/conf.d/memory-limit-php.ini + +# add symlink to provide php also from /usr/bin +RUN ln -s /usr/local/bin/php /usr/bin/php + +WORKDIR /var/www/oxideshop + +RUN sed -i -e "s#/var/www/html#/var/www/oxideshop/source#g" /etc/apache2/sites-enabled/000-default.conf +RUN sed -i -e "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf +RUN a2enmod rewrite + +# setting the umask to 000 to allow to open files created by docker container +#systemwide does not work in debian based docker image for some reason +#e.g. will have no effectRUN sed -i -e "s/UMASK[[:space:]]\{1,\}022$/UMASK 000/" /etc/login.defs +#so setting the umask for the webserver +RUN sed -i '2s/^/umask 000\n /' /usr/local/bin/apache2-foreground +#and for developers that using a bash +RUN echo umask 000 >> /root/.bashrc + + From ccbcfdb20f3a6cd65c523532a7910f0e23372246 Mon Sep 17 00:00:00 2001 From: Bernhard Scheffold Date: Mon, 8 Aug 2022 15:36:12 +0200 Subject: [PATCH 02/10] spelling --- composer/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer/Dockerfile b/composer/Dockerfile index 57121e0..d14cf80 100644 --- a/composer/Dockerfile +++ b/composer/Dockerfile @@ -13,6 +13,6 @@ RUN curl -LO https://phar.io/releases/phive.phar && \ ENV COMPOSER_ALLOW_SUPERUSER=1 ENV COMPOSER_NO_INTERACTION=1 -#removed prestissimo because we can user composer 2 -#RUN composer global require hirak/prestissimo +# removed prestissimo because we can user composer 2 +# RUN composer global require hirak/prestissimo From ca575c4fb93f7d2879d569f65daff7b4d0561994 Mon Sep 17 00:00:00 2001 From: Bernhard Scheffold Date: Mon, 8 Aug 2022 16:44:37 +0200 Subject: [PATCH 03/10] PHP 8.1 not yet supported --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3799410..94b8666 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ["8.0","8.1"] + php: ["8.0"] services: mysql: image: mysql:8 From d988401026f9732cfb164b239988f2dfef557dd6 Mon Sep 17 00:00:00 2001 From: Bernhard Scheffold Date: Tue, 9 Aug 2022 12:22:49 +0200 Subject: [PATCH 04/10] change project to b-7.0-rc-ee --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94b8666..8bf9577 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: - name: test image run: docker exec oxid composer -v - name: install oxid - run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-7.0-rc-ce + run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . b-7.0-rc-ee # - name: run oxid console # run: docker exec oxid vendor/bin/oe-console - name: Docker Login From 1ee52b7982acf3c1b6e526998d299deb9dc04b94 Mon Sep 17 00:00:00 2001 From: Bernhard Scheffold Date: Tue, 9 Aug 2022 12:31:02 +0200 Subject: [PATCH 05/10] change project to dev-b-7.0-rc-ee --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8bf9577..83a51f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: - name: test image run: docker exec oxid composer -v - name: install oxid - run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . b-7.0-rc-ee + run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-7.0-rc-ee # - name: run oxid console # run: docker exec oxid vendor/bin/oe-console - name: Docker Login From 06e90e3ab58132706c4ec95d8a856cfaf453e5ab Mon Sep 17 00:00:00 2001 From: Bernhard Scheffold Date: Tue, 9 Aug 2022 12:39:16 +0200 Subject: [PATCH 06/10] change project to dev-b-7.0-rc-ce --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 83a51f2..94b8666 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: - name: test image run: docker exec oxid composer -v - name: install oxid - run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-7.0-rc-ee + run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-7.0-rc-ce # - name: run oxid console # run: docker exec oxid vendor/bin/oe-console - name: Docker Login From 94c151308b37d39618feda56ecd1deb25a42daef Mon Sep 17 00:00:00 2001 From: Fabian Vogel Date: Thu, 6 Apr 2023 16:24:17 +0200 Subject: [PATCH 07/10] added ghcr --- .github/workflows/main.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94b8666..ec3c3dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,11 +31,11 @@ jobs: - name: service restart run: sudo service docker restart - name: Build the PHP Docker image with extensions - run: docker build . --squash --file extensions/php${{ matrix.php }}/Dockerfile --build-arg PHP=${{ matrix.php }} --tag oxidprojects/oxid-apache-php:plain-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} + run: docker build . --squash --file extensions/php${{ matrix.php }}/Dockerfile --build-arg PHP=${{ matrix.php }} --tag oxidprojects/oxid-apache-php:plain-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} --tag ghcr.io/oxidprojects/docker-oxid:plain-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} - name: Build the PHP Docker image with composer - run: docker build . --squash --file composer/Dockerfile --build-arg FROM=oxidprojects/oxid-apache-php:plain-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} --build-arg PHP=${{ matrix.php }} --tag oxidprojects/oxid-apache-php:composer-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} + run: docker build . --squash --file composer/Dockerfile --build-arg FROM=oxidprojects/oxid-apache-php:plain-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} --build-arg PHP=${{ matrix.php }} --tag oxidprojects/oxid-apache-php:composer-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} --tag ghcr.io/oxidprojects/docker-oxid:composer-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} - name: Build the OXID Docker image - run: docker build . --squash --file tools/Dockerfile --build-arg FROM=oxidprojects/oxid-apache-php:composer-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} --build-arg PHP=${{ matrix.php }} --tag oxidprojects/oxid-apache-php:${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} + run: docker build . --squash --file tools/Dockerfile --build-arg FROM=oxidprojects/oxid-apache-php:composer-${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} --build-arg PHP=${{ matrix.php }} --tag oxidprojects/oxid-apache-php:${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} --tag ghcr.io/oxidprojects/docker-oxid:${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} - name: run the image for testing in background run: docker run --name oxid -d oxidprojects/oxid-apache-php:${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} - name: test image @@ -46,5 +46,13 @@ jobs: # run: docker exec oxid vendor/bin/oe-console - name: Docker Login run: docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} + - name: Log into ghcr + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Publish oxid php${{ matrix.php }} Docker image on Docker Hub run: docker push oxidprojects/oxid-apache-php:${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} + - name: Publish oxid php${{ matrix.php }} Docker image on GHCR + run: docker push ghcr.io/oxidprojects/docker-oxid:${{ steps.extract_branch.outputs.branch }}-php${{ matrix.php }} From 2d98f67d203e1266c482bbda87d8ef5fac0858ec Mon Sep 17 00:00:00 2001 From: Sven Brunk Date: Fri, 22 Sep 2023 08:21:32 +0200 Subject: [PATCH 08/10] Update main.yml with 7.0 final --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec3c3dd..ba2c556 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: - name: test image run: docker exec oxid composer -v - name: install oxid - run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-7.0-rc-ce + run: docker exec oxid composer create-project --no-interaction -s dev --no-dev oxid-esales/oxideshop-project . dev-b-7.0-ce # - name: run oxid console # run: docker exec oxid vendor/bin/oe-console - name: Docker Login From db08e0aefe71f37be318b28f8a2c7a1cbdf85104 Mon Sep 17 00:00:00 2001 From: Sven Brunk Date: Fri, 22 Sep 2023 08:59:08 +0200 Subject: [PATCH 09/10] Added newly supported php 8.1 to matrix in main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ba2c556..2162c1f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ["8.0"] + php: ["8.0", "8.1"] services: mysql: image: mysql:8 From 85efa378a08308de672b5cdd625000cca952f25a Mon Sep 17 00:00:00 2001 From: Sven Brunk Date: Fri, 22 Sep 2023 09:14:02 +0200 Subject: [PATCH 10/10] Update tools-Dockerfile with netcat changes netcat transitional package originally pointing to netcat-openbsd has been removed from debian 12 Now explicitly use netcat-openbsd (keep compatibility) --- tools/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Dockerfile b/tools/Dockerfile index 6b44079..8d2672c 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -6,7 +6,7 @@ ARG remoteTools="rsync wget openssh-client" ARG fontTools="fontforge ttfautohint" ARG editors="less nano" #gnupg needed by phive to install other php tools -ARG tools="$editors $fontTools $remoteTools nvi iproute2 ack-grep unzip git default-mysql-client sudo make socat dnsutils iputils-ping netcat gnupg ansible python3-wheel" +ARG tools="$editors $fontTools $remoteTools nvi iproute2 ack-grep unzip git default-mysql-client sudo make socat dnsutils iputils-ping netcat-openbsd gnupg ansible python3-wheel" ARG RUNTIME_PACKAGE_DEPS="$libs $tools msmtp bc locales"