Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Keep latest tags for branches #61

Closed
skovhus opened this issue Sep 17, 2020 · 2 comments · Fixed by #62
Closed

Keep latest tags for branches #61

skovhus opened this issue Sep 17, 2020 · 2 comments · Fixed by #62
Labels
bug Something isn't working

Comments

@skovhus
Copy link
Contributor

skovhus commented Sep 17, 2020

We recently introduced a change to not not tag images on non-main branches with "latest". This avoids cache breaking as all branches will not all push the "latest" image.

At least locally we shouldn't do this as the latest tag is usually used for local development in Docker compose files.

Ideas:

  1. I think most CIs adds a CI=1 environment variable (we could use that)
  2. Or be explicit with an additional argument (but might be confusing)
@skovhus skovhus added the bug Something isn't working label Sep 17, 2020
@corradio
Copy link
Member

corradio commented Sep 17, 2020

Here's an additional proposal:
Right now, it seems like the "latest" tag is always used as cache key.
If the cache-from directive supports having multiple cache entries as potential input, then my suggestion would be to use cache-from <image>:master, cache-from <image>:<current-branch>, which, in theory, should always either cache from current branch or from master (and never from latest).

Hope it makes sense - else, happy to clarify.

@skovhus
Copy link
Contributor Author

skovhus commented Sep 18, 2020

That is a great idea, and it seems to work. But I would leave this out for in a WIP PR now and observe how CI behaves.

@skovhus skovhus changed the title Keep latest tags for branches locally Keep latest tags for branches Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants