-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
chore: verify WAR signature when downloading it #2233
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
chore: verify WAR signature when downloading it #2233
Conversation
9e27a7a to
198d44f
Compare
198d44f to
535081e
Compare
d087aec to
49233f0
Compare
49233f0 to
ef010cc
Compare
| # Not using ADD as it does not check Last-Modified header | ||
| # see https://github.com/docker/docker/issues/8331 | ||
| RUN curl -fsSL "${WAR_URL}" -o /war/jenkins.war \ | ||
| && curl -fsSL "${WAR_URL}.asc" -o /war/jenkins.war.asc \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) As per https://docs.docker.com/reference/dockerfile/#adding-files-from-a-url
If the HTTP response contains a Last-Modified header, the timestamp from that header will be used to set the mtime on the destination file. However, like any other file processed during an ADD, mtime isn't included in the determination of whether or not the file has changed and the cache should be updated.
=> we can totally delegate the file download to the Docker Engine with something like
| # Not using ADD as it does not check Last-Modified header | |
| # see https://github.com/docker/docker/issues/8331 | |
| RUN curl -fsSL "${WAR_URL}" -o /war/jenkins.war \ | |
| && curl -fsSL "${WAR_URL}.asc" -o /war/jenkins.war.asc \ | |
| # Not using ADD as it does not check Last-Modified header | |
| # see https://github.com/docker/docker/issues/8331 | |
| ADD "${WAR_URL}" /war/jenkins.war | |
| ADD "${WAR_URL}.asc" /war/jenkins.war.asc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I suggest doing this change for all downloads in all images in another pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I suggest doing this change for all downloads in all images in another pull request.
Yup, totally agreed \o/
dduportal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
This change uses the GPG signature files now served from both pkg.jenkins.io and get.jenkins.io, and the new Jenkins PGP public key from 2026 (stored in this repository1) to verify Jenkins WAR signature on build.
Ref:
Testing done
Submitter checklist
Footnotes
As that GPG public key is valid for 3 years and as builds will fail if expired, manually updating it when it arrives could be enough. ↩