diff --git a/hello-world/update.sh b/hello-world/update.sh index 1dfbc47dd..9d00f6b4f 100755 --- a/hello-world/update.sh +++ b/hello-world/update.sh @@ -1,7 +1,10 @@ #!/bin/bash -set -eo pipefail +set -Eeuo pipefail + +image="${1:-hello-world}" docker pull hello-world &> /dev/null +docker pull "$image" &> /dev/null exec > "$(dirname "$(readlink -f "$BASH_SOURCE")")/content.md" @@ -9,11 +12,11 @@ echo '# Example output' echo echo '```console' -echo '$ docker run hello-world' +echo '$ docker run' "$image" docker run --rm hello-world echo -echo '$ docker images hello-world' -docker images hello-world | awk -F' +' 'NR == 1 || $2 == "latest" { print $1"\t"$2"\t"$3"\t"$5 }' | column -t -s$'\t' +echo '$ docker images' "$image" +docker images "$image" | awk -F' +' 'NR == 1 || $2 == "latest" { print $1"\t"$2"\t"$3"\t"$5 }' | column -t -s$'\t' echo '```' echo diff --git a/update.sh b/update.sh index 89a2a53f8..c4b4cc34d 100755 --- a/update.sh +++ b/update.sh @@ -26,7 +26,7 @@ for image in "${images[@]}"; do namespace="${namespace%/}" if [ -x "$repo/update.sh" ]; then - ( set -x; "$repo/update.sh" ) + ( set -x; "$repo/update.sh" "$image" ) fi if [ -e "$repo/content.md" ]; then