update.sh 744 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. set -eo pipefail
  3. docker pull hello-world &> /dev/null
  4. exec > "$(dirname "$(readlink -f "$BASH_SOURCE")")/content.md"
  5. echo '# Example output'
  6. echo
  7. echo '```console'
  8. echo '$ docker run hello-world'
  9. docker run --rm hello-world
  10. echo
  11. echo '$ docker images hello-world'
  12. docker images hello-world | awk -F' +' 'NR == 1 || $2 == "latest" { print $1"\t"$2"\t"$3"\t"$5 }' | column -t -s$'\t'
  13. echo '```'
  14. echo
  15. echo '%%LOGO%%'
  16. echo
  17. cat <<'EOF'
  18. # How is this image created?
  19. This image is a prime example of using the [`scratch`](https://registry.hub.docker.com/_/scratch/) image effectively. See [`hello.asm`](%%GITHUB-REPO%%/blob/master/hello.asm) in %%GITHUB-REPO%% for the source code of the `hello` binary included in this image.
  20. EOF