Closed b-ehlers closed 1 year ago
Update: Changed build strategy for multiple repositories, the uploaded docker images are now identical.
Previously: Target is tested for changes on first repository. When changed, it got updated. Then second repository is tested and when changed, it got updated. Both repositories were processed independently. In some cases that can lead to slightly different images in the repositories.
Now: Target is tested for changes on first repository, then on second repository. If the target image in any repository has changed, the image in all repositories get updated. So all repositories get identical images.
I'm quite pleased with this solution, that should solve #772.
Finally the PR to support building and uploading Docker images to multiple registries.
The user interface got only a small change, the environment variable DOCKER_REPOSITORY may now contain a list of repositories. The name-only docker images are built and uploaded to all repositories in this list.
First the fine print: This PR implements method #3 from issue #772, this does just the basic stuff. I suggest to use it for some time and when we notice some limitations, it can be extended.
The uploaded docker image to multiple repositories is only identical, when building in the same workflow run. When the docker image is built at different times, the packages that got installed during the docker build may have changed and then the docker image differs. That only happens, when a docker image is current in one repository and not in the other one. Normally the docker image is built, when the Dockerfile gets updated, then both repositories are not current and both got simultaneously updated. The hard way to force equal images is to do a manual build withFixed by commit https://github.com/GNS3/gns3-registry/pull/775/commits/c47148cfd810f69565403a7a565ef577f6acdcbc.--all
as the image list. This rebuilds all images.The workflow in this PR still uses only the DockerHub registry.
If you want to enable both the DockerHub and the GitHub Container Registry for building and uploading:
if:
condition to trueThe change would look like this: