Skip to content
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

Build binary fully in container build #1171

Merged
merged 2 commits into from
Jul 22, 2020

Conversation

mrueg
Copy link
Member

@mrueg mrueg commented Jul 21, 2020

What this PR does / why we need it:
As a first step towards #1089, this now builds the kube-state-metrics binary fully in Docker. I'm not sure how images are build via the image-promoter, in order to build correctly there, the image-promoter would need to set a build arg for the arch it needs to build for.

FYI @paulfantom @lilic @tariq1890

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 21, 2020
@k8s-ci-robot k8s-ci-robot requested review from lilic and zouyee July 21, 2020 10:30
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 21, 2020
Dockerfile Show resolved Hide resolved
@tariq1890
Copy link
Contributor

Thanks @mrueg :)! PR looks good; just one minor comment to address

@mrueg mrueg force-pushed the build-in-Dockerfile branch from 23bd715 to c6333ef Compare July 22, 2020 08:48
mrueg added 2 commits July 22, 2020 14:01
Builds in docker now, so tempdir is not needed and we'll provide GOARCH
to Docker as a build-arg

Signed-off-by: Manuel Rüger <[email protected]>
@mrueg mrueg force-pushed the build-in-Dockerfile branch from c6333ef to 0be9f6e Compare July 22, 2020 12:01
@brancz
Copy link
Member

brancz commented Jul 22, 2020

If I'm not mistaken this was done intentionally to support the image promotion process on k8s.gcr.io, but I don't remember exactly. Maybe @lilic or @serathius remember? (maybe I'm totally mixing up things though)

@serathius
Copy link
Contributor

Yes, using container multi stage build was my recommendation to make integration with image promotion process easier. Build process for k8s.gcr.io is already done in docker, creating lot of problems with path mounting and permissions. I found that using docker multi stage build solves all those problems.

Secondly I found that using locally build binaries lead to broken images #1086 (comment)

@brancz
Copy link
Member

brancz commented Jul 22, 2020

@serathius Just to make sure I understand correctly, you also approve of this change right? :)

@serathius
Copy link
Contributor

Yes, it's a great improvement.

Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 22, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brancz, mrueg

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2020
@brancz
Copy link
Member

brancz commented Jul 22, 2020

(just wanted to make sure there is not some specific reason why we didn't have this :) )

@k8s-ci-robot k8s-ci-robot merged commit 751244c into kubernetes:master Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants