-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Switch to multistage build Dockerfiles for VPA #6338
Switch to multistage build Dockerfiles for VPA #6338
Conversation
/assign @sophieliu15 |
I am pretty overloaded with oncall issues. @laoj2 Could you take a look at this PR? |
@@ -12,10 +12,24 @@ | |||
# See the License for the specific language governing permissions and | |||
# limitations under the License. | |||
|
|||
FROM --platform=$BUILDPLATFORM golang:1.20.5 as builder |
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.
here and below: can we use the latest Go 1.20 (1.20.12 as of today https://go.dev/doc/devel/release) to reduce the chances of vulnerabilities in the next release?
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.
Oh, you're right, I forgot to push the latest commit that bumps the builder image, such that it is on the same version as the currently used builder – sorry!
In the light of the currently open PR by dependabot, I updated it to go 1.21.5. If you follow the steps outlined above to verify that there's no difference between the images, make sure that both images are built with the same go version.
Thanks! /lgtm @kwiesmueller can you take a look? |
@laoj2: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kwiesmueller, voelzmo The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Switch to multistage Dockerfiles to build the multi-platform binaries with
docker buildx
. The previous setup with multiplemake
targets was quite complicated and isn't necessary to achieve what we're trying to do. In particular, this change does:build-binary-with-vendor
,build-binary-with-vendor-*
,sub-push
,docker-builder
,build-in-docker
,build-in-docker-*
docker-build
execution from thedocker-push
make target, so we only build the image oncebuild-in-docker
to a build stage in the Dockerfile for each componentTARGETARCH
Special notes for your reviewer:
The interface for someone cutting a new release of the VPA stays the same: the command to be executed is still
make release
, as documented.I used to following process to verify that the images built from master and with this change are identical:
REGISTRY
with a container registry where you have access to :)vertical-pod-autoscaler/pkg/recommender
and executecontainer-diff
withDoes this PR introduce a user-facing change?