This allows bashbrew to properly handle cross-repository and cross-tag dependencies even in the face of multiple `FROM` instructions or `COPY --from=`.
This also provides the scaffolding necessary to implement this in scripts using `bashbrew cat`.
As fallback behavior, the `*DockerFrom` functions should return the `FROM` of the last stage in the `Dockerfile` (which is essentially the `FROM` of the final image).
Also, the output of `bashbrew from` is now a space-separated list.
This is a replacement for `bashbrew put-shared` (without `--single-arch`) that takes some shortcuts to get a pretty decent speed gain which should allow us to go back to the naïve solution of "push everything from each arch `:xyz-tag` to the multiarch repo's `:xyz-tag` and still have reasonable performance.
This was tested by pushing all ~3700 tags we currently have to https://hub.docker.com/u/trollin and for a full no-op we were around 8.5 minutes, and for a full forced push of every tag manifest (with no necessary blob mounts) we were around 45 minutes.
This helps combat the following race condition:
+ rm -rf /tmp/tmp.FHddOB
rm: can't remove '/tmp/tmp.FHddOB/S.gpg-agent.browser': No such file or directory
This will include SharedTags directly in "bashbrew list", etc, but explicitly does _not_ include them during "bashbrew push". This allows for other images to be "FROM" a SharedTags value, and should be reasonably safe since any given SharedTag should only be applicable for a given architecture at most once.
With this release, we get to drop our custom patch for pushing to `library/xxx`, and go back to using the officially released upstream binaries (which now exist for all the same architectures we support).
Example usage: `{{ archNamespace "windows-amd64" }}` => `winamd64`
This is intended for use in https://github.com/docker-library/docs to help create a list of "Supported architectures" for each image which links to each supported architecture repository (and if supported by Bashbrew itself, allows us to keep https://github.com/docker-library/docs isolated from Jenkins assumptions while still allowing Jenkins to contain the single-source-of-truth for arch-to-namespace mappings).
This also has the benefit of only triggering automated builds when there have been actual changes to the image.
This works by comparing the Hub's `last_updated` timestamp to the `Created` timestamp of local images (in the case of `bashbrew push`), or to the `last_updated` timestamp of the images which make up the `SharedTags` and/or multiarch images (in the case of `bashbrew put-shared`).
This is a dramatic speedup because the Hub v2 API is faster (and has no auth for public repos) than the registry API. If there are any errors in the fetching of `last_updated` from the Hub, we massage the timestamps such that the push simply always happens, as before (which will be the case for pushes to non-Hub registries, for example).