fix: use correct quoting in format template when fetching exposed image ports

This commit is contained in:
Jose Diaz-Gonzalez
2023-07-31 12:34:14 -04:00
parent d6468f4713
commit c1279468d8

View File

@@ -102,7 +102,8 @@ fn-builder-dockerfile-get-ports-from-image() {
declare desc="return all exposed ports from passed image name"
declare IMAGE="$1"
local ports="$("$DOCKER_BIN" image inspect --format "{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}" "$IMAGE" | xargs)" || true
# shellcheck disable=SC2016
local ports="$("$DOCKER_BIN" image inspect --format '{{range $key, $value := .Config.ExposedPorts}}{{$key}} {{end}}' "$IMAGE" | xargs)" || true
echo "$ports"
}