├── .github └── dependabot.yml ├── .gitmodules ├── Dockerfile-alpine-7.4 ├── Dockerfile-alpine-8.0 ├── Dockerfile-develop-7.4 ├── Dockerfile-develop-8.0 ├── Dockerfile-release-7.4 ├── Dockerfile-release-8.0 ├── LICENSE ├── README.md ├── build.sh └── hooks └── post_push /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: docker 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "13:00" 8 | ignore: 9 | - dependency-name: "*" 10 | update-types: ["version-update:semver-major", "version-update:semver-minor"] 11 | open-pull-requests-limit: 10 12 | - package-ecosystem: gitsubmodule 13 | directory: "/" 14 | schedule: 15 | interval: daily 16 | time: "13:00" 17 | open-pull-requests-limit: 10 18 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "develop"] 2 | path = develop 3 | url = git@github.com:krakjoe/parallel.git 4 | [submodule "release"] 5 | path = release 6 | url = git@github.com:krakjoe/parallel.git 7 | branch = release 8 | -------------------------------------------------------------------------------- /Dockerfile-alpine-7.4: -------------------------------------------------------------------------------- 1 | FROM php:7.4.23-zts-alpine 2 | 3 | RUN apk add --no-cache --update pcre-dev ${PHPIZE_DEPS} && \ 4 | pecl install parallel && \ 5 | docker-php-ext-enable parallel && \ 6 | apk del pcre-dev ${PHPIZE_DEPS} && \ 7 | EXTENSION_DIR=`php-config --extension-dir 2>/dev/null` && \ 8 | echo "=====================================================================" && \ 9 | echo "Finished building. SHA256:" && \ 10 | sha256sum "$EXTENSION_DIR/parallel.so" | sed "s/ /\n/" && \ 11 | echo "=====================================================================" 12 | -------------------------------------------------------------------------------- /Dockerfile-alpine-8.0: -------------------------------------------------------------------------------- 1 | FROM php:8.0.10-zts-alpine 2 | 3 | COPY develop /usr/src/php/ext/parallel 4 | COPY build.sh /usr/src/php/ext/parallel/build.sh 5 | 6 | RUN /usr/src/php/ext/parallel/build.sh test 7 | -------------------------------------------------------------------------------- /Dockerfile-develop-7.4: -------------------------------------------------------------------------------- 1 | FROM php:7.4.23-zts 2 | 3 | COPY develop /usr/src/php/ext/parallel 4 | COPY build.sh /usr/src/php/ext/parallel/build.sh 5 | 6 | RUN /usr/src/php/ext/parallel/build.sh 7 | -------------------------------------------------------------------------------- /Dockerfile-develop-8.0: -------------------------------------------------------------------------------- 1 | FROM php:8.0.10-zts 2 | 3 | COPY develop /usr/src/php/ext/parallel 4 | COPY build.sh /usr/src/php/ext/parallel/build.sh 5 | 6 | RUN /usr/src/php/ext/parallel/build.sh 7 | -------------------------------------------------------------------------------- /Dockerfile-release-7.4: -------------------------------------------------------------------------------- 1 | FROM php:7.4.23-zts 2 | 3 | RUN pecl install parallel && \ 4 | docker-php-ext-enable parallel && \ 5 | EXTENSION_DIR=`php-config --extension-dir 2>/dev/null` && \ 6 | echo "=====================================================================" && \ 7 | echo "Finished building. SHA256:" && \ 8 | sha256sum "$EXTENSION_DIR/parallel.so" | sed "s/ /\n/" && \ 9 | echo "=====================================================================" 10 | -------------------------------------------------------------------------------- /Dockerfile-release-8.0: -------------------------------------------------------------------------------- 1 | FROM php:8.0.10-zts 2 | 3 | COPY develop /usr/src/php/ext/parallel 4 | COPY build.sh /usr/src/php/ext/parallel/build.sh 5 | 6 | RUN /usr/src/php/ext/parallel/build.sh test 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Peter Stalman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # php-parallel-docker 2 | 3 | [![Docker Pulls](https://img.shields.io/docker/pulls/sarkedev/php-parallel)](https://hub.docker.com/r/sarkedev/php-parallel) 4 | 5 | A docker image based on the official PHP:7.4-zts or PHP:8.0-zts images that adds the [parallel extension](https://github.com/krakjoe/parallel) 6 | 7 | ``` 8 | docker pull sarkedev/php-parallel 9 | ``` 10 | 11 | ``` 12 | docker run --rm -v `pwd`:`pwd` -w `pwd` sarkedev/php-parallel php yourphpfile.php 13 | ``` 14 | 15 | ## Latest 16 | 17 | The default tag `latest` is based on `php:7.4-zts-alpine` and the release branch of [krakjoe/parallel](https://github.com/krakjoe/parallel). 18 | 19 | ## Development builds 20 | 21 | The default is based on the `release` branch and only builds if the `make test` succeeds. If you want to try the `develop` branch you can try the `sarkedev/php-parallel:develop` and similar tags. 22 | 23 | Images are also tagged with the short commit hash of the [krakjoe/parallel](https://github.com/krakjoe/parallel) commit it is building. 24 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | EXT="parallel" 5 | 6 | cd "/usr/src/php/ext/$EXT" 7 | 8 | docker-php-source extract 9 | 10 | docker-php-ext-configure $EXT 11 | 12 | if [ $1 = "test" ]; then 13 | make test TESTS="-q --show-diff tests" 14 | else 15 | make test TESTS="-q --show-diff tests" || true 16 | fi 17 | 18 | docker-php-ext-install $EXT 19 | 20 | #docker-php-source delete 21 | 22 | set +x 23 | EXTENSION_DIR=`php-config --extension-dir 2>/dev/null` 24 | 25 | echo "=====================================================================" 26 | echo "Finished building. SHA256:" 27 | sha256sum "$EXTENSION_DIR/$EXT.so" | sed "s/ /\n/" 28 | echo "=====================================================================" 29 | -------------------------------------------------------------------------------- /hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | EXT="parallel" 5 | PHP_VERSION=$(docker run $IMAGE_NAME php -r 'echo phpversion();') 6 | PARTS=(${DOCKER_TAG//-/ }) 7 | 8 | if [[ ${PARTS[0]} = "develop" ]]; then 9 | BRANCH="develop" 10 | fi 11 | 12 | cd "${BRANCH:-release}" 13 | UPSTREAM_COMMIT=$(git rev-parse --short HEAD) 14 | 15 | TAGS=( "${PARTS[0]}-${PHP_VERSION}-${UPSTREAM_COMMIT}" ) 16 | 17 | if [[ ${PARTS[1]} = "7.4" ]]; then 18 | TAGS+=( ${PARTS[0]} ) 19 | 20 | if [[ ${PARTS[0]} = "alpine" ]]; then 21 | TAGS+=( "latest" ) 22 | fi 23 | fi 24 | 25 | for TAG in "${TAGS[@]}" 26 | do 27 | docker tag $IMAGE_NAME $DOCKER_REPO:$TAG 28 | docker push $DOCKER_REPO:$TAG 29 | done 30 | --------------------------------------------------------------------------------