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

Add option to tag child images when publishing multi platform #3518

Open
ghost opened this issue Nov 30, 2021 · 6 comments · May be fixed by #4037 or #4332
Open

Add option to tag child images when publishing multi platform #3518

ghost opened this issue Nov 30, 2021 · 6 comments · May be fixed by #4037 or #4332

Comments

@ghost
Copy link

ghost commented Nov 30, 2021

Environment:

  • 3.1.4
  • gradle
    -Linux

Description of the issue:
When one uses the platforms section to upload multi-arch images, you end up with untagged images in ECR(probably others too)
Stack overflow version of the same issue with docker buildx here.
When you look in ECR, you see the 2 child images as well as the manifest file.
image

Expected behavior:
It would be nice if the child images had an option to append a -ARCH to the tag used as the Manifest one. In the above example, it would be awesome if there was an option to tag them with
0.0.130-userAdd -- Manifest
0.0.130-userAdd-amd64 -- AMD version
0.0.130-userAdd-arm64 -- ARM version

The jib section's from block

    from {
        image = baseDockerImage
        platforms {
            platform {
                architecture = 'amd64'
                os = 'linux'
            }
            platform {
                architecture = 'arm64'
                os = 'linux'
            }
        }
    }
@ghost
Copy link
Author

ghost commented Nov 30, 2021

Would it be possible here:
https://github.com/GoogleContainerTools/jib/blob/master/jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/PushImageStep.java#L81-L82

      Set<String> imageQualifiers =
          singlePlatform ? tags : Collections.singleton(manifestDigest.toString());

to optionally change the ternary else from a manifestDigest to

val platforImageTags = if (platformTagingEnabled) {
  tags.map{
     it + "currentPlatformHere"
  }
}else{
  listOf(manifestDigest.toString())
}

where currentPlatformHere is the archname(or os-archname)?

@ghost
Copy link
Author

ghost commented Nov 30, 2021

A prototype. I hardcoded the feature flag on.
#3519

@mpeddada1
Copy link
Contributor

Thanks for filing the feature request and the contribution @robert-csdisco! We will take a look at it.

@ghost
Copy link
Author

ghost commented Dec 1, 2021

I started wiring up the boolean through buildContext, but it looks like there's quite a few places to add it. Will wait to see if this is something y'all could accept before doing the config part

@msvticket
Copy link

@mpeddada1 I was a bout to open a PR to fix this, but I see that this issue is not labelled "Accepting Contributions". Is there a reason for that?

@taer
Copy link
Contributor

taer commented Sep 18, 2024

@msvticket I was the original author here on an old work account. I can't add the label, but I would love having it done. :)

@msvticket msvticket linked a pull request Oct 29, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants