Update "hello-world" docs to be multiarch-aware

This commit is contained in:
Tianon Gravi 2017-06-30 23:37:59 -07:00
parent 4c1d14a1ee
commit 7c45aad1e8
2 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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