Repository: quarkusio/quarkus
Issue: Building of container images with buildx causes build failures

### Describe the bug

As of 2.15.0.Final, building and pushing container images with buildx is causing build failures.

The problem seems to be that Quarkus tries to push the container images from the host, although they've been built and pushed in buildx already. Because the images are not available in the host's local registry, the push attempt fails.

Here's an example build log:

```
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Starting (local) container image build for jar using docker.
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Executing the following command to build docker image: 'docker buildx build -f /REDACTED/bar/src/main/docker/Dockerfile.jvm --platform linux/amd64,linux/arm64 -t host.docker.internal:5005/foo/bar:1.0.0-SNAPSHOT -t host.docker.internal:5005/foo/bar:latest --push /REDACTED/bar'
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #1 [internal] load build definition from Dockerfile.jvm
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #1 transferring dockerfile: 5.39kB done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #1 DONE 0.0s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #2 [internal] load .dockerignore
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #2 transferring context: 115B done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #2 DONE 0.0s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #3 [linux/amd64 internal] load metadata for registry.access.redhat.com/ubi8/openjdk-17-runtime:latest
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #3 ...
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #4 [linux/arm64 internal] load metadata for registry.access.redhat.com/ubi8/openjdk-17-runtime:latest
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #4 DONE 1.3s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #3 [linux/amd64 internal] load metadata for registry.access.redhat.com/ubi8/openjdk-17-runtime:latest
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #3 DONE 1.5s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #5 [linux/amd64 1/2] FROM registry.access.redhat.com/ubi8/openjdk-17-runtime@sha256:9358f474bc99d4c65e1043990a0f8834aaa9974f27fe6c2ed88d6fa11a27a35a
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #5 resolve registry.access.redhat.com/ubi8/openjdk-17-runtime@sha256:9358f474bc99d4c65e1043990a0f8834aaa9974f27fe6c2ed88d6fa11a27a35a done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #5 DONE 0.0s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #6 [linux/arm64 1/2] FROM registry.access.redhat.com/ubi8/openjdk-17-runtime@sha256:9358f474bc99d4c65e1043990a0f8834aaa9974f27fe6c2ed88d6fa11a27a35a
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #6 resolve registry.access.redhat.com/ubi8/openjdk-17-runtime@sha256:9358f474bc99d4c65e1043990a0f8834aaa9974f27fe6c2ed88d6fa11a27a35a 0.0s done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #6 DONE 0.0s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #7 [internal] load build context
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #7 transferring context: 116.88MB 2.5s done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #7 DONE 2.5s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #6 [linux/arm64 1/2] FROM registry.access.redhat.com/ubi8/openjdk-17-runtime@sha256:9358f474bc99d4c65e1043990a0f8834aaa9974f27fe6c2ed88d6fa11a27a35a
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #6 CACHED
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #5 [linux/amd64 1/2] FROM registry.access.redhat.com/ubi8/openjdk-17-runtime@sha256:9358f474bc99d4c65e1043990a0f8834aaa9974f27fe6c2ed88d6fa11a27a35a
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #5 CACHED
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #8 [linux/amd64 2/2] COPY --chown=185 target/*-runner.jar /deployments/quarkus-run.jar
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #8 DONE 0.5s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #9 [linux/arm64 2/2] COPY --chown=185 target/*-runner.jar /deployments/quarkus-run.jar
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #9 DONE 0.5s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] 
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting to image
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting layers
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting layers 2.4s done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting manifest sha256:a8b3772b2612de447814116b0202a28c18f35e65a588c6be9e680eea56e5bafd done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting config sha256:64b8bc2007f1255ebe4d3358c372555da80fd3133d956ca91dce1396e77de2aa done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting attestation manifest sha256:6779238e09865c565980594ce834d228881125b837f4b9f5ba817752b77bc2cb done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting manifest sha256:548b8c98021bc178c0427a8ad3c03647813e64c87b7e39cccaf8c24fbfe3d581 done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting config sha256:489c7dbd39adefb3fe7b9c53040b94c22fdb60f05101491d8d33229d62f20332
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting config sha256:489c7dbd39adefb3fe7b9c53040b94c22fdb60f05101491d8d33229d62f20332 done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting attestation manifest sha256:46a2550c0416c61875eb66cbc659b1559a73763275795fe276d74638b8937563 done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 exporting manifest list sha256:232246f8f7809e9d7bd57fbc03b53c60d92cb4bc85261b1838d06368f9571de6 done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 pushing layers
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 pushing layers 2.0s done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 pushing manifest for host.docker.internal:5005/foo/bar:1.0.0-SNAPSHOT@sha256:232246f8f7809e9d7bd57fbc03b53c60d92cb4bc85261b1838d06368f9571de6 0.0s done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 pushing layers 0.0s done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 pushing manifest for host.docker.internal:5005/foo/bar:latest@sha256:232246f8f7809e9d7bd57fbc03b53c60d92cb4bc85261b1838d06368f9571de6 0.0s done
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] #10 DONE 4.5s
[INFO] [io.quarkus.container.image.docker.deployment.DockerProcessor] Built container image host.docker.internal:5005/foo/bar:1.0.0-SNAPSHOT (linux/amd64,linux/arm64 platform(s))

[INFO] [io.quarkus.deployment.util.ExecUtil] The push refers to repository [host.docker.internal:5005/foo/bar]
[INFO] [io.quarkus.deployment.util.ExecUtil] An image does not exist locally with the tag: host.docker.internal:5005/foo/bar

...

Error: [ERROR] 	[error]: Build step io.quarkus.container.image.docker.deployment.DockerProcessor#dockerBuildFromJar threw an exception: java.lang.RuntimeException: Execution of 'docker push host.docker.internal:5005/foo/bar:latest' failed. See docker output for more details
```

Note how both building and pushing the images with buildx succeeded. Yet the build is failing due to the redundant push attempt.

I think the culprit is that there's a missing `!useBuildx` condition here, when Quarkus checks if it should push images:

https://github.com/quarkusio/quarkus/blob/66f501aefb1e05ca9768f4d25f15628e3f0a4165/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java#L224-L230

### Expected behavior

_No response_

### Actual behavior

_No response_

### How to Reproduce?

1. Create a new Quarkus project with `container-image-docker` extension:
```shell
quarkus create app -x container-image-docker foo:bar:1.0.0-SNAPSHOT
```
2. Start a local Docker registry:
```shell
docker run --rm -p 5005:5000 --name registry registry:2
```
3. Create a new buildx builder that allows for HTTP usage against the local registry:
```shell
echo '[registry."host.docker.internal:5005"]\\n  http = true' > buildkitd.toml
docker buildx create --use desktop-linux --config buildkitd.toml
```
4. Run the Quarkus build:
```shell
cd bar
mvn clean install \\
  -Dquarkus.container-image.additional-tags=latest \\
  -Dquarkus.container-image.build=true \\
  -Dquarkus.container-image.group=foo \\
  -Dquarkus.container-image.registry=host.docker.internal:5005 \\
  -DskipTests=true \\
  -Dquarkus.container-image.push=true \\
  -Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64
```

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.15.0.Final - 2.15.3.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java

diff --git a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java
index a9bc9b2e303..f6a5d79ab18 100644
--- a/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java
+++ b/extensions/container-image/container-image-docker/deployment/src/main/java/io/quarkus/container/image/docker/deployment/DockerProcessor.java
@@ -221,7 +221,7 @@ private String createContainerImage(ContainerImageConfig containerImageConfig, D
             }
         }
 
-        if (pushContainerImage) {
+        if (!useBuildx && pushContainerImage) {
             // If not using buildx, push the images
             loginToRegistryIfNeeded(containerImageConfig, containerImageInfo, dockerConfig);