Docker Hub builds a Syncthing image for me from this source repo.
I tagged the latest commit v0.13.5, but Docker built it twice: once for latest
and once for v0.13.5.
Why? Shouldn't it be able to figure out the source is the same? Am I just doing something dumb in my Dockerfile, breaking caching? Is there some way I need to hint to Docker Hub that this should really be two images with the same checksum but different tags?
I'm thinking of the two Docker image tags latest
and v0.13.5
like two git tags both pointing to the same commit. Shouldn't Docker Hub work that way too? If someone tries to pull latest
they'd pull exactly the same image tagged v0.13.5
? I know how to pull/re-tag/push, but again, seems like there just must be some way to get Docker Hub to do this automatically.
Build settings:
To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).
docker pull will always contact the registry and get an updated image. Try, for instance, docker pull ubuntu:18.04 if you have it locally and haven't pulled it recently.
With a little magic, Docker Hub can do this! Pablo Chico de Guzmán helped me out.
Steps:
hooks/post_push
hooks/post_push
executable, commit and pushNow, any tags I push (e.g. git push --tags
) fire off an automated build, and the same image is also given the latest
tag.
Here's the change I had to make so the most recent "vX.Y"-tagged meonkeys/syncthing
image is also tagged latest
.
Latest
is just “the last build/tag that ran without a specific tag/version specified”.
If you push a tagged image it does not replace the current image tagged with latest. If you push tagged images only, latest
tag is not added.
Automated Builds on Docker Hub is adding the latest
tag automatically for the master branch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With