From c644754679d73af09e2ae1bdab654b88d5e6ce02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A8ve=20Caillault?= Date: Sat, 27 Jun 2026 12:05:20 +0200 Subject: [PATCH] Ajout de l'option --push-image dans le script du build pour pouvoir publier l'image. --- README.md | 1 + scripts/build-docker-image.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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