Base docker images for SquareOne projects. View it on DockerHub.
Image Name: moderntribe/squareone-php
latest: The latest Dockerfile version using the most recent PHP version (currently 8.0), built from themasterbranch.80-latest: The latest Dockerfile version for PHP 8.0, built from themasterbranch.80-<x.y.z>or80-<x.y>: Specific Dockerfile versions for PHP 8.0, built based on matching tags.74-latest: The latest Dockerfile version for PHP 7.4, built from themasterbranch.74-<x.y.z>or74-<x.y>: Specific Dockerfile versions for PHP 7.4, built based on matching tags.- We recommend you use the minor version, so you can continue to receive updates when doing a docker pull,
e.g.
moderntribe/squareone-php:80-1.0moderntribe/squareone-php:74-2.1
-
Create a directory for the new version, e.g.,
/php/8.1/ -
Create the Dockerfile and any supporting files in that directory.
-
Add automated build configurations to Docker Hub
moderntribe/squareone-phpfor the PHP version. Here is an example of the build rules to create version 8.0:Source Type Source Docker Tag Dockerfile location Build Context Branch master 80-latest Dockerfile /php/8.0/ Tag /^php80-([0-9.]+)$/ 80-{\1} Dockerfile /php/8.0/
After you've made changes to a Dockerfile, it should be built locally and tested before being released.
- Update the php extension installer image:
docker pull mlocati/php-extension-installer - cd into the folder of the
Dockerfilethat was modified - Build and tag the image with a custom name:
docker build -t moderntribe/squareone-php:$version-test ., e.g.docker build -t moderntribe/squareone-php:74-3.0.6-test . - Test it in the square-one framework by temporarily editing dev/docker/docker-compose.yml and updating the
x-phpimage.
x-php: &php
# Original image
# image: moderntribe/squareone-php:74-3.0
# Test image
image: moderntribe/squareone-php:74-3.0.6-test- Run
so startand validate the project successfully loads.
- Commit and push the update to the repo. This should trigger an automatic build on the
masterbranch for the*-latesttags. - Tag the version, prefixed with the affected PHP version, suffixed with the release version. E.g.,
php80-1.0.0for the first release of a build for PHP 8.0. - Tags should follow semantic versioning:
php<version>-<major>.<minor>.<patch>.<major>versions introduce breaking changes.<minor>versions add features and fix bugs.<patch>versions fix bugs.
When using an image from this repo in the downstream, you can add custom scripts in the docker-entrypoint.d folder.
All scripts in there will be copied over and automatically executed with run-parts
Keep in mind the limitations of naming these scripts, they must consist entirely of ASCII upper- and lower-case letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens. So no .sh extensions.