jib icon indicating copy to clipboard operation
jib copied to clipboard

Image labels appear in the extra directory layer manifest

Open sgashchenko-tempo opened this issue 1 year ago • 3 comments

Environment:

  • Jib version: 3.4.2 for Mac, 3.4.3 for Linux
  • Build tool: Gradle 8.8
  • OS: MacOS, Ubuntu

Description of the issue: Container labels (jib.container.labels), in addition to the image descriptor, appear in the manifest of the extra directory layer. When using non-constant values, this causes the layer digest to change.

image.json layer.json

Expected behavior: Labels are listed only in the image descriptor.

Steps to reproduce:

  1. Build https://github.com/sgashchenko-tempo/jib-extra-dir-labels
  2. Check the extra directory layer manifest

jib-gradle-plugin Configuration:

jib {
  from {
    image = "eclipse-temurin:17-jre-alpine"
  }
  to {
    image = "jib-extra-dir-labels:latest"
  }
  extraDirectories {
    paths {
      path {
        setFrom(layout.projectDirectory.dir("extra-dir"))
      }
    }
  }
  container {
    labels.put("some-label", "some-value")
  }
}

sgashchenko-tempo avatar Sep 25 '24 20:09 sgashchenko-tempo

It looks like this behavior is consistent with docker build.

sgashchenko-tempo avatar Sep 26 '24 08:09 sgashchenko-tempo

@sgashchenko-tempo can you please confirm if the issue still exists?

ldetmer avatar Nov 21 '24 21:11 ldetmer

@sgashchenko-tempo, just bumping @ldetmer's question: does this still happen with Jib 3.4.6?

diegomarquezp avatar Nov 06 '25 18:11 diegomarquezp