openshift / jenkins

Apache License 2.0
260 stars 446 forks source link

Container image no longer includes Jenkins version as a label #1633

Closed jlebon closed 1 year ago

jlebon commented 1 year ago

This previously worked as per https://github.com/openshift/jenkins/issues/924 and https://github.com/openshift/jenkins/pull/925, but then we regressed on it with https://github.com/openshift/jenkins/pull/1374 (see https://github.com/openshift/jenkins/pull/1374#issuecomment-1339947962).

$ skopeo inspect -n --authfile ... docker://quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:46082d2cafe3e6789fae2190996ee16f11ff1789318f8a82a003b4b8d7b33b2a | grep io.jenkins.version
        "io.jenkins.version": "latest",
coreydaley commented 1 year ago

There is a mechanism for setting the jenkins versions in the Dockerfile when the image is built, it is here (https://github.com/openshift/jenkins/blob/master/2/Dockerfile.rhel8#L5) and here (https://github.com/openshift/jenkins/blob/master/2/Dockerfile.rhel8#L48), and if you use the make build command structure to build the images, it should be populated. However, if you just use docker/podman/whatever to build the image, and don't supply that arg, then it just gets set to latest. That being said, i don't know how the ART process for building the images in the openshift-release-dev org on quay is setup, as we do not build those images. I would suggest that you open an issue with ART in the #aos-art forum of the Red Hat slack (since you seem to be a red hat employee) and see if they can update their process to include that information

coreydaley commented 1 year ago

/close I am going to close this as we don't build those images, but feel free to re-open or contact us in #forum-openshift-jenkins on slack if you have further questions.

openshift-ci[bot] commented 1 year ago

@coreydaley: Closing this issue.

In response to [this](https://github.com/openshift/jenkins/issues/1633#issuecomment-1493160122): >/close >I am going to close this as we don't build those images, but feel free to re-open or contact us in #forum-openshift-jenkins on slack if you have further questions. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
jlebon commented 1 year ago

I'm not sure of ART's specific capabilities, but in general it's not trivial to customize builds that way in highly automated environments. Another approach is to move the source of truth for the Jenkins version to the ARG field in the Dockerfile, and then have a RUN step that populates jenkins-version.txt from that. WDYT?

coreydaley commented 1 year ago

We have several Dockerfiles that need to be kept in sync, I think that would be much more difficult to maintain than the single jenkins-version.txt file.