Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Spirit-act wants to merge2 commits intoCodeception:main
base:main
Choose a base branch
Loading
fromSpirit-act:main

Conversation

@Spirit-act
Copy link

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 theCOMPOSER_ALLOW_SUPERUSER env 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.

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>
@Naktibalda
Copy link
Member

@Spirit-act
Copy link
Author

Spirit-act commentedFeb 14, 2025
edited
Loading

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.
Thanks in advanced.


Edit: The tags for the images are just examples and can be changed.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Spirit-act@Naktibalda

[8]ページ先頭

©2009-2025 Movatter.jp