Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exporters: containerimage: allow targetName to contain multiple values #561

Merged

Conversation

trusch
Copy link
Contributor

@trusch trusch commented Aug 7, 2018

What
Allow that the "name" option of the container image exporter to accept a comma separated list of target names. The code will then loop through it and tag/push to every given target.

Why
This allows us to have one Solve() call which will result in multiple images being pushed with minimal overhead. The alternative would have been to call Solve() multiple times and rely on the cache to speed things up but that would be far from optimal.

return nil, tagDone(err)
targetNames := strings.Split(e.targetName, ",")
for _, targetName := range targetNames {
if e.opt.Images != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if e.opt.Images != nil { targetNames := ...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not 100% sure about the semantic of that and therefore I tried to keep the change as small as possible (I effectively just moved the old code in a loop)

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would avoid pushing twice to the same registry but avoiding that looks quite complicated with current functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants