diff --git a/README.md b/README.md index d48e267..9f31b95 100644 --- a/README.md +++ b/README.md @@ -28,5 +28,6 @@ Exemple : | -------------- | ------------------------------------------------------ | | `--debug` | Affiche la commande de construction de l'image. | | `--build` | Exécute la construction de l'image Docker. | +| `--push-image` | Push de l'image dans le Registry Docker. | | `--apache` | Utilise une image Apache. | | `--frankenphp` | Utilise une image FrankenPHP. | \ No newline at end of file diff --git a/scripts/build-docker-image.sh b/scripts/build-docker-image.sh index a695ec0..fd26dce 100755 --- a/scripts/build-docker-image.sh +++ b/scripts/build-docker-image.sh @@ -13,10 +13,10 @@ serverVersion="" serverName="" withDebug=false withBuild=false +withPushImage=false withApacheOption=false withFrankenphpOption=false - for arg in "$@"; do case "$arg" in --debug) @@ -25,6 +25,9 @@ for arg in "$@"; do --build) withBuild=true ;; + --push-image) + withPushImage=true + ;; --apache) withApacheOption=true ;; @@ -119,3 +122,8 @@ if [[ "$withBuild" == "true" ]]; then eval "$buildCommand" echo "Build de l'image ${phpVersion}-${serverName,,}-${serverVersion} terminé." fi + +if [[ "$withPushImage" == "true" ]]; then + docker push $dockerImageTag + echo "Push du tag $dockerImageTag." +fi \ No newline at end of file