This is a tool to develop, build and test PHP extensions in Docker containers.

Overview

Develop, Build and Test PHP Extensions

This is a tool to develop, build and test PHP extensions in Docker containers.

Installation

Clone this repository and add the bin/ directory of this repository to your $PATH.

Usage

Call the build-php-extension from the root directory of your extension source. The directory must contain your config.m4 file.

The build-php-extension command has multiple subcommands.

To configure and build your extension, run:

build-php-extension configure

To trigger a build, you can run:

build-php-extension build

And to run the tests, you need to execute:

build-php-extension test

You can specify the tests which should be executed as parameters to the test command. If you omit the list of tests, all tests are run.

build-php-extension test tests/my_test_*.phpt

You can specify the minor PHP version which should be used, whether to enable thread-safety (--zts) and the build mode (--release or --debug) as arguments to all commands:

build-php-extension --php-version 7.4 --release --zts build

The default is to disable thread safety and to build in debug mode.

To open an interactive shell inside a Docker container, you can execute:

build-php-extension shell

The dist-clean subcommand can be used to clean all generated files from the build directory:

build-php-extension dist-clean

Status information is stored by the tool in the file .build-php-extension.state.ini inside the source code of your extension. You should add this file to your .gitignore.

Rebuild Docker Image

When you first execute a command in one specific configuration, the Docker image for that configuration will automatically be built. When you call commands with the same configuration later on, that Docker image will be reused. You can manually rebuild the Docker image with the following command:

build-php-extension --php-version 8.0 --debug build-image

Customization

You can customize the behavior of the build using various hooks. These are scripts that are sourced at the respective steps of the build process. These are the available extension points:

  • build-hooks/pre-configure.sh
  • build-hooks/post-configure.sh
  • build-hooks/pre-build.sh
  • build-hooks/post-build.sh
  • build-hooks/pre-test.sh
  • build-hooks/post-test.sh
  • build-hooks/pre-clean-build-directory.sh
  • build-hooks/post-clean-build-directory.sh
  • build-hooks/pre-shell.sh

If the file build-hooks/configure exists and is executable, it is executed instead of calling ./configure directly. This can be used to pass additional flags to ./configure. All command-line-arguments that script receives, should be forwarded to ./configure:

#!/bin/sh

set -eu
./configure --my-special-configure-flag "${@}"
You might also like...
Docker Container wallstreetbets-sentiment-analysis

Docker Container wallstreetbets-sentiment-analysis A docker container using restful endpoints exposed on port 5000 "/analyze" to gather sentiment anal

Hackergame nc 类题目的 Docker 容器资源限制、动态 flag、网页终端

Hackergame nc 类题目的 Docker 容器资源限制、动态 flag、网页终端 快速入门 配置证书 证书用于验证用户 Token。请确保这里的证书文件(cert.pem)与 Hackergame 平台 配置的证书相同,这样 Hackergame 平台为每个用户生成的 Token 才可以通

docker-compose工程部署时的辅助脚本

okta-cmd Introduction docker-compose 辅助脚本

Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

🐳 Docker templates for various languages.
🐳 Docker templates for various languages.

Docker Deployment Templates One Stop repository for Docker Compose and Docker Templates for Deployment. Features Python (FastAPI, Flask) Screenshots D

Push Container Image To Docker Registry In Python

push-container-image-to-docker-registry 概要 push-container-image-to-docker-registry は、エッジコンピューティング環境において、特定のエッジ端末上の Private Docker Registry に特定のコンテナイメー

Lima is an alternative to using Docker Desktop on your Mac.
Lima is an alternative to using Docker Desktop on your Mac.

lima-xbar-plugin Table of Contents Description Installation Dependencies Lima is an alternative to using Docker Desktop on your Mac. Description This

Some automation scripts to setup a deployable development database server (with docker).

Postgres-Docker Database Initializer This is a simple automation script that will create a Docker Postgres database with a custom username, password,

A job launching library for docker, EC2, GCP, etc.

doodad A library for packaging dependencies and launching scripts (with a focus on python) on different platforms using Docker. Currently supported pl

Owner
Suora GmbH
Suora GmbH
Hatch plugin for Docker containers

hatch-containers CI/CD Package Meta This provides a plugin for Hatch that allows

Ofek Lev 11 Dec 30, 2022
Build and Push docker image in Python (luigi + docker-py)

Docker build images workflow in Python Since docker hub stopped building images for free accounts, I've been looking for another way to do it. I could

Fabien D. 2 Dec 15, 2022
Dockerized service to backup all running database containers

Docker Database Backup Dockerized service to automatically backup all of your database containers. Docker Image Tags: docker.io/jandi/database-backup

Jan Dittrich 16 Dec 31, 2022
Python IMDB Docker - A docker tutorial to containerize a python script.

Python_IMDB_Docker A docker tutorial to containerize a python script. Build the docker in the current directory: docker build -t python-imdb . Run the

Sarthak Babbar 1 Dec 30, 2021
Build Netbox as a Docker container

netbox-docker The Github repository houses the components needed to build Netbox as a Docker container. Images are built using this code and are relea

Farshad Nick 1 Dec 18, 2021
This Docker container is build to run on a server an provide an easy to use interface for every student to vote for their councilors

This Docker container is build to run on a server and provide an easy to use interface for every student to vote for their councilors.

Robin Adelwarth 7 Nov 23, 2022
Define and run multi-container applications with Docker

Docker Compose Docker Compose is a tool for running multi-container applications on Docker defined using the Compose file format. A Compose file is us

Docker 28.2k Jan 8, 2023
Tools and Docker images to make a fast Ruby on Rails development environment

Tools and Docker images to make a fast Ruby on Rails development environment. With the production templates, moving from development to production will be seamless.

null 1 Nov 13, 2022
Visual disk-usage analyser for docker images

whaler What? A command-line tool for visually investigating the disk usage of docker images Why? Large images are slow to move and expensive to store.

Treebeard Technologies 194 Sep 1, 2022
A Python library for the Docker Engine API

Docker SDK for Python A Python library for the Docker Engine API. It lets you do anything the docker command does, but from within Python apps – run c

Docker 6.1k Dec 31, 2022