Build(dockerfile): pin golang base image to 1.24.4 for stability and CVE reduction#103
Build(dockerfile): pin golang base image to 1.24.4 for stability and CVE reduction#103talkraghu wants to merge 2 commits intopiraeusdatastore:mainfrom
Conversation
…CVE reduction Signed-off-by: Raghavendra K <raghavendra.k@nokia.com>
…CVE reduction Signed-off-by: Raghavendra K <raghavendra.k@nokia.com>
|
This is not a general solution. This would just cause us to have to update the base image reference a new go version releases. It will (in the current setup), also not push a new 1.3.0 image. This would not scale, and we would spend the whole day just rebuilding images. What would need to happen instead is that the latest tag is rebuild whenever an update to the base image or toolchain was available. That rebuild would need to use |
|
Hi @WanzenBug , thank you for your quick and thoughtful response. You're right — manually pinning Go versions in the Dockerfile is not a long-term solution and does not scale well across multiple versions like v1.3.0. My goal here was simply to highlight known CVEs and reduce exposure in the short term by updating to a secure Go version (1.24.4). However, I fully agree with your point: a general solution would require an automated rebuild process that can detect upstream changes and refresh the :latest image accordingly, using something like --no-cache. Unfortunately, I don’t have prior experience with GitHub Actions or workflow automation, so I am not in a position to implement that myself. Since you are your team are more familiar with the project's CI/CD setup, I would really appreciate it if you could consider adding such a rebuild process as part of your release or security hygiene process. I would be happy to continue scanning and reporting if that helps, and thanks again for maintaining the project. |
|
Instead of hardcoding the GO version to 1.24.4 can we set it "latest" version? i.e change from "FROM --platform=$BUILDPLATFORM golang:1 as builder" to The "latest" is getting is go with version 1.24.4 |
golang:1 will also fetch the latest image, so there is not actually anything to change, other than rebuilding without any caches... |
|
Thanks @WanzenBug , shall I withdraw this merge request? And as you said, can you pls trigger the rebuild without caches so that it gets us new docker image |
Summary:
This PR pins the Go base image to golang:1.24.4 in the piraeus-ha-controller Dockerfile.
The change reduces the exposure to CVEs.
Testing:
Rebuilt the image locally using golang:1.24.4
Deployed it in a cluster with a working Linstor setup.
Verified the ha-controller pod starts correctly and behaves as expected. Pod logs are as below
The CVE scans report 0 critical CVE's and 9 high CVE's.
The high cve's can be ignored i beleive. Pasted below are the same
@WanzenBug @js185692