Skip to content

Commit

Permalink
dockerfiles/build.sh: fix buildx detection
Browse files Browse the repository at this point in the history
`docker <subcommand> --help` cannot be used to detect whether a sub
command is available because it exits with 0 no matter if the sub
command exists or not.

Use `docker buildx version` as a test for buildx support instead.

Fixes: 17765c7 ("dockerfiles: support for docker/podman buildx")
Reported-by: Sebastian Groß <[email protected]>
Signed-off-by: Bastian Krause <[email protected]>
  • Loading branch information
Bastian-Krause committed Feb 4, 2025
1 parent a8b6ab3 commit d6ebde1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dockerfiles/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ has_buildx() {
local docker_cmd
docker_cmd="${1}"

"${docker_cmd}" buildx --help >/dev/null 2>&1
"${docker_cmd}" buildx version >/dev/null 2>&1
}

get_docker_cmd() {
Expand Down

0 comments on commit d6ebde1

Please sign in to comment.