Use "git show" to get the Dockerfile for deferring based on FROM

This gives roughly a full 2x speedup when doing `./build.sh --no-build --all`.

Without this change:
```console
$ time ./build.sh --no-build --all > /dev/null

real	0m33.744s
user	0m8.142s
sys	0m5.895s
```

With this change:
```console
$ time ./build.sh --no-build --all > /dev/null

real	0m12.161s
user	0m2.944s
sys	0m2.871s
```