Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.3k
make PHP Version configurable#6822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Add a build arg to specify the PHP Version to build with.Also change legacy ENV declaration.Signed-off-by: Spirit-act <16631523+Spirit-act@users.noreply.github.com>
Spirit-act commentedFeb 14, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the Link, I forgot to look at the GitHub wiki. If I understand correctly, in order to adopt my changes, only the docs section for the build needs to be changed. cd Codeception# Build with default PHP Version (8.1)docker build --no-cache --pull -t codeception/codeception:5.0.3.docker build --no-cache --pull --build-arg flavor=alpine -t codeception/codeception:5.0.3-alpine.# Push default builddocker push codeception/codeception:5.0.3docker push codeception/codeception:5.0.3-alpine# Build with PHP 8.2docker build --no-cache --pull \ --build-arg flavor=PHP_VERSION=8.2 -t codeception/codeception:5.0.3-php8.2.docker build --no-cache --pull \ --build-arg flavor=PHP_VERSION=8.2 \ --build-arg flavor=alpine -t codeception/codeception:5.0.3-php8.2-alpine.# Push PHP8.2 builddocker push codeception/codeception:5.0.3-php8.2docker push codeception/codeception:5.0.3-php8.2-alpine# Build with PHP 8.3docker build --no-cache --pull \ --build-arg flavor=PHP_VERSION=8.3 -t codeception/codeception:5.0.3-php8.3.docker build --no-cache --pull \ --build-arg flavor=PHP_VERSION=8.3 \ --build-arg flavor=alpine -t codeception/codeception:5.0.3-php8.3-alpine.# Push PHP8.3 builddocker push codeception/codeception:5.0.3-php8.3docker push codeception/codeception:5.0.3-php8.3-alpine# Build with PHP 8.4docker build --no-cache --pull \ --build-arg flavor=PHP_VERSION=8.4 -t codeception/codeception:5.0.3-php8.4.docker build --no-cache --pull \ --build-arg flavor=PHP_VERSION=8.4 \ --build-arg flavor=alpine -t codeception/codeception:5.0.3-php8.4-alpine.# Push PHP8.4 builddocker push codeception/codeception:5.0.3-php8.4docker push codeception/codeception:5.0.3-php8.4-alpine# Tag default build as latestdocker tag codeception/codeception:5.0.3 codeception/codeception:latestdocker tag codeception/codeception:5.0.3-alpine codeception/codeception:latest-alpine# Push latest tagdocker push codeception/codeception:latestdocker push codeception/codeception:latest-alpine It would also be possible to wrap this in a script. Example: #!/bin/bashPHP_VERSIONS=('8.1''8.2''8.3''8.4')if [[-z"$1" ]];thenecho"Please specify the Codeception Version (e.g.: 5.0.3)."exit 1;fiecho" - build default images -"docker build --no-cache --pull -t codeception/codeception:${1}.docker build --no-cache --pull --build-arg flavor=alpine -t codeception/codeception:${1}-alpine.echo""forVERSIONin"${PHP_VERSIONS[@]}";doecho" - build${VERSION} image -" docker build --no-cache --pull --build-arg flavor=PHP_VERSION=$VERSION -t codeception/codeception:${1}-php${VERSION}. docker build --no-cache --pull --build-arg flavor=PHP_VERSION=$VERSION --build-arg flavor=alpine -t codeception/codeception:${1}-php${VERSION}-alpine.echo" - push${VERSION} image -" docker push codeception/codeception:${1}-php${VERSION} docker push codeception/codeception:${1}-php${VERSION}-alpineecho""doneecho" - tag default build as latest -" docker tag codeception/codeception:${1} codeception/codeception:latest docker tag codeception/codeception:${1}-alpine codeception/codeception:latest-alpineecho"- push latest tag -" docker push codeception/codeception:latest docker push codeception/codeception:latest-alpine If there is something else which needs to be done, feel free to add a comment. Edit: The tags for the images are just examples and can be changed. |
This merge request is a follow up to#6770 and issue#6769.
Changes
It adds a build arg to specify the PHP Version you want to build.
I also updated the
COMPOSER_ALLOW_SUPERUSERenv variable to the current format.Docker Hub
I could not figure out, how toDocker Hub Containers are build, but with this Dockerfile and a matrix pipeline, multiple versions could be build and published.