GoogleContainerTools / GoogleContainerTools/jib
Image labels appear in the extra directory layer manifest
- Dominant language
- Java
- Stars
- 14.5k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
**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](https://github.com/user-attachments/files/17137899/3c2e9554152eb7cdbba270e7282b607a9697fdcfe76bdfb00a78cc06be7a1e5c.json)
[layer.json](https://github.com/user-attachments/files/17137924/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**:
```kotlin
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")
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.