From 81a8a1dd96791ad8ef0fd35c0353d11b222634f9 Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Thu, 21 Apr 2022 18:36:00 +0200 Subject: [PATCH 1/9] refactor: use local registry for testing images, push to both DockerHub and GitHub Container Registry --- .github/workflows/main.yml | 108 ++++++++++++++++++++++--------------- Dockerfile | 4 +- Makefile | 20 +++---- dev/Dockerfile | 4 +- dev/Makefile | 20 +++---- xhprof/Dockerfile | 4 +- xhprof/Makefile | 20 +++---- 7 files changed, 102 insertions(+), 78 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9219c7..6937d96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,6 @@ on: types: [opened, synchronize] jobs: - docker: name: Build, test and publish runs-on: ubuntu-latest @@ -20,14 +19,22 @@ jobs: include: - version: 'latest' flavor: '' + services: + registry: + image: registry:2 + ports: + - 5000:5000 steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + with: + driver-opts: network=host - name: Build image for testing uses: docker/build-push-action@v2 @@ -36,15 +43,48 @@ jobs: cache-to: type=inline context: . build-args: | - BASE_IMAGE=${{ matrix.version }}${{ matrix.flavor }} - tags: chialab/php:${{ matrix.version }}${{ matrix.flavor }} - load: true + BASE_IMAGE=php:${{ matrix.version }}${{ matrix.flavor }} + tags: localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} + push: true - name: Test image env: + REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} run: | - make test VERSION=${VERSION} + make test + + - name: Build dev image for testing + uses: docker/build-push-action@v2 + with: + cache-to: type=inline + context: ./dev + build-args: | + BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} + tags: localhost:5000/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} + push: true + + - name: Test dev image + env: + REGISTRY: localhost:5000/ + VERSION: ${{ matrix.version }}${{ matrix.flavor }} + run: make -C dev test + + - name: Build xhprof image for testing + uses: docker/build-push-action@v2 + with: + cache-to: type=inline + context: ./xhprof + build-args: | + BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} + tags: localhost:5000/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} + push: true + + - name: Test xhprof image + env: + REGISTRY: localhost:5000/ + VERSION: ${{ matrix.version }}${{ matrix.flavor }} + run: make -C xhprof test - name: Login to DockerHub if: "github.event_name != 'pull_request'" @@ -53,6 +93,14 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GitHub Container Registry + if: "github.event_name != 'pull_request'" + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build image and push to registry if: "github.event_name != 'pull_request'" uses: docker/build-push-action@v2 @@ -62,25 +110,12 @@ jobs: cache-to: type=inline context: . build-args: | - BASE_IMAGE=${{ matrix.version }}${{ matrix.flavor }} - tags: chialab/php:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=php:${{ matrix.version }}${{ matrix.flavor }} + tags: + chialab/php:${{ matrix.version }}${{ matrix.flavor }} + ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }} push: true - - name: Build dev image for testing - uses: docker/build-push-action@v2 - with: - cache-to: type=inline - context: ./dev - build-args: | - BASE_IMAGE=${{ matrix.version }}${{ matrix.flavor }} - tags: chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} - load: true - - - name: Test dev image - env: - VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C dev test VERSION=${VERSION} - - name: Build dev image and push to registry if: "github.event_name != 'pull_request'" uses: docker/build-push-action@v2 @@ -89,25 +124,12 @@ jobs: cache-to: type=inline context: ./dev build-args: | - BASE_IMAGE=${{ matrix.version }}${{ matrix.flavor }} - tags: chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }} + tags: | + chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} + ghcr.io/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} push: true - - name: Build xhprof image for testing - uses: docker/build-push-action@v2 - with: - cache-to: type=inline - context: ./xhprof - build-args: | - BASE_IMAGE=${{ matrix.version }}${{ matrix.flavor }} - tags: chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} - load: true - - - name: Test xhprof image - env: - VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C xhprof test VERSION=${VERSION} - - name: Build xhprof image (amd64 only) and push to registry if: "github.event_name != 'pull_request'" uses: docker/build-push-action@v2 @@ -115,6 +137,8 @@ jobs: cache-to: type=inline context: ./xhprof build-args: | - BASE_IMAGE=${{ matrix.version }}${{ matrix.flavor }} - tags: chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} + BASE_IMAGE=ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }} + tags: | + chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} + ghcr.io/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} push: true diff --git a/Dockerfile b/Dockerfile index 31265e4..f904ef8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG BASE_IMAGE=latest -FROM php:${BASE_IMAGE} +ARG BASE_IMAGE=php:latest +FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" # Download script to install PHP extensions and dependencies diff --git a/Makefile b/Makefile index 719222f..852665e 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,8 @@ ifeq (,$(findstring $(PHP_VERSION), 7.0 7.1 7.2 7.3 7.4 8.0 8.1 latest)) endif build: - @echo " =====> Building $(IMAGE):$(VERSION)..." - docker image build --quiet --build-arg 'BASE_IMAGE=$(VERSION)' -t $(IMAGE):$(VERSION) . + @echo " =====> Building $(REGISTRY)$(IMAGE):$(VERSION)..." + docker image build --quiet --build-arg 'BASE_IMAGE=$(PARENT_IMAGE):$(VERSION)' -t $(REGISTRY)$(IMAGE):$(VERSION) . test: @echo -e "=====> Testing loaded extensions... \c" @@ -48,12 +48,12 @@ test: echo 'FAIL [Missing image!!!]'; \ exit 1; \ fi - @IMAGE_PHP_VERSION=`docker container run --rm $(IMAGE):$(VERSION) bash -c '/bin/echo $$PHP_VERSION' | cut -d '.' -f 1,2`; \ + @IMAGE_PHP_VERSION=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) bash -c '/bin/echo $$PHP_VERSION' | cut -d '.' -f 1,2`; \ if [[ "$(PHP_VERSION)" != "latest" && "$${IMAGE_PHP_VERSION}" != "$(PHP_VERSION)" ]]; then \ echo "FAIL [wrong PHP version: expected $(PHP_VERSION), got $${IMAGE_PHP_VERSION}]"; \ exit 1; \ fi - @modules=`docker container run --rm $(IMAGE):$(VERSION) php -m`; \ + @modules=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) php -m`; \ for ext in $(EXTENSIONS); do \ if [[ "$${modules}" != *"$${ext}"* ]]; then \ echo "FAIL [$${ext}]"; \ @@ -61,29 +61,29 @@ test: fi \ done @if [[ "$(VERSION)" == *'-apache' ]]; then \ - apache=`docker container run --rm $(IMAGE):$(VERSION) apache2ctl -M 2> /dev/null`; \ + apache=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) apache2ctl -M 2> /dev/null`; \ if [[ "$${apache}" != *'rewrite_module'* ]]; then \ echo 'FAIL [mod_rewrite]'; \ exit 1; \ fi \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 2]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer2 --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer2 --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 2]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer1 --version 2> /dev/null | grep '^Composer version 1\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer1 --version 2> /dev/null | grep '^Composer version 1\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 1]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer1 global show 2> /dev/null | grep '^hirak/prestissimo [0-9][0-9]*\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer1 global show 2> /dev/null | grep '^hirak/prestissimo [0-9][0-9]*\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 1 plugin - prestissimo]'; \ exit 1; \ fi @echo 'OK' push: - docker image push $(IMAGE):$(VERSION) + docker image push $(REGISTRY)$(IMAGE):$(VERSION) diff --git a/dev/Dockerfile b/dev/Dockerfile index eded13b..9e7190e 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -1,5 +1,5 @@ -ARG BASE_IMAGE=latest -FROM chialab/php:${BASE_IMAGE} +ARG BASE_IMAGE=chialab/php:latest +FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" # Install XDebug. diff --git a/dev/Makefile b/dev/Makefile index d882abf..55534d0 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -40,8 +40,8 @@ ifeq (,$(findstring $(PHP_VERSION), 7.0 7.1 7.2 7.3 7.4 8.0 8.1 latest)) endif build: - @echo " =====> Building $(IMAGE):$(VERSION)..." - docker image build --quiet --build-arg 'BASE_IMAGE=$(VERSION)' -t $(IMAGE):$(VERSION) . + @echo " =====> Building $(REGISTRY)$(IMAGE):$(VERSION)..." + docker image build --quiet --build-arg 'BASE_IMAGE=$(PARENT_IMAGE):$(VERSION)' -t $(REGISTRY)$(IMAGE):$(VERSION) . test: @echo -e "=====> Testing loaded extensions... \c" @@ -49,12 +49,12 @@ test: echo 'FAIL [Missing image!!!]'; \ exit 1; \ fi - @IMAGE_PHP_VERSION=`docker container run --rm $(IMAGE):$(VERSION) bash -c '/bin/echo $$PHP_VERSION' | cut -d '.' -f 1,2`; \ + @IMAGE_PHP_VERSION=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) bash -c '/bin/echo $$PHP_VERSION' | cut -d '.' -f 1,2`; \ if [[ "$(PHP_VERSION)" != "latest" && "$${IMAGE_PHP_VERSION}" != "$(PHP_VERSION)" ]]; then \ echo "FAIL [wrong PHP version: expected $(PHP_VERSION), got $${IMAGE_PHP_VERSION}]"; \ exit 1; \ fi - @modules=`docker container run --rm $(IMAGE):$(VERSION) php -m`; \ + @modules=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) php -m`; \ for ext in $(EXTENSIONS); do \ if [[ "$${modules}" != *"$${ext}"* ]]; then \ echo "FAIL [$${ext}]"; \ @@ -62,29 +62,29 @@ test: fi \ done @if [[ "$(VERSION)" == *'-apache' ]]; then \ - apache=`docker container run --rm $(IMAGE):$(VERSION) apache2ctl -M 2> /dev/null`; \ + apache=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) apache2ctl -M 2> /dev/null`; \ if [[ "$${apache}" != *'rewrite_module'* ]]; then \ echo 'FAIL [mod_rewrite]'; \ exit 1; \ fi \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 2]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer2 --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer2 --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 2]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer1 --version 2> /dev/null | grep '^Composer version 1\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer1 --version 2> /dev/null | grep '^Composer version 1\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 1]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer1 global show 2> /dev/null | grep '^hirak/prestissimo [0-9][0-9]*\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer1 global show 2> /dev/null | grep '^hirak/prestissimo [0-9][0-9]*\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 1 plugin - prestissimo]'; \ exit 1; \ fi @echo 'OK' push: - docker image push $(IMAGE):$(VERSION) + docker image push $(REGISTRY)$(IMAGE):$(VERSION) diff --git a/xhprof/Dockerfile b/xhprof/Dockerfile index fcecc87..6f6da20 100644 --- a/xhprof/Dockerfile +++ b/xhprof/Dockerfile @@ -1,5 +1,5 @@ -ARG BASE_IMAGE=latest -FROM chialab/php:${BASE_IMAGE} +ARG BASE_IMAGE=chialab/php:latest +FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" # Install XHProf. diff --git a/xhprof/Makefile b/xhprof/Makefile index a5547b6..841b046 100644 --- a/xhprof/Makefile +++ b/xhprof/Makefile @@ -40,8 +40,8 @@ ifeq (,$(findstring $(PHP_VERSION), 7.0 7.1 7.2 7.3 7.4 8.0 8.1 latest)) endif build: - @echo " =====> Building $(IMAGE):$(VERSION)..." - docker image build --quiet --build-arg 'BASE_IMAGE=$(VERSION)' -t $(IMAGE):$(VERSION) . + @echo " =====> Building $(REGISTRY)$(IMAGE):$(VERSION)..." + docker image build --quiet --build-arg 'BASE_IMAGE=$(PARENT_IMAGE):$(VERSION)' -t $(REGISTRY)$(IMAGE):$(VERSION) . test: @echo -e "=====> Testing loaded extensions... \c" @@ -49,12 +49,12 @@ test: echo 'FAIL [Missing image!!!]'; \ exit 1; \ fi - @IMAGE_PHP_VERSION=`docker container run --rm $(IMAGE):$(VERSION) bash -c '/bin/echo $$PHP_VERSION' | cut -d '.' -f 1,2`; \ + @IMAGE_PHP_VERSION=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) bash -c '/bin/echo $$PHP_VERSION' | cut -d '.' -f 1,2`; \ if [[ "$(PHP_VERSION)" != "latest" && "$${IMAGE_PHP_VERSION}" != "$(PHP_VERSION)" ]]; then \ echo "FAIL [wrong PHP version: expected $(PHP_VERSION), got $${IMAGE_PHP_VERSION}]"; \ exit 1; \ fi - @modules=`docker container run --rm $(IMAGE):$(VERSION) php -m`; \ + @modules=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) php -m`; \ for ext in $(EXTENSIONS); do \ if [[ "$${modules}" != *"$${ext}"* ]]; then \ echo "FAIL [$${ext}]"; \ @@ -62,29 +62,29 @@ test: fi \ done @if [[ "$(VERSION)" == *'-apache' ]]; then \ - apache=`docker container run --rm $(IMAGE):$(VERSION) apache2ctl -M 2> /dev/null`; \ + apache=`docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) apache2ctl -M 2> /dev/null`; \ if [[ "$${apache}" != *'rewrite_module'* ]]; then \ echo 'FAIL [mod_rewrite]'; \ exit 1; \ fi \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 2]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer2 --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer2 --version 2> /dev/null | grep '^Composer version 2\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 2]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer1 --version 2> /dev/null | grep '^Composer version 1\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer1 --version 2> /dev/null | grep '^Composer version 1\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 1]'; \ exit 1; \ fi - @if [[ -z `docker container run --rm $(IMAGE):$(VERSION) composer1 global show 2> /dev/null | grep '^hirak/prestissimo [0-9][0-9]*\.[0-9][0-9]*'` ]]; then \ + @if [[ -z `docker container run --rm $(REGISTRY)$(IMAGE):$(VERSION) composer1 global show 2> /dev/null | grep '^hirak/prestissimo [0-9][0-9]*\.[0-9][0-9]*'` ]]; then \ echo 'FAIL [Composer 1 plugin - prestissimo]'; \ exit 1; \ fi @echo 'OK' push: - docker image push $(IMAGE):$(VERSION) + docker image push $(REGISTRY)$(IMAGE):$(VERSION) From 4272a5d8427cc2231cc84f20a3d2c3dc29db0761 Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Thu, 21 Apr 2022 17:08:03 +0200 Subject: [PATCH 2/9] feat: add amqp, gettext and imagick extensions --- Dockerfile | 3 +++ Makefile | 7 +++++-- dev/Makefile | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f904ef8..28335b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,11 +14,14 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -q \ zip unzip \ # iconv, mbstring and pdo_sqlite are omitted as they are already installed && PHP_EXTENSIONS=" \ + amqp \ bcmath \ bz2 \ calendar \ exif \ gd \ + gettext \ + imagick \ intl \ ldap \ memcached \ diff --git a/Makefile b/Makefile index 852665e..7383b98 100644 --- a/Makefile +++ b/Makefile @@ -9,13 +9,16 @@ PHP_VERSION = $(firstword $(subst -, ,$(VERSION))) # Extensions. EXTENSIONS := \ + amqp \ bcmath \ bz2 \ calendar \ exif \ - iconv \ - intl \ gd \ + gettext \ + iconv \ + imagick \ + intl \ ldap \ mbstring \ memcached \ diff --git a/dev/Makefile b/dev/Makefile index 55534d0..1e8dfa6 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -9,13 +9,16 @@ PHP_VERSION = $(firstword $(subst -, ,$(VERSION))) # Extensions. EXTENSIONS := \ + amqp \ bcmath \ bz2 \ calendar \ exif \ - iconv \ - intl \ gd \ + gettext \ + iconv \ + imagick \ + intl \ ldap \ mbstring \ memcached \ From 02b4f5670fd28c86248cfc7103377325e8a2cf2f Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Thu, 21 Apr 2022 17:12:32 +0200 Subject: [PATCH 3/9] docs: update `README.md` --- README.md | 3 +++ dev/README.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index cbbf1d7..e77256d 100644 --- a/README.md +++ b/README.md @@ -57,12 +57,15 @@ As you might have guessed, all tags are built on top of the corresponding tag of The following modules and extensions have been enabled, in addition to those you can already find in the [official PHP image](https://hub.docker.com/r/_/php/): +- `amqp` - `bcmath` - `bz2` - `calendar` - `exif` - `gd` +- `gettext` - `iconv` +- `imagick` - `intl` - `ldap` - `mbstring` diff --git a/dev/README.md b/dev/README.md index 9b333c1..877f4fa 100644 --- a/dev/README.md +++ b/dev/README.md @@ -57,12 +57,15 @@ As you might have guessed, all tags are built on top of the corresponding tag of The following modules and extensions have been enabled, in addition to those you can already find in the [official PHP image](https://hub.docker.com/r/_/php/): +- `amqp` - `bcmath` - `bz2` - `calendar` - `exif` - `gd` +- `gettext` - `iconv` +- `imagick` - `intl` - `ldap` - `mbstring` From b8ff353103853931ea07c02a6524ecc6910e16a5 Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Thu, 21 Apr 2022 18:37:34 +0200 Subject: [PATCH 4/9] chore: add extensions to xhprof image as well --- xhprof/Makefile | 3 +++ xhprof/README.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xhprof/Makefile b/xhprof/Makefile index 841b046..a8cfb92 100644 --- a/xhprof/Makefile +++ b/xhprof/Makefile @@ -9,12 +9,15 @@ PHP_VERSION = $(firstword $(subst -, ,$(VERSION))) # Extensions. EXTENSIONS := \ + amqp \ bcmath \ bz2 \ calendar \ exif \ gd \ + gettext \ iconv \ + imagick \ intl \ ldap \ mbstring \ diff --git a/xhprof/README.md b/xhprof/README.md index 3122cb7..ff1899b 100644 --- a/xhprof/README.md +++ b/xhprof/README.md @@ -57,12 +57,15 @@ As you might have guessed, all tags are built on top of the corresponding tag of The following modules and extensions have been enabled, in addition to those you can already find in the [official PHP image](https://hub.docker.com/r/_/php/): +- `amqp` - `bcmath` - `bz2` - `calendar` - `exif` - `gd` +- `gettext` - `iconv` +- `imagick` - `intl` - `ldap` - `mbstring` From 3cdbe1b7388bbd19c93d37411c2985ba1a8c0102 Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Thu, 21 Apr 2022 18:43:40 +0200 Subject: [PATCH 5/9] fix: set make vars explicitly --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6937d96..4327821 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,8 +51,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: | - make test + run: make test VERSION=${VERSION} REGISTRY=${REGISTRY} - name: Build dev image for testing uses: docker/build-push-action@v2 @@ -68,7 +67,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C dev test + run: make -C dev test VERSION=${VERSION} REGISTRY=${REGISTRY} - name: Build xhprof image for testing uses: docker/build-push-action@v2 @@ -84,7 +83,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C xhprof test + run: make -C xhprof test VERSION=${VERSION} REGISTRY=${REGISTRY} - name: Login to DockerHub if: "github.event_name != 'pull_request'" From d586c7a2bcd0eb0cf9e4eb2d08a497d362e11ce0 Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Thu, 21 Apr 2022 18:53:15 +0200 Subject: [PATCH 6/9] fix: prefix image with registry when checking for its presence --- .github/workflows/main.yml | 6 +++--- Makefile | 2 +- dev/Makefile | 2 +- xhprof/Makefile | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4327821..219b159 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make test VERSION=${VERSION} REGISTRY=${REGISTRY} + run: make test - name: Build dev image for testing uses: docker/build-push-action@v2 @@ -67,7 +67,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C dev test VERSION=${VERSION} REGISTRY=${REGISTRY} + run: make -C dev test - name: Build xhprof image for testing uses: docker/build-push-action@v2 @@ -83,7 +83,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C xhprof test VERSION=${VERSION} REGISTRY=${REGISTRY} + run: make -C xhprof test - name: Login to DockerHub if: "github.event_name != 'pull_request'" diff --git a/Makefile b/Makefile index 7383b98..5f83d93 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ build: test: @echo -e "=====> Testing loaded extensions... \c" - @if [[ -z `docker image ls $(IMAGE) | grep "\s$(VERSION)\s"` ]]; then \ + @if [[ -z `docker image ls $(REGISTRY)$(IMAGE) | grep "\s$(VERSION)\s"` ]]; then \ echo 'FAIL [Missing image!!!]'; \ exit 1; \ fi diff --git a/dev/Makefile b/dev/Makefile index 1e8dfa6..d1cbc86 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -48,7 +48,7 @@ build: test: @echo -e "=====> Testing loaded extensions... \c" - @if [[ -z `docker image ls $(IMAGE) | grep "\s$(VERSION)\s"` ]]; then \ + @if [[ -z `docker image ls $(REGISTRY)$(IMAGE) | grep "\s$(VERSION)\s"` ]]; then \ echo 'FAIL [Missing image!!!]'; \ exit 1; \ fi diff --git a/xhprof/Makefile b/xhprof/Makefile index a8cfb92..ef92a8f 100644 --- a/xhprof/Makefile +++ b/xhprof/Makefile @@ -48,7 +48,7 @@ build: test: @echo -e "=====> Testing loaded extensions... \c" - @if [[ -z `docker image ls $(IMAGE) | grep "\s$(VERSION)\s"` ]]; then \ + @if [[ -z `docker image ls $(REGISTRY)$(IMAGE) | grep "\s$(VERSION)\s"` ]]; then \ echo 'FAIL [Missing image!!!]'; \ exit 1; \ fi From 7e3f06938402bec8c8a152619da13bb24b6098e9 Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Fri, 22 Apr 2022 09:56:20 +0200 Subject: [PATCH 7/9] chore: attempt with both push and load --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 219b159..481fa10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,6 +45,7 @@ jobs: build-args: | BASE_IMAGE=php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} + load: true push: true - name: Test image @@ -61,6 +62,7 @@ jobs: build-args: | BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} + load: true push: true - name: Test dev image @@ -77,6 +79,7 @@ jobs: build-args: | BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} + load: true push: true - name: Test xhprof image From 4fb8a19f837e003b8ed671ce0f2e7b0ffec038ca Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Fri, 22 Apr 2022 10:04:14 +0200 Subject: [PATCH 8/9] fix: pull image just pushed to local registry because docker sucks --- .github/workflows/main.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 481fa10..6b1d80a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,14 +45,13 @@ jobs: build-args: | BASE_IMAGE=php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} - load: true push: true - name: Test image env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make test + run: 'docker pull "${REGISTRY}${VERSION}" && make test' - name: Build dev image for testing uses: docker/build-push-action@v2 @@ -62,14 +61,13 @@ jobs: build-args: | BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} - load: true push: true - name: Test dev image env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C dev test + run: 'docker pull "${REGISTRY}${VERSION}" && make -C dev test' - name: Build xhprof image for testing uses: docker/build-push-action@v2 @@ -79,14 +77,13 @@ jobs: build-args: | BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} tags: localhost:5000/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} - load: true push: true - name: Test xhprof image env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: make -C xhprof test + run: 'docker pull "${REGISTRY}${VERSION}" && make -C xhprof test' - name: Login to DockerHub if: "github.event_name != 'pull_request'" From 62203b89474390d8698bf64f84661af00a85fd55 Mon Sep 17 00:00:00 2001 From: Paolo Cuffiani Date: Fri, 22 Apr 2022 10:11:30 +0200 Subject: [PATCH 9/9] fix: pull correct image --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b1d80a..f30de04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,7 +51,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: 'docker pull "${REGISTRY}${VERSION}" && make test' + run: 'docker pull localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} && make test' - name: Build dev image for testing uses: docker/build-push-action@v2 @@ -67,7 +67,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: 'docker pull "${REGISTRY}${VERSION}" && make -C dev test' + run: 'docker pull localhost:5000/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} && make -C dev test' - name: Build xhprof image for testing uses: docker/build-push-action@v2 @@ -83,7 +83,7 @@ jobs: env: REGISTRY: localhost:5000/ VERSION: ${{ matrix.version }}${{ matrix.flavor }} - run: 'docker pull "${REGISTRY}${VERSION}" && make -C xhprof test' + run: 'docker pull localhost:5000/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} && make -C xhprof test' - name: Login to DockerHub if: "github.event_name != 'pull_request'"