One Solution collect form web for “Docker: updating image and registry”

This will depend on what for you will use your docker image and what “releasing” policy you adopt.

My recommandation is that you sync the tags you keep on Docker Hub with the release/or tags you have in github and automate as much as you can your production with a continuous integration tools like jenkins and github webooks.

Then your flow becomes :
you do your code modifications and integrate them in github ideally using a pull request scheme. This means your codes will be merged into your master branch.
Your jenkins is configured so that when master is changed it will build against your docker file and push it to Docker hub. This will erase your “latest” tag and make sure your latest tag in docker hub is always in synch with your master release on github

If you need to keep additionnal tags, this will be typically because of different branches or relases of your software. You ‘ll do the same as above with the tag hooked up thru jenkins and github webhooks with a non master branch. For this lone, take a look as how the official libraries are organized on github (for exeample on postgres or mysql images).