├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── docker-hub.yml │ ├── github-container-registry.yml │ └── props-bot.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── config └── php-fpm-php.conf ├── entrypoint ├── common.sh ├── entrypoint-cli.sh ├── entrypoint-php.sh └── entrypoint-phpunit.sh ├── images ├── 5.2 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 5.3 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 5.4 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 5.5 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 5.6.20 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 5.6 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 7.0 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 7.1 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 7.2 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 7.3 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 7.4 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 8.0 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 8.1 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 8.2 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 8.3 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh ├── 8.4 │ ├── cli │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── php │ │ ├── Dockerfile │ │ ├── common.sh │ │ ├── entrypoint.sh │ │ └── php-fpm.conf │ └── phpunit │ │ ├── Dockerfile │ │ └── entrypoint.sh └── phpunit │ ├── 4-php-5.6.20 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 4-php-5.6 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 5-php-5.6.20 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 5-php-5.6 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 5-php-7.0 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 6-php-7.0 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 6-php-7.1 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 6-php-7.2 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 6-php-7.3 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 7-php-7.0 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 7-php-7.1 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 7-php-7.2 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 7-php-7.3 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 7-php-7.4 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 8-php-7.2 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 8-php-7.3 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 8-php-7.4 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 8-php-8.0 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 8-php-8.1 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 8-php-8.2 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 9-php-7.3 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 9-php-7.4 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 9-php-8.0 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 9-php-8.1 │ ├── Dockerfile │ └── entrypoint.sh │ ├── 9-php-8.2 │ ├── Dockerfile │ └── entrypoint.sh │ └── 9-php-8.3 │ ├── Dockerfile │ └── entrypoint.sh ├── templates ├── Dockerfile-cli.template ├── Dockerfile-php.template ├── Dockerfile-phpunit.template └── workflow.yml-template └── update.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Configure Dependabot scanning. 2 | version: 2 3 | 4 | updates: 5 | # Check for updates to GitHub Actions. 6 | - package-ecosystem: "github-actions" 7 | directory: "/" 8 | schedule: 9 | interval: "weekly" 10 | open-pull-requests-limit: 10 11 | groups: 12 | github-actions: 13 | patterns: 14 | - "*" 15 | -------------------------------------------------------------------------------- /.github/workflows/docker-hub.yml: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # 3 | # WARNING: This file was generated by update.php. 4 | # 5 | # You can find the relevant template in the `/templates` folder. 6 | # 7 | 8 | name: Build and publish images to Docker Hub 9 | 10 | on: 11 | push: 12 | branches: 13 | - trunk 14 | paths: 15 | - 'config/**' 16 | - 'entrypoint/**' 17 | - 'images/**' 18 | - '.github/workflows/docker-hub.yml' 19 | workflow_dispatch: 20 | # Once weekly On Sundays at 00:00 UTC. 21 | schedule: 22 | - cron: '0 0 * * 0' 23 | 24 | env: 25 | REGISTRY_USERNAME: garypendergast 26 | REGISTRY_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 27 | PACKAGE_REGISTRY_HOST: 28 | PACKAGE_REGISTRY: wordpressdevelop 29 | PR_TAG: 30 | 31 | 32 | # Cancels all previous workflow runs for pull requests that have not completed. 33 | concurrency: 34 | # The concurrency group contains the workflow name and the branch name for pull requests 35 | # or the commit hash for any other events. 36 | group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} 37 | cancel-in-progress: true 38 | 39 | jobs: 40 | 41 | build-php-images: 42 | name: PHP ${{ matrix.php }} Image 43 | runs-on: ubuntu-latest 44 | 45 | strategy: 46 | matrix: 47 | php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] 48 | env: 49 | PHP_VERSION: ${{ matrix.php }} 50 | PHP_LATEST: '8.2' 51 | 52 | steps: 53 | - name: Checkout repository 54 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 55 | 56 | - name: Login to the package registry 57 | run: | 58 | echo "$REGISTRY_PASSWORD" | docker login $PACKAGE_REGISTRY_HOST -u "$REGISTRY_USERNAME" --password-stdin 59 | 60 | - name: Build Docker image 61 | run: docker build --build-arg PACKAGE_REGISTRY=$PACKAGE_REGISTRY --build-arg PR_TAG=$PR_TAG -t $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG images/$PHP_VERSION/php 62 | 63 | - name: Log Docker images 64 | run: docker images 65 | 66 | - name: Push Docker image 67 | run: docker push $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG 68 | 69 | - name: Push image as latest 70 | if: ${{ env.PHP_LATEST == env.PHP_VERSION }} 71 | run: | 72 | docker image tag $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG $PACKAGE_REGISTRY/php:latest$PR_TAG 73 | docker images 74 | docker push $PACKAGE_REGISTRY/php:latest$PR_TAG 75 | 76 | build-cli-images: 77 | name: CLI on PHP ${{ matrix.php }} 78 | runs-on: ubuntu-latest 79 | needs: build-php-images 80 | strategy: 81 | matrix: 82 | php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] 83 | 84 | env: 85 | PHP_VERSION: ${{ matrix.php }} 86 | PHP_LATEST: '8.2' 87 | 88 | steps: 89 | - name: Checkout repository 90 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 91 | 92 | - name: Login to the package registry 93 | run: | 94 | echo "$REGISTRY_PASSWORD" | docker login $PACKAGE_REGISTRY_HOST -u "$REGISTRY_USERNAME" --password-stdin 95 | 96 | - name: Build Docker image 97 | run: docker build --build-arg PACKAGE_REGISTRY=$PACKAGE_REGISTRY --build-arg PR_TAG=$PR_TAG -t $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG images/$PHP_VERSION/cli 98 | 99 | - name: Log Docker images 100 | run: docker images 101 | 102 | - name: Push Docker image 103 | run: docker push $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG 104 | 105 | - name: Push image as latest 106 | if: ${{ env.PHP_LATEST == env.PHP_VERSION }} 107 | run: | 108 | docker image tag $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG $PACKAGE_REGISTRY/cli:latest$PR_TAG 109 | docker push $PACKAGE_REGISTRY/cli:latest$PR_TAG 110 | -------------------------------------------------------------------------------- /.github/workflows/github-container-registry.yml: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # 3 | # WARNING: This file was generated by update.php. 4 | # 5 | # You can find the relevant template in the `/templates` folder. 6 | # 7 | 8 | 9 | name: Build test images 10 | 11 | on: 12 | pull_request: 13 | workflow_dispatch: 14 | 15 | env: 16 | REGISTRY_USERNAME: desrosj 17 | REGISTRY_PASSWORD: ${{ secrets.GHCR_TOKEN }} 18 | PACKAGE_REGISTRY_HOST: ghcr.io 19 | PACKAGE_REGISTRY: ghcr.io/wordpress/wpdev-docker-images 20 | PR_TAG: -${{ github.event.number }} 21 | 22 | # Cancels all previous workflow runs for pull requests that have not completed. 23 | concurrency: 24 | # The concurrency group contains the workflow name and the branch name for pull requests 25 | # or the commit hash for any other events. 26 | group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} 27 | cancel-in-progress: true 28 | 29 | jobs: 30 | 31 | check-for-changes: 32 | name: Check for uncommitted changes 33 | runs-on: ubuntu-latest 34 | 35 | steps: 36 | - name: Checkout repository 37 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 38 | 39 | - name: Setup PHP 40 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v.2.31.1 41 | with: 42 | php-version: 'latest' 43 | 44 | - name: Build images 45 | run: php update.php 46 | 47 | - name: Ensure version-controlled files are not modified or deleted 48 | run: git diff --exit-code 49 | 50 | build-php-images: 51 | name: PHP ${{ matrix.php }} Image 52 | runs-on: ubuntu-latest 53 | needs: [ check-for-changes ] 54 | strategy: 55 | matrix: 56 | php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] 57 | env: 58 | PHP_VERSION: ${{ matrix.php }} 59 | PHP_LATEST: '8.2' 60 | 61 | steps: 62 | - name: Checkout repository 63 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 64 | 65 | - name: Login to the package registry 66 | run: | 67 | echo "$REGISTRY_PASSWORD" | docker login $PACKAGE_REGISTRY_HOST -u "$REGISTRY_USERNAME" --password-stdin 68 | 69 | - name: Build Docker image 70 | run: docker build --build-arg PACKAGE_REGISTRY=$PACKAGE_REGISTRY --build-arg PR_TAG=$PR_TAG -t $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG images/$PHP_VERSION/php 71 | 72 | - name: Log Docker images 73 | run: docker images 74 | 75 | - name: Push Docker image 76 | run: docker push $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG 77 | 78 | - name: Push image as latest 79 | if: ${{ env.PHP_LATEST == env.PHP_VERSION }} 80 | run: | 81 | docker image tag $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG $PACKAGE_REGISTRY/php:latest$PR_TAG 82 | docker images 83 | docker push $PACKAGE_REGISTRY/php:latest$PR_TAG 84 | 85 | build-cli-images: 86 | name: CLI on PHP ${{ matrix.php }} 87 | runs-on: ubuntu-latest 88 | needs: build-php-images 89 | strategy: 90 | matrix: 91 | php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] 92 | 93 | env: 94 | PHP_VERSION: ${{ matrix.php }} 95 | PHP_LATEST: '8.2' 96 | 97 | steps: 98 | - name: Checkout repository 99 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 100 | 101 | - name: Login to the package registry 102 | run: | 103 | echo "$REGISTRY_PASSWORD" | docker login $PACKAGE_REGISTRY_HOST -u "$REGISTRY_USERNAME" --password-stdin 104 | 105 | - name: Build Docker image 106 | run: docker build --build-arg PACKAGE_REGISTRY=$PACKAGE_REGISTRY --build-arg PR_TAG=$PR_TAG -t $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG images/$PHP_VERSION/cli 107 | 108 | - name: Log Docker images 109 | run: docker images 110 | 111 | - name: Push Docker image 112 | run: docker push $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG 113 | 114 | - name: Push image as latest 115 | if: ${{ env.PHP_LATEST == env.PHP_VERSION }} 116 | run: | 117 | docker image tag $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG $PACKAGE_REGISTRY/cli:latest$PR_TAG 118 | docker push $PACKAGE_REGISTRY/cli:latest$PR_TAG 119 | -------------------------------------------------------------------------------- /.github/workflows/props-bot.yml: -------------------------------------------------------------------------------- 1 | name: Props Bot 2 | 3 | on: 4 | # This event runs anytime a PR is (re)opened, updated, marked ready for review, or labeled. 5 | # GitHub does not allow filtering the `labeled` event by a specific label. 6 | # However, the logic below will short-circuit the workflow when the `props-bot` label is not the one being added. 7 | # Note: The pull_request_target event is used instead of pull_request because this workflow needs permission to comment 8 | # on the pull request. Because this event grants extra permissions to `GITHUB_TOKEN`, any code changes within the PR 9 | # should be considered untrusted. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/. 10 | pull_request_target: 11 | types: 12 | - opened 13 | - synchronize 14 | - reopened 15 | - labeled 16 | - ready_for_review 17 | # This event runs anytime a comment is added or deleted. 18 | # You cannot filter this event for PR comments only. 19 | # However, the logic below does short-circuit the workflow for issues. 20 | issue_comment: 21 | types: 22 | - created 23 | # This event will run everytime a new PR review is initially submitted. 24 | pull_request_review: 25 | types: 26 | - submitted 27 | # This event runs anytime a PR review comment is created or deleted. 28 | pull_request_review_comment: 29 | types: 30 | - created 31 | 32 | # Cancels all previous workflow runs for pull requests that have not completed. 33 | concurrency: 34 | # The concurrency group contains the workflow name and the branch name for pull requests 35 | # or the commit hash for any other events. 36 | group: ${{ github.workflow }}-${{ contains( fromJSON( '["pull_request_target", "pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && github.head_ref || github.sha }} 37 | cancel-in-progress: true 38 | 39 | # Disable permissions for all available scopes by default. 40 | # Any needed permissions should be configured at the job level. 41 | permissions: {} 42 | 43 | jobs: 44 | # Compiles a list of props for a pull request. 45 | # 46 | # Performs the following steps: 47 | # - Collects a list of contributor props and leaves a comment. 48 | # - Removes the props-bot label, if necessary. 49 | props-bot: 50 | name: Generate a list of props 51 | runs-on: ubuntu-latest 52 | permissions: 53 | # The action needs permission `write` permission for PRs in order to add a comment. 54 | pull-requests: write 55 | contents: read 56 | timeout-minutes: 20 57 | # The job will run when pull requests are open, ready for review and: 58 | # 59 | # - A comment is added to the pull request. 60 | # - A review is created or commented on (unless PR originates from a fork). 61 | # - The pull request is opened, synchronized, marked ready for review, or reopened. 62 | # - The `props-bot` label is added to the pull request. 63 | if: | 64 | ( 65 | github.event_name == 'issue_comment' && github.event.issue.pull_request || 66 | ( contains( fromJSON( '["pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && ! github.event.pull_request.head.repo.fork ) || 67 | github.event_name == 'pull_request_target' && github.event.action != 'labeled' || 68 | 'props-bot' == github.event.label.name 69 | ) && 70 | ( ! github.event.pull_request.draft && github.event.pull_request.state == 'open' || ! github.event.issue.draft && github.event.issue.state == 'open' ) 71 | 72 | steps: 73 | - name: Gather a list of contributors 74 | uses: WordPress/props-bot-action@trunk 75 | with: 76 | format: 'git' 77 | 78 | - name: Remove the props-bot label 79 | uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 80 | if: ${{ github.event.action == 'labeled' && 'props-bot' == github.event.label.name }} 81 | with: 82 | retries: 2 83 | retry-exempt-status-codes: 418 84 | script: | 85 | github.rest.issues.removeLabel({ 86 | owner: context.repo.owner, 87 | repo: context.repo.repo, 88 | issue_number: '${{ github.event.number }}', 89 | name: 'props-bot' 90 | }); 91 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for considering contributing to WordPress' development Docker images! If you're unsure of anything, know that you're 💯 welcome to submit an issue or pull request on any topic. The worst that can happen is that you'll be politely directed to the best location to ask your question or to change something in your pull request. We appreciate any sort of contribution and don't want a wall of rules to get in the way of that. 4 | 5 | As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://make.wordpress.org/handbook/community-code-of-conduct/). 6 | 7 | All WordPress projects are [licensed under the GPLv2+](/LICENSE), and all contributions to this project will be released under the GPLv2+ license. You maintain copyright over any contribution you make, and by submitting a pull request, you are agreeing to release that contribution under the GPLv2+ license. 8 | 9 | This document covers the technical details around setup, and submitting your contribution to this project. 10 | 11 | ## Generating Images 12 | 13 | After modifying any of the Dockerfile template files, you'll need to regenerate them built Dockerfiles. You can do this by running `php update.php`, you should see your changes reflect across all PHP versions. 14 | 15 | ## Testing Images 16 | 17 | When submitting a Pull Request, images will be automatically built for you, and hosted on the GitHub Container Registry. As this service is currently in beta, you will need to login to the package registry, even for pulling images. You can read more about this in the [GitHub Container Registry documentation](https://docs.github.com/en/free-pro-team@latest/packages/getting-started-with-github-container-registry/about-github-container-registry). 18 | 19 | Once Travis finishes building all of these packages, you can modify [`docker-compose.yml`](https://github.com/WordPress/wordpress-develop/blob/master/tools/local-env/docker-compose.yml) and [`docker-compose.scripts.yml`](https://github.com/WordPress/wordpress-develop/blob/master/tools/local-env/docker-compose.scripts.yml) to pull from GitHub. For example, the `image` in the PHP container would change from `wordpressdevelop/php:${LOCAL_PHP-latest}` to `ghcr.io/wordpress/wpdev-docker-images/php:${LOCAL_PHP-latest}-PR_NUMBER`, where `PR_NUMBER` is the number of the Pull Request you submitted. 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordPress Development Docker Images 2 | 3 | These Docker images are used by the WordPress Development Environment. 4 | 5 | ## Getting Started 6 | 7 | - **Download:** These Docker images are built for developing WordPress. You can use them by checking out [the WordPress repository](https://make.wordpress.org/core/handbook/contribute/#the-repositories), and running `npm run env:start`. 8 | - **Discuss:** Conversations and discussions take place in [the #core channel](https://wordpress.slack.com/archives/C02RQBWTW) on the [Making WordPress Slack](https://make.wordpress.org/chat/). 9 | - **Contribute:** Development of these Docker images happens in this GitHub repo. Get started by [reading the contributing guidelines](/CONTRIBUTING.md). 10 | -------------------------------------------------------------------------------- /config/php-fpm-php.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /entrypoint/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /entrypoint/entrypoint-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /entrypoint/entrypoint-php.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /entrypoint/entrypoint-phpunit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/5.2/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | ENTRYPOINT [ "echo", "WP-CLI is not available for PHP 5.2-fpm.\nCommand was not executed:" ] 14 | 15 | 16 | WORKDIR /var/www 17 | 18 | CMD [ "wp", "shell" ] 19 | -------------------------------------------------------------------------------- /images/5.2/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/5.2/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM devilbox/php-fpm-5.2:latest 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends sudo rsync; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | \ 24 | pecl install zendopcache-7.0.5; \ 25 | pecl install xdebug-2.2.7; 26 | 27 | COPY entrypoint.sh /entrypoint.sh 28 | COPY common.sh /common.sh 29 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 30 | 31 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 32 | RUN if [ -f $imagemagic_config ] ; then \ 33 | sed -i 's///g' $imagemagic_config; \ 34 | else \ 35 | echo did not see file $imagemagic_config; \ 36 | fi 37 | 38 | RUN chmod +x /entrypoint.sh && \ 39 | chmod +x /common.sh && \ 40 | groupadd -g 1000 -r wp_php && \ 41 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 42 | 43 | ENTRYPOINT [ "/entrypoint.sh" ] 44 | 45 | CMD [ "php-fpm" ] 46 | -------------------------------------------------------------------------------- /images/5.2/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/5.2/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/5.2/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/5.2/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-3.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/5.2/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/5.3/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://github.com/wp-cli/wp-cli/releases/download/v1.5.1/wp-cli-1.5.1.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/5.3/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/5.3/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM devilbox/php-fpm-5.3:0.21 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libicu-dev libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd mysql mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install zendopcache-7.0.5; \ 31 | pecl install xdebug-2.2.7; \ 32 | \ 33 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 34 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 35 | php -r " \ 36 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 37 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 38 | if ( \$signature !== \$hash ) { \ 39 | unlink( '/tmp/installer.php' ); \ 40 | unlink( '/tmp/installer.sig' ); \ 41 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 42 | exit( 1 ); \ 43 | }"; \ 44 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 45 | composer --ansi --version --no-interaction; \ 46 | rm -f /tmp/installer.php /tmp/installer.sig; 47 | 48 | COPY entrypoint.sh /entrypoint.sh 49 | COPY common.sh /common.sh 50 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 51 | 52 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 53 | RUN if [ -f $imagemagic_config ] ; then \ 54 | sed -i 's///g' $imagemagic_config; \ 55 | else \ 56 | echo did not see file $imagemagic_config; \ 57 | fi 58 | 59 | RUN chmod +x /entrypoint.sh && \ 60 | chmod +x /common.sh && \ 61 | groupadd -g 1000 -r wp_php && \ 62 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 63 | 64 | ENTRYPOINT [ "/entrypoint.sh" ] 65 | 66 | CMD [ "php-fpm" ] 67 | -------------------------------------------------------------------------------- /images/5.3/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/5.3/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/5.3/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/5.3/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-4.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/5.3/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/5.4/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://github.com/wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/5.4/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/5.4/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.4-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libicu-dev libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd mysql mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install zendopcache-7.0.5; \ 31 | pecl install xdebug-2.4.1; \ 32 | pecl install memcached-2.2.0; \ 33 | pecl install imagick-3.4.4; \ 34 | docker-php-ext-enable imagick; \ 35 | \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 37 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 38 | php -r " \ 39 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 40 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 41 | if ( \$signature !== \$hash ) { \ 42 | unlink( '/tmp/installer.php' ); \ 43 | unlink( '/tmp/installer.sig' ); \ 44 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 45 | exit( 1 ); \ 46 | }"; \ 47 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 48 | composer --ansi --version --no-interaction; \ 49 | rm -f /tmp/installer.php /tmp/installer.sig; 50 | 51 | COPY entrypoint.sh /entrypoint.sh 52 | COPY common.sh /common.sh 53 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 54 | 55 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 56 | RUN if [ -f $imagemagic_config ] ; then \ 57 | sed -i 's///g' $imagemagic_config; \ 58 | else \ 59 | echo did not see file $imagemagic_config; \ 60 | fi 61 | 62 | RUN chmod +x /entrypoint.sh && \ 63 | chmod +x /common.sh && \ 64 | groupadd -g 1000 -r wp_php && \ 65 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 66 | 67 | ENTRYPOINT [ "/entrypoint.sh" ] 68 | 69 | CMD [ "php-fpm" ] 70 | -------------------------------------------------------------------------------- /images/5.4/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/5.4/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/5.4/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/5.4/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-4.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/5.4/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/5.5/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.5-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://github.com/wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/5.5/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/5.5/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.5-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libicu-dev libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd mysql mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install xdebug-2.5.5; \ 31 | pecl install memcached-2.2.0; \ 32 | pecl install imagick-3.4.4; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/5.5/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/5.5/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/5.5/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/5.5/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.5-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-4.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/5.5/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/5.6.20/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6.20-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/5.6.20/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/5.6.20/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6.20-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libicu-dev libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd mysql mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install xdebug-2.5.5; \ 31 | pecl install memcached-2.2.0; \ 32 | pecl install imagick-3.4.4; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/5.6.20/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/5.6.20/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/5.6.20/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/5.6.20/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6.20-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-5.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/5.6.20/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/5.6/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/5.6/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/5.6/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:5.6-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd mysql mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install xdebug-2.5.5; \ 31 | pecl install memcached-2.2.0; \ 32 | pecl install imagick-3.4.4; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/5.6/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/5.6/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/5.6/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/5.6/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-5.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/5.6/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/7.0/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/7.0/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/7.0/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.0-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | echo 'deb http://archive.debian.org/debian stretch main contrib non-free' | tee /etc/apt/sources.list; \ 19 | \ 20 | apt-get update; \ 21 | \ 22 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 23 | apt-get upgrade openssl -y; \ 24 | update-ca-certificates --fresh; \ 25 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 26 | locale-gen; \ 27 | \ 28 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 29 | \ 30 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 31 | \ 32 | pecl install xdebug-2.7.2; \ 33 | pecl install memcached-3.1.5; \ 34 | pecl install imagick; \ 35 | docker-php-ext-enable imagick; \ 36 | \ 37 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 38 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 39 | php -r " \ 40 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 41 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 42 | if ( \$signature !== \$hash ) { \ 43 | unlink( '/tmp/installer.php' ); \ 44 | unlink( '/tmp/installer.sig' ); \ 45 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 46 | exit( 1 ); \ 47 | }"; \ 48 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 49 | composer --ansi --version --no-interaction; \ 50 | rm -f /tmp/installer.php /tmp/installer.sig; 51 | 52 | COPY entrypoint.sh /entrypoint.sh 53 | COPY common.sh /common.sh 54 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 55 | 56 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 57 | RUN if [ -f $imagemagic_config ] ; then \ 58 | sed -i 's///g' $imagemagic_config; \ 59 | else \ 60 | echo did not see file $imagemagic_config; \ 61 | fi 62 | 63 | RUN chmod +x /entrypoint.sh && \ 64 | chmod +x /common.sh && \ 65 | groupadd -g 1000 -r wp_php && \ 66 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 67 | 68 | ENTRYPOINT [ "/entrypoint.sh" ] 69 | 70 | CMD [ "php-fpm" ] 71 | -------------------------------------------------------------------------------- /images/7.0/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/7.0/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/7.0/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/7.0/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-6.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/7.0/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/7.1/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/7.1/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/7.1/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install xdebug-2.9.8; \ 31 | pecl install memcached-3.1.5; \ 32 | pecl install imagick; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/7.1/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/7.1/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/7.1/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/7.1/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/7.1/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/7.2/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/7.2/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/7.2/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install xdebug-3.1.6; \ 31 | pecl install memcached-3.3.0; \ 32 | pecl install imagick; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/7.2/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/7.2/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/7.2/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/7.2/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/7.2/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/7.3/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/7.3/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/7.3/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.3-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install xdebug-3.1.6; \ 31 | pecl install memcached-3.3.0; \ 32 | pecl install imagick; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/7.3/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/7.3/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/7.3/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/7.3/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/7.3/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/7.4/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/7.4/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/7.4/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install xdebug-3.1.6; \ 31 | pecl install memcached-3.3.0; \ 32 | pecl install imagick; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/7.4/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/7.4/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/7.4/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/7.4/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/7.4/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/8.0/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/8.0/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/8.0/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install memcached-3.3.0; \ 31 | pecl install xdebug-3.4.0; \ 32 | pecl install imagick; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/8.0/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/8.0/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/8.0/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/8.0/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/8.0/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/8.1/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/8.1/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/8.1/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.1-fpm-bullseye 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install memcached-3.3.0; \ 31 | pecl install xdebug-3.4.0; \ 32 | pecl install imagick; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/8.1/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/8.1/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/8.1/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/8.1/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/8.1/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/8.2/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/8.2/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/8.2/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-fpm-bullseye 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install memcached-3.3.0; \ 31 | pecl install xdebug-3.4.0; \ 32 | pecl install imagick; \ 33 | docker-php-ext-enable imagick; \ 34 | \ 35 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 36 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 37 | php -r " \ 38 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 39 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 40 | if ( \$signature !== \$hash ) { \ 41 | unlink( '/tmp/installer.php' ); \ 42 | unlink( '/tmp/installer.sig' ); \ 43 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 44 | exit( 1 ); \ 45 | }"; \ 46 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 47 | composer --ansi --version --no-interaction; \ 48 | rm -f /tmp/installer.php /tmp/installer.sig; 49 | 50 | COPY entrypoint.sh /entrypoint.sh 51 | COPY common.sh /common.sh 52 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 53 | 54 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 55 | RUN if [ -f $imagemagic_config ] ; then \ 56 | sed -i 's///g' $imagemagic_config; \ 57 | else \ 58 | echo did not see file $imagemagic_config; \ 59 | fi 60 | 61 | RUN chmod +x /entrypoint.sh && \ 62 | chmod +x /common.sh && \ 63 | groupadd -g 1000 -r wp_php && \ 64 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 65 | 66 | ENTRYPOINT [ "/entrypoint.sh" ] 67 | 68 | CMD [ "php-fpm" ] 69 | -------------------------------------------------------------------------------- /images/8.2/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/8.2/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/8.2/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/8.2/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/8.2/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/8.3/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/8.3/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/8.3/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libssl-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install memcached-3.3.0; \ 31 | pecl install xdebug-3.4.0; \ 32 | \ 33 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 34 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 35 | php -r " \ 36 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 37 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 38 | if ( \$signature !== \$hash ) { \ 39 | unlink( '/tmp/installer.php' ); \ 40 | unlink( '/tmp/installer.sig' ); \ 41 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 42 | exit( 1 ); \ 43 | }"; \ 44 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 45 | composer --ansi --version --no-interaction; \ 46 | rm -f /tmp/installer.php /tmp/installer.sig; 47 | 48 | COPY entrypoint.sh /entrypoint.sh 49 | COPY common.sh /common.sh 50 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 51 | 52 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 53 | RUN if [ -f $imagemagic_config ] ; then \ 54 | sed -i 's///g' $imagemagic_config; \ 55 | else \ 56 | echo did not see file $imagemagic_config; \ 57 | fi 58 | 59 | RUN chmod +x /entrypoint.sh && \ 60 | chmod +x /common.sh && \ 61 | groupadd -g 1000 -r wp_php && \ 62 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 63 | 64 | ENTRYPOINT [ "/entrypoint.sh" ] 65 | 66 | CMD [ "php-fpm" ] 67 | -------------------------------------------------------------------------------- /images/8.3/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/8.3/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/8.3/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/8.3/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/8.3/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/8.4/cli/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | 13 | # install wp-cli dependences 14 | RUN set -ex; \ 15 | \ 16 | apt-get update; \ 17 | \ 18 | apt-get install -y --no-install-recommends \ 19 | less \ 20 | virtual-mysql-client \ 21 | ; 22 | 23 | RUN set -ex; \ 24 | \ 25 | curl -L -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; \ 26 | \ 27 | chmod +x /usr/local/bin/wp; \ 28 | \ 29 | wp --allow-root --version; 30 | 31 | COPY entrypoint.sh /entrypoint.sh 32 | 33 | RUN chmod +x /entrypoint.sh 34 | 35 | # WP CLI config 36 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 37 | 38 | ENTRYPOINT [ "/entrypoint.sh" ] 39 | 40 | 41 | WORKDIR /var/www 42 | 43 | CMD [ "wp", "shell" ] 44 | -------------------------------------------------------------------------------- /images/8.4/cli/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # first arg is `-f` or `--some-option` 7 | if [ "${1#-}" != "$1" ]; then 8 | set -- wp "$@" 9 | fi 10 | 11 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 12 | if sudo -u wp_php wp --path=/dev/null help "$1" > /dev/null 2>&1; then 13 | set -- wp "$@" 14 | fi 15 | 16 | # Execute CMD 17 | sudo -E -u wp_php "$@" 18 | -------------------------------------------------------------------------------- /images/8.4/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.4-fpm 2 | 3 | WORKDIR /var/www 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | ENV COMPOSER_ALLOW_SUPERUSER 1 13 | ENV COMPOSER_HOME /tmp 14 | 15 | # install the PHP extensions we need 16 | RUN set -ex; \ 17 | \ 18 | apt-get update; \ 19 | \ 20 | apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libssl-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \ 21 | apt-get upgrade openssl -y; \ 22 | update-ca-certificates --fresh; \ 23 | sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \ 24 | locale-gen; \ 25 | \ 26 | docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \ 27 | \ 28 | docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \ 29 | \ 30 | pecl install memcached-3.3.0; \ 31 | pecl install xdebug-3.4.0; \ 32 | \ 33 | curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \ 34 | curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \ 35 | php -r " \ 36 | \$signature = file_get_contents( '/tmp/installer.sig' ); \ 37 | \$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \ 38 | if ( \$signature !== \$hash ) { \ 39 | unlink( '/tmp/installer.php' ); \ 40 | unlink( '/tmp/installer.sig' ); \ 41 | echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ 42 | exit( 1 ); \ 43 | }"; \ 44 | php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \ 45 | composer --ansi --version --no-interaction; \ 46 | rm -f /tmp/installer.php /tmp/installer.sig; 47 | 48 | COPY entrypoint.sh /entrypoint.sh 49 | COPY common.sh /common.sh 50 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 51 | 52 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 53 | RUN if [ -f $imagemagic_config ] ; then \ 54 | sed -i 's///g' $imagemagic_config; \ 55 | else \ 56 | echo did not see file $imagemagic_config; \ 57 | fi 58 | 59 | RUN chmod +x /entrypoint.sh && \ 60 | chmod +x /common.sh && \ 61 | groupadd -g 1000 -r wp_php && \ 62 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 63 | 64 | ENTRYPOINT [ "/entrypoint.sh" ] 65 | 66 | CMD [ "php-fpm" ] 67 | -------------------------------------------------------------------------------- /images/8.4/php/common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # If LOCAL_PHP_XDEBUG=true xdebug extension will be enabled 5 | if [ "$LOCAL_PHP_XDEBUG" = true ]; then 6 | docker-php-ext-enable xdebug 7 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 8 | else 9 | docker-php-ext-enable opcache 10 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 11 | fi 12 | 13 | # If LOCAL_PHP_MEMCACHED=true memcached extension will be enabled 14 | if [ "$LOCAL_PHP_MEMCACHED" = true ]; then 15 | docker-php-ext-enable memcached 16 | else 17 | rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini 18 | fi 19 | 20 | ### Change UID/GID 21 | WP_PHP_UID="${PHP_FPM_UID-1000}" 22 | WP_PHP_GID="${PHP_FPM_GID-1000}" 23 | 24 | if [ "$WP_PHP_UID" != "`id -u wp_php`" ]; then 25 | usermod -o -u "${WP_PHP_UID}" "wp_php" 26 | fi 27 | 28 | if [ "$WP_PHP_GID" != "`id -g wp_php`" ]; then 29 | groupmod -o -g "${WP_PHP_GID}" "wp_php" 30 | fi 31 | -------------------------------------------------------------------------------- /images/8.4/php/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | # Execute CMD 7 | exec "$@" 8 | -------------------------------------------------------------------------------- /images/8.4/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = wp_php 3 | group = wp_php -------------------------------------------------------------------------------- /images/8.4/phpunit/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/8.4/phpunit/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/4-php-5.6.20/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6.20-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-4.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/4-php-5.6.20/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/4-php-5.6/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-4.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/4-php-5.6/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/5-php-5.6.20/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6.20-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-5.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/5-php-5.6.20/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/5-php-5.6/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:5.6-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-5.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/5-php-5.6/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/5-php-7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-5.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/5-php-7.0/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-6.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.0/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.1/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-6.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.1/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.2/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-6.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.2/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-6.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/6-php-7.3/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sLk https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.0/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.1/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.1/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.2/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.2/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.3/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.4/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/7-php-7.4/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/8-php-7.2/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-8.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/8-php-7.2/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/8-php-7.3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-8.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/8-php-7.3/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/8-php-7.4/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-8.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/8-php-7.4/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/8-php-8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-8.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/8-php-8.0/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/8-php-8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-8.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/8-php-8.1/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/8-php-8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-8.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/8-php-8.2/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/9-php-7.3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/9-php-7.3/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/9-php-7.4/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:7.4-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/9-php-7.4/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.0-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.0/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.1-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.1/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.2-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.2/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.3/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:8.3-fpm$PR_TAG 4 | 5 | ########################################################################## 6 | # 7 | # WARNING: This file was generated by update.php. 8 | # 9 | # You can find the relevant template in the `/templates` folder. 10 | # 11 | 12 | RUN curl -sL https://phar.phpunit.de/phpunit-9.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 13 | 14 | WORKDIR /var/www 15 | 16 | COPY entrypoint.sh /entrypoint.sh 17 | 18 | RUN chmod +x /entrypoint.sh 19 | 20 | ENTRYPOINT [ "/entrypoint.sh" ] 21 | 22 | CMD /usr/local/bin/phpunit 23 | -------------------------------------------------------------------------------- /images/phpunit/9-php-8.3/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | source /common.sh 5 | 6 | chown -R wp_php:wp_php /var/www/${LOCAL_DIR-src}/wp-content/uploads 7 | 8 | # Execute CMD 9 | sudo -E -u wp_php "$@" 10 | -------------------------------------------------------------------------------- /templates/Dockerfile-cli.template: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:%%VERSION_TAG%%$PR_TAG 4 | 5 | %%GENERATED_WARNING%% 6 | 7 | %%NEW_PHP%% 8 | # install wp-cli dependences 9 | RUN set -ex; \ 10 | \ 11 | apt-get update; \ 12 | \ 13 | apt-get install -y --no-install-recommends \ 14 | less \ 15 | %%MYSQL_CLIENT%% \ 16 | ; 17 | 18 | RUN set -ex; \ 19 | \ 20 | curl -L -o /usr/local/bin/wp %%DOWNLOAD_URL%%; \ 21 | \ 22 | chmod +x /usr/local/bin/wp; \ 23 | \ 24 | wp --allow-root --version; 25 | 26 | COPY entrypoint.sh /entrypoint.sh 27 | 28 | RUN chmod +x /entrypoint.sh 29 | 30 | # WP CLI config 31 | ENV WP_CLI_CACHE_DIR=/tmp/wp-cli 32 | 33 | ENTRYPOINT [ "/entrypoint.sh" ] 34 | %%/NEW_PHP%% 35 | 36 | %%OLD_PHP%% 37 | ENTRYPOINT [ "echo", "WP-CLI is not available for PHP %%VERSION_TAG%%.\nCommand was not executed:" ] 38 | %%/OLD_PHP%% 39 | 40 | WORKDIR /var/www 41 | 42 | CMD [ "wp", "shell" ] 43 | -------------------------------------------------------------------------------- /templates/Dockerfile-php.template: -------------------------------------------------------------------------------- 1 | FROM %%BASE_NAME%% 2 | 3 | WORKDIR /var/www 4 | 5 | %%GENERATED_WARNING%% 6 | 7 | ENV COMPOSER_ALLOW_SUPERUSER 1 8 | ENV COMPOSER_HOME /tmp 9 | 10 | %%INSTALL_EXTENSIONS%% 11 | 12 | COPY entrypoint.sh /entrypoint.sh 13 | COPY common.sh /common.sh 14 | COPY php-fpm.conf /usr/local/etc/php-fpm.d/zz-wordpress.conf 15 | 16 | ARG imagemagic_config=/etc/ImageMagick-6/policy.xml 17 | RUN if [ -f $imagemagic_config ] ; then \ 18 | sed -i 's///g' $imagemagic_config; \ 19 | else \ 20 | echo did not see file $imagemagic_config; \ 21 | fi 22 | 23 | RUN chmod +x /entrypoint.sh && \ 24 | chmod +x /common.sh && \ 25 | groupadd -g 1000 -r wp_php && \ 26 | useradd -u 1000 -s /bin/bash -g wp_php wp_php 27 | 28 | ENTRYPOINT [ "/entrypoint.sh" ] 29 | 30 | CMD [ "php-fpm" ] 31 | -------------------------------------------------------------------------------- /templates/Dockerfile-phpunit.template: -------------------------------------------------------------------------------- 1 | ARG PACKAGE_REGISTRY 2 | ARG PR_TAG 3 | FROM $PACKAGE_REGISTRY/php:%%VERSION_TAG%%$PR_TAG 4 | 5 | %%GENERATED_WARNING%% 6 | 7 | RUN curl -sL https://phar.phpunit.de/phpunit-%%PHPUNIT_VERSION%%.phar > /usr/local/bin/phpunit && chmod +x /usr/local/bin/phpunit 8 | 9 | WORKDIR /var/www 10 | 11 | COPY entrypoint.sh /entrypoint.sh 12 | 13 | RUN chmod +x /entrypoint.sh 14 | 15 | ENTRYPOINT [ "/entrypoint.sh" ] 16 | 17 | CMD /usr/local/bin/phpunit 18 | -------------------------------------------------------------------------------- /templates/workflow.yml-template: -------------------------------------------------------------------------------- 1 | %%GENERATED_WARNING%% 2 | %%DOCKER_HUB%% 3 | name: Build and publish images to Docker Hub 4 | 5 | on: 6 | push: 7 | branches: 8 | - trunk 9 | paths: 10 | - 'config/**' 11 | - 'entrypoint/**' 12 | - 'images/**' 13 | - '.github/workflows/docker-hub.yml' 14 | workflow_dispatch: 15 | # Once weekly On Sundays at 00:00 UTC. 16 | schedule: 17 | - cron: '0 0 * * 0' 18 | 19 | env: 20 | REGISTRY_USERNAME: garypendergast 21 | REGISTRY_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 22 | PACKAGE_REGISTRY_HOST: 23 | PACKAGE_REGISTRY: wordpressdevelop 24 | PR_TAG: 25 | %%/DOCKER_HUB%% 26 | %%GITHUB%% 27 | name: Build test images 28 | 29 | on: 30 | pull_request: 31 | workflow_dispatch: 32 | 33 | env: 34 | REGISTRY_USERNAME: desrosj 35 | REGISTRY_PASSWORD: ${{ secrets.GHCR_TOKEN }} 36 | PACKAGE_REGISTRY_HOST: ghcr.io 37 | PACKAGE_REGISTRY: ghcr.io/wordpress/wpdev-docker-images 38 | PR_TAG: -${{ github.event.number }} 39 | %%/GITHUB%% 40 | # Cancels all previous workflow runs for pull requests that have not completed. 41 | concurrency: 42 | # The concurrency group contains the workflow name and the branch name for pull requests 43 | # or the commit hash for any other events. 44 | group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} 45 | cancel-in-progress: true 46 | 47 | jobs: 48 | %%GITHUB%% 49 | check-for-changes: 50 | name: Check for uncommitted changes 51 | runs-on: ubuntu-latest 52 | 53 | steps: 54 | - name: Checkout repository 55 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 56 | 57 | - name: Setup PHP 58 | uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v.2.31.1 59 | with: 60 | php-version: 'latest' 61 | 62 | - name: Build images 63 | run: php update.php 64 | 65 | - name: Ensure version-controlled files are not modified or deleted 66 | run: git diff --exit-code 67 | %%/GITHUB%% 68 | build-php-images: 69 | name: PHP ${{ matrix.php }} Image 70 | runs-on: ubuntu-latest 71 | %%GITHUB%%needs: [ check-for-changes ]%%/GITHUB%% 72 | strategy: 73 | matrix: 74 | php: [ %%PHP_VERSION_LIST%% ] 75 | env: 76 | PHP_VERSION: ${{ matrix.php }} 77 | PHP_LATEST: '%%PHP_LATEST%%' 78 | 79 | steps: 80 | - name: Checkout repository 81 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 82 | 83 | - name: Login to the package registry 84 | run: | 85 | echo "$REGISTRY_PASSWORD" | docker login $PACKAGE_REGISTRY_HOST -u "$REGISTRY_USERNAME" --password-stdin 86 | 87 | - name: Build Docker image 88 | run: docker build --build-arg PACKAGE_REGISTRY=$PACKAGE_REGISTRY --build-arg PR_TAG=$PR_TAG -t $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG images/$PHP_VERSION/php 89 | 90 | - name: Log Docker images 91 | run: docker images 92 | 93 | - name: Push Docker image 94 | run: docker push $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG 95 | 96 | - name: Push image as latest 97 | if: ${{ env.PHP_LATEST == env.PHP_VERSION }} 98 | run: | 99 | docker image tag $PACKAGE_REGISTRY/php:$PHP_VERSION-fpm$PR_TAG $PACKAGE_REGISTRY/php:latest$PR_TAG 100 | docker images 101 | docker push $PACKAGE_REGISTRY/php:latest$PR_TAG 102 | 103 | build-cli-images: 104 | name: CLI on PHP ${{ matrix.php }} 105 | runs-on: ubuntu-latest 106 | needs: build-php-images 107 | strategy: 108 | matrix: 109 | php: [ %%PHP_VERSION_LIST%% ] 110 | 111 | env: 112 | PHP_VERSION: ${{ matrix.php }} 113 | PHP_LATEST: '%%PHP_LATEST%%' 114 | 115 | steps: 116 | - name: Checkout repository 117 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 118 | 119 | - name: Login to the package registry 120 | run: | 121 | echo "$REGISTRY_PASSWORD" | docker login $PACKAGE_REGISTRY_HOST -u "$REGISTRY_USERNAME" --password-stdin 122 | 123 | - name: Build Docker image 124 | run: docker build --build-arg PACKAGE_REGISTRY=$PACKAGE_REGISTRY --build-arg PR_TAG=$PR_TAG -t $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG images/$PHP_VERSION/cli 125 | 126 | - name: Log Docker images 127 | run: docker images 128 | 129 | - name: Push Docker image 130 | run: docker push $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG 131 | 132 | - name: Push image as latest 133 | if: ${{ env.PHP_LATEST == env.PHP_VERSION }} 134 | run: | 135 | docker image tag $PACKAGE_REGISTRY/cli:$PHP_VERSION-fpm$PR_TAG $PACKAGE_REGISTRY/cli:latest$PR_TAG 136 | docker push $PACKAGE_REGISTRY/cli:latest$PR_TAG 137 | -------------------------------------------------------------------------------- /update.php: -------------------------------------------------------------------------------- 1 | array( 31 | 'php' => array( 32 | 'base_name' => 'php:7.2-fpm', 33 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 34 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 35 | 'pecl_extensions' => array( 'xdebug-3.1.6', 'memcached-3.3.0', 'imagick' ), 36 | 'composer' => true, 37 | ), 38 | 'phpunit' => 7, 39 | 'cli' => array( 40 | 'mysql_client' => 'virtual-mysql-client', 41 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 42 | ), 43 | ), 44 | '7.3' => array( 45 | 'php' => array( 46 | 'base_name' => 'php:7.3-fpm', 47 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 48 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 49 | 'pecl_extensions' => array( 'xdebug-3.1.6', 'memcached-3.3.0', 'imagick' ), 50 | 'composer' => true, 51 | ), 52 | 'phpunit' => 7, 53 | 'cli' => array( 54 | 'mysql_client' => 'virtual-mysql-client', 55 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 56 | ), 57 | ), 58 | '7.4' => array( 59 | 'php' => array( 60 | 'base_name' => 'php:7.4-fpm', 61 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 62 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 63 | 'pecl_extensions' => array( 'xdebug-3.1.6', 'memcached-3.3.0', 'imagick' ), 64 | 'composer' => true, 65 | ), 66 | 'phpunit' => 7, 67 | 'cli' => array( 68 | 'mysql_client' => 'virtual-mysql-client', 69 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 70 | ), 71 | ), 72 | '8.0' => array( 73 | 'php' => array( 74 | 'base_name' => 'php:8.0-fpm', 75 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 76 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 77 | 'pecl_extensions' => array( 'memcached-3.3.0', 'xdebug-3.4.0', 'imagick' ), 78 | 'composer' => true, 79 | ), 80 | 'phpunit' => 9, 81 | 'cli' => array( 82 | 'mysql_client' => 'virtual-mysql-client', 83 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 84 | ), 85 | ), 86 | '8.1' => array( 87 | 'php' => array( 88 | 'base_name' => 'php:8.1-fpm', 89 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 90 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 91 | 'pecl_extensions' => array( 'memcached-3.3.0', 'xdebug-3.4.0', 'imagick' ), 92 | 'composer' => true, 93 | ), 94 | 'phpunit' => 9, 95 | 'cli' => array( 96 | 'mysql_client' => 'virtual-mysql-client', 97 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 98 | ), 99 | ), 100 | '8.2' => array( 101 | 'php' => array( 102 | 'base_name' => 'php:8.2-fpm', 103 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 104 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 105 | 'pecl_extensions' => array( 'memcached-3.3.0', 'xdebug-3.4.0', 'imagick' ), 106 | 'composer' => true, 107 | ), 108 | 'phpunit' => 9, 109 | 'cli' => array( 110 | 'mysql_client' => 'virtual-mysql-client', 111 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 112 | ), 113 | ), 114 | '8.3' => array( 115 | 'php' => array( 116 | 'base_name' => 'php:8.3-fpm', 117 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libssl-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 118 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 119 | 'pecl_extensions' => array( 'memcached-3.3.0', 'xdebug-3.4.0' ), 120 | 'composer' => true, 121 | ), 122 | 'phpunit' => 9, 123 | 'cli' => array( 124 | 'mysql_client' => 'virtual-mysql-client', 125 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 126 | ), 127 | ), 128 | '8.4' => array( 129 | 'php' => array( 130 | 'base_name' => 'php:8.4-fpm', 131 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libssl-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 132 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 133 | 'pecl_extensions' => array( 'memcached-3.3.0', 'xdebug-3.4.0' ), 134 | 'composer' => true, 135 | ), 136 | 'phpunit' => 9, 137 | 'cli' => array( 138 | 'mysql_client' => 'virtual-mysql-client', 139 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 140 | ), 141 | ), 142 | ); 143 | 144 | /** 145 | * An array of all legacy PHP versions that we need to generate images for, and their config settings. 146 | * 147 | * Each PHP version has settings for the PHP base image, the PHPUnit image, and the WP_CLI image. 148 | * 149 | * These versions of PHP have been unsupported for some time, and rarely need to be regenerated. 150 | * 151 | * @see https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/ 152 | * 153 | * @param array $php { 154 | * @type string $base_name The name of the Docker image to base our image off of. 155 | * @type array $apt An array of apt packages that need to be installed. 156 | * @type array $extensions An array of PHP extensions that need to be enabled. 157 | * @type array $pecl_extensions An array of PECL-sourced PHP extensions that will be installed, but not enabled. 158 | * } 159 | * 160 | * @param int $phpunit The major version branch of PHPUnit to install on this image. 161 | * 162 | * @param array|false $cli { 163 | * @type string $mysql_client The name of the MySQL client Ubuntu package on this image. 164 | * @type string $download_url The download URL for the version of WP-CLI to install on this image. 165 | * } 166 | */ 167 | $legacy_php_versions = array( 168 | '5.2' => array( 169 | 'php' => array( 170 | 'base_name' => 'devilbox/php-fpm-5.2:latest', 171 | 'apt' => array( 'sudo', 'rsync' ), 172 | 'extensions' => array(), 173 | 'pecl_extensions' => array( 'zendopcache-7.0.5', 'xdebug-2.2.7' ), 174 | 'composer' => false, 175 | ), 176 | 'phpunit' => 3, 177 | 'cli' => false, 178 | ), 179 | '5.3' => array( 180 | 'php' => array( 181 | 'base_name' => 'devilbox/php-fpm-5.3:0.21', 182 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libicu-dev', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 183 | 'extensions' => array( 'gd', 'mysql', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 184 | 'pecl_extensions' => array( 'zendopcache-7.0.5', 'xdebug-2.2.7' ), 185 | 'composer' => true, 186 | ), 187 | 'phpunit' => 4, 188 | 'cli' => array( 189 | 'mysql_client' => 'mysql-client', 190 | 'download_url' => 'https://github.com/wp-cli/wp-cli/releases/download/v1.5.1/wp-cli-1.5.1.phar', 191 | ), 192 | ), 193 | '5.4' => array( 194 | 'php' => array( 195 | 'base_name' => 'php:5.4-fpm', 196 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libicu-dev', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 197 | 'extensions' => array( 'gd', 'mysql', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 198 | 'pecl_extensions' => array( 'zendopcache-7.0.5', 'xdebug-2.4.1', 'memcached-2.2.0', 'imagick-3.4.4' ), 199 | 'composer' => true, 200 | ), 201 | 'phpunit' => 4, 202 | 'cli' => array( 203 | 'mysql_client' => 'mysql-client', 204 | 'download_url' => 'https://github.com/wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar', 205 | ), 206 | ), 207 | '5.5' => array( 208 | 'php' => array( 209 | 'base_name' => 'php:5.5-fpm', 210 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libicu-dev', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 211 | 'extensions' => array( 'gd', 'mysql', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 212 | 'pecl_extensions' => array( 'xdebug-2.5.5', 'memcached-2.2.0', 'imagick-3.4.4' ), 213 | 'composer' => true, 214 | ), 215 | 'phpunit' => 4, 216 | 'cli' => array( 217 | 'mysql_client' => 'mysql-client', 218 | 'download_url' => 'https://github.com/wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar', 219 | ), 220 | ), 221 | '5.6.20' => array( 222 | 'php' => array( 223 | 'base_name' => 'php:5.6.20-fpm', 224 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libicu-dev', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 225 | 'extensions' => array( 'gd', 'mysql', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 226 | 'pecl_extensions' => array( 'xdebug-2.5.5', 'memcached-2.2.0', 'imagick-3.4.4' ), 227 | 'composer' => true, 228 | ), 229 | 'phpunit' => 5, 230 | 'cli' => array( 231 | 'mysql_client' => 'mysql-client', 232 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 233 | ), 234 | ), 235 | '5.6' => array( 236 | 'php' => array( 237 | 'base_name' => 'php:5.6-fpm', 238 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 239 | 'extensions' => array( 'gd', 'mysql', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 240 | 'pecl_extensions' => array( 'xdebug-2.5.5', 'memcached-2.2.0', 'imagick-3.4.4' ), 241 | 'composer' => true, 242 | ), 243 | 'phpunit' => 5, 244 | 'cli' => array( 245 | 'mysql_client' => 'virtual-mysql-client', 246 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 247 | ), 248 | ), 249 | '7.0' => array( 250 | 'php' => array( 251 | 'base_name' => 'php:7.0-fpm', 252 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 253 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 254 | 'pecl_extensions' => array( 'xdebug-2.7.2', 'memcached-3.1.5', 'imagick' ), 255 | 'composer' => true, 256 | ), 257 | 'phpunit' => 6, 258 | 'cli' => array( 259 | 'mysql_client' => 'virtual-mysql-client', 260 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 261 | ), 262 | ), 263 | '7.1' => array( 264 | 'php' => array( 265 | 'base_name' => 'php:7.1-fpm', 266 | 'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ), 267 | 'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ), 268 | 'pecl_extensions' => array( 'xdebug-2.9.8', 'memcached-3.1.5', 'imagick' ), 269 | 'composer' => true, 270 | ), 271 | 'phpunit' => 7, 272 | 'cli' => array( 273 | 'mysql_client' => 'virtual-mysql-client', 274 | 'download_url' => 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar', 275 | ), 276 | ), 277 | ); 278 | 279 | /** 280 | * An array of all PHPUnit and PHP version combinations that we need to generate images for. 281 | * 282 | * Different WordPress versions support different versions of PHP and different versions of PHPUnit. 283 | * This creates a need to run multiple versions of PHPUnit on each version of PHP. 284 | * 285 | * These versions of PHPUnit are no longer supported and do not receive updates. 286 | * Regenerating these containers should very rarely be required. 287 | * 288 | * @param array $legacy_phpunit_versions A list of PHP versions for each PHPUnit version. 289 | */ 290 | $legacy_phpunit_versions = array( 291 | '9' => array( 292 | '8.3', 293 | '8.2', 294 | '8.1', 295 | '8.0', 296 | '7.4', 297 | '7.3', 298 | ), 299 | '8' => array( 300 | '8.2', 301 | '8.1', 302 | '8.0', 303 | '7.4', 304 | '7.3', 305 | '7.2', 306 | ), 307 | '7' => array( 308 | '7.4', 309 | '7.3', 310 | '7.2', 311 | '7.1', 312 | '7.0', 313 | ), 314 | '6' => array( 315 | '7.3', 316 | '7.2', 317 | '7.1', 318 | '7.0', 319 | ), 320 | '5' => array( 321 | '7.0', 322 | '5.6.20', 323 | '5.6', 324 | ), 325 | '4' => array( 326 | '5.6.20', 327 | '5.6', 328 | ) 329 | ); 330 | 331 | // A warning that will be added to each Dockerfile, to ensure folks don't edit them directly. 332 | $generated_warning = << file_get_contents( 'templates/Dockerfile-php.template' ), 344 | 'phpunit' => file_get_contents( 'templates/Dockerfile-phpunit.template' ), 345 | 'cli' => file_get_contents( 'templates/Dockerfile-cli.template' ), 346 | ); 347 | 348 | // Loop through each PHP version, and generate the Dockerfiles. 349 | foreach ( array_merge( $legacy_php_versions, $php_versions ) as $version => $images ) { 350 | $title = "| PHP $version |"; 351 | echo str_repeat( '-', strlen( $title ) ) . "\n"; 352 | echo "$title\n"; 353 | echo str_repeat( '-', strlen( $title ) ) . "\n"; 354 | 355 | foreach ( $images as $image => $config ) { 356 | echo str_pad( $image, 15, '.' ); 357 | echo shell_exec( "mkdir -p images/{$version}/{$image}" ); 358 | 359 | $dockerfile = $templates[ $image ]; 360 | 361 | $dockerfile = str_replace( '%%GENERATED_WARNING%%', $generated_warning, $dockerfile ); 362 | 363 | // PHPUnit and WP-CLI image parent tags vary depending on whether it's a PHP version, or "latest". 364 | if ( 'latest' === $version ) { 365 | $version_tag = 'latest'; 366 | } else { 367 | $version_tag = "$version-fpm"; 368 | } 369 | $dockerfile = str_replace( '%%VERSION_TAG%%', $version_tag, $dockerfile ); 370 | 371 | if ( $image === 'php' ) { 372 | // Temporarily enforce using an image that is correctly installing `libmemcached-dev`. 373 | $current_base_name = $config['base_name']; 374 | if ( in_array( $config['base_name'], array( 'php:8.1-fpm', 'php:8.2-fpm' ) ) ) { 375 | $current_base_name = str_replace( '-fpm', '-fpm-bullseye', $current_base_name ); 376 | } 377 | 378 | // Replace tags inside the PHP Dockerfile template. 379 | $dockerfile = str_replace( '%%BASE_NAME%%', $current_base_name, $dockerfile ); 380 | 381 | if ( $config['apt'] || $config['extensions'] || $config['pecl_extensions'] || $config['composer'] ) { 382 | $install_extensions = "# install the PHP extensions we need\nRUN set -ex;"; 383 | 384 | // Composer requires git to be installed in some circumstances (e.g. `composer install --prefer-source`). 385 | if ( $config['composer'] ) { 386 | $config['apt'][] = 'git'; 387 | } 388 | 389 | if ( $config['apt'] ) { 390 | $install_extensions .= " \\\n\t\\\n\t"; 391 | // Debian 9/stretch was moved to archive.debian.org in March 2023. See https://lists.debian.org/debian-devel-announce/2023/03/msg00006.html. 392 | if ( $version == '7.0' ) { 393 | $install_extensions .= "echo 'deb http://archive.debian.org/debian stretch main contrib non-free' | tee /etc/apt/sources.list; \\\n\t\\\n\t"; 394 | } 395 | 396 | $install_extensions .= "apt-get update; \\\n\t\\\n\tapt-get install -y --no-install-recommends " . implode( ' ', $config['apt'] ) . ";"; 397 | 398 | // Ensure certificates are updated. 399 | $install_extensions .= " \\\n\tapt-get upgrade openssl -y;"; 400 | $install_extensions .= " \\\n\tupdate-ca-certificates --fresh;"; 401 | 402 | // We need to add some locales for testing. 403 | if ( array_search( 'locales', $config['apt'], true ) ) { 404 | $install_extensions .= " \\\n\tsed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\\1/' /etc/locale.gen;"; 405 | $install_extensions .= " \\\n\tlocale-gen;"; 406 | } 407 | } 408 | 409 | if ( in_array( 'gd', $config['extensions'], true ) ) { 410 | $install_extensions .= " \\\n\t\\\n\t"; 411 | 412 | if ( version_compare( $version, '7.4' ) >= 0 ) { 413 | $install_extensions .= "docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr;"; 414 | } else { 415 | $install_extensions .= "docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr;"; 416 | } 417 | } 418 | 419 | if ( $config['extensions'] ) { 420 | $install_extensions .= " \\\n\t\\\n\t"; 421 | $install_extensions .= "docker-php-ext-install " . implode( ' ', $config['extensions'] ) . ";"; 422 | } 423 | 424 | if ( $config['pecl_extensions'] ) { 425 | $install_extensions .= " \\\n\t\\\n"; 426 | 427 | $install_extensions .= array_reduce( $config['pecl_extensions'], function ( $command, $extension ) use ( $version ) { 428 | if ( $command ) { 429 | $command .= " \\\n"; 430 | } 431 | 432 | $command .= "\tpecl install $extension;"; 433 | 434 | if ( 0 === strpos( $extension, 'imagick' ) ) { 435 | $command .= " \\\n\tdocker-php-ext-enable imagick;"; 436 | } 437 | 438 | return $command; 439 | }, '' ); 440 | } 441 | 442 | if ( $config['composer'] ) { 443 | $install_extensions .= " \\\n\t\\\n"; 444 | $install_extensions .= "\tcurl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \\\n"; 445 | $install_extensions .= "\tcurl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \\\n"; 446 | $install_extensions .= "\tphp -r \" \\\n"; 447 | $install_extensions .= "\t\t\\\$signature = file_get_contents( '/tmp/installer.sig' ); \\\n"; 448 | $install_extensions .= "\t\t\\\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \\\n"; 449 | $install_extensions .= "\t\tif ( \\\$signature !== \\\$hash ) { \\\n"; 450 | $install_extensions .= "\t\t\tunlink( '/tmp/installer.php' ); \\\n"; 451 | $install_extensions .= "\t\t\tunlink( '/tmp/installer.sig' ); \\\n"; 452 | $install_extensions .= "\t\t\techo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \\\n"; 453 | $install_extensions .= "\t\t\texit( 1 ); \\\n"; 454 | $install_extensions .= "\t\t}\"; \\\n"; 455 | $install_extensions .= "\tphp /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \\\n"; 456 | $install_extensions .= "\tcomposer --ansi --version --no-interaction; \\\n"; 457 | $install_extensions .= "\trm -f /tmp/installer.php /tmp/installer.sig;"; 458 | } 459 | 460 | $dockerfile = str_replace( '%%INSTALL_EXTENSIONS%%', $install_extensions, $dockerfile ); 461 | } 462 | 463 | copy( "entrypoint/common.sh", "images/{$version}/{$image}/common.sh" ); 464 | 465 | } elseif ( $image === 'phpunit' ) { 466 | // Replace tags inside the PHPUnit Dockerfile template. 467 | $dockerfile = str_replace( '%%PHPUNIT_VERSION%%', $config, $dockerfile ); 468 | 469 | // Ensure PHPUnit can be successfully downloaded in older containers. 470 | if ( '7.1' > $version ) { 471 | $dockerfile = str_replace( 'RUN curl -sL', 'RUN curl -sLk', $dockerfile ); 472 | } 473 | } elseif ( $image === 'cli' ) { 474 | // Replace tags inside the WP-CLI Dockerfile template. 475 | if ( $config ) { 476 | $dockerfile = preg_replace( '|\n%%OLD_PHP%%.*%%/OLD_PHP%%\n|s', '', $dockerfile ); 477 | $dockerfile = str_replace( '%%MYSQL_CLIENT%%', $config['mysql_client'], $dockerfile ); 478 | $dockerfile = str_replace( '%%DOWNLOAD_URL%%', $config['download_url'], $dockerfile ); 479 | } else { 480 | // WP-CLI isn't available for this version of PHP. 481 | $dockerfile = preg_replace( '|\n%%NEW_PHP%%.*%%/NEW_PHP%%\n|s', '', $dockerfile ); 482 | } 483 | } 484 | 485 | // Cleanup any leftover tags. 486 | $dockerfile = preg_replace( '/%%[^%]+%%/', '', $dockerfile ); 487 | 488 | // Write the real Dockerfile. 489 | write_file( "images/{$version}/{$image}/Dockerfile", $dockerfile ); 490 | 491 | // Copy the entrypoint script, if it exists. 492 | if ( file_exists( "entrypoint/entrypoint-$image.sh" ) ) { 493 | copy( "entrypoint/entrypoint-$image.sh", "images/{$version}/{$image}/entrypoint.sh" ); 494 | } 495 | 496 | // Copy the PHP-FPM configuration, if it exists. 497 | if ( file_exists( "config/php-fpm-$image.conf" ) ) { 498 | copy( "config/php-fpm-$image.conf", "images/{$version}/{$image}/php-fpm.conf" ); 499 | } 500 | 501 | echo "✅\n"; 502 | } 503 | 504 | $workflow_templates = array( 505 | 'docker-hub.yml' => 'GITHUB', 506 | 'github-container-registry.yml' => 'DOCKER_HUB', 507 | ); 508 | 509 | // Load the GitHub Actions template. 510 | $workflow_template = file_get_contents( 'templates/workflow.yml-template' ); 511 | $workflow_template = str_replace( '%%GENERATED_WARNING%%', $generated_warning, $workflow_template ); 512 | 513 | $php_version_list = "'" . implode( "', '", array_keys( $php_versions ) ) . "'"; 514 | $workflow_template = str_replace( '%%PHP_VERSION_LIST%%', $php_version_list, $workflow_template ); 515 | 516 | $workflow_template = str_replace( '%%PHP_LATEST%%', $latest, $workflow_template ); 517 | 518 | foreach ( $workflow_templates as $name => $remove_pattern ) { 519 | // Save two GitHub Action workflows. 520 | $workflow_contents = preg_replace( "/%%$remove_pattern%%[\s\S]+?%%\/$remove_pattern%%/", '', $workflow_template ); 521 | $workflow_contents = preg_replace( '/%%[^%]+%%/', '', $workflow_contents ); 522 | 523 | write_file( '.github/workflows/' . $name, $workflow_contents ); 524 | } 525 | } 526 | 527 | /** 528 | * Write file. 529 | * 530 | * @param string $file File path. 531 | * @param string $contents File contents. 532 | */ 533 | function write_file( $file, $contents ) { 534 | $fh = fopen( $file, 'w' ); 535 | fwrite( $fh, $contents ); 536 | fclose( $fh ); 537 | } 538 | --------------------------------------------------------------------------------