It will immediately push your images so you can’t run build and push in separate hooks unless you do what I did. I used the build hook to build an image with a one tag, then tested every architecture in a loop in the test hook, and I ran docker buildx again with different parameters where I set new tags following semantic versioning.
You can see environment variables in the documentation. You can use those to tag your image based on the build rules you set on Docker Hub, or you can use completey different tags.
Since it is running in one build process, the second build will use the cache and just tag the images quickly.
The first line in my example is necessary to have an emulated build environment for different platforms.
Have you read the documentation I linked? You don’t need to build on GitHub if you use Automated builds. You can use hooks on Docker Hub. You just need to create them in your git repo.
Yes, because it is your choice whether you want to build on GitHub and push to Docker Hub or do everything on Docker Hub.
There is only one thing I could not solve on Docker Hub and this is scheduled nightly builds for specific branches, so I use CircleCI for that until it is implemented on Docker Hub.
Quick follow up, I appreciate that Docker Hub provides the capability to override the default commands using hooks, and for some people that is probably a great solution.
As I dig in a bit more, though, I find (for myself) that using GitHub workflows / actions to do Multiplatform builds is a win for me, as I have one place that controls the entire CI/CD pipeline (including deployment to my web servers).
If you use buildx for multiplatform build, you have to overwrite the push hook (even if empty). Otherwise the automated build somehow overwrites the multiplatform image and only the amd64 image is visible on Docker Hub.
Yes, multi-platform build automation is not only possible but also a common practice in software development. Multi-platform build automation refers to the ability to automate the process of building and packaging software for multiple target platforms or environments.
Could you provide more details on this? We’ve had an empty push file in the hooks folder, but we’re still dealing with only an AMD64 image being pushed. The logs also seem to show only one manifest hash being pushed. Have you dealt with this problem?