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

Adding parameterization to go-runner Dockerfile #2709

Conversation

jeremyrickard
Copy link
Contributor

@jeremyrickard jeremyrickard commented Oct 13, 2022

Signed-off-by: Jeremy Rickard jrickard@microsoft.com

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR updates the go-runner Dockerfile to support better overriding of the builder and base images used. BUILDER_IMAGE becomes an ARG and a new Makefile variable DISTROLESS_REGISRTRY is added to allow the DISTROLESS_IMAGE build arg to receive the registry/repo as well. This is defaulted to gcr.io/distroless to not impact the existing configurations. The DISTROLESS_IMAGE build arg is populated with a combination of the DISTROLESS_REGISTRY and DISTROLESS_IMAGE Makefile variables:

BUILD_ARGS = --build-arg=BUILDER_IMAGE=$(BUILDER_IMAGE) \
             --build-arg=DISTROLESS_IMAGE=$(DISTROLESS_REGISTRY)/$(DISTROLESS_IMAGE)

This allows you to completely override the build-arg but is backward compatible w/ the existing variants.yml and the cloudbuild.yaml

GO_VERSION and OS_CODENAME are no longer needed within the Dockerfile and are expressed entirely within the Makefile.

Which issue(s) this PR fixes:

Fixes #2702

Special notes for your reviewer:

Does this PR introduce a user-facing change?

 BUILDER_IMAGE can now be overridden when building the go-runner image. Additionally a new variable DISTROLESS_REGISTRY can be used to specify a different registry and repository, to more completely override the DISTROLESS_IMAGE build arg to support custom images. 

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 13, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 13, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2022
@jeremyrickard jeremyrickard force-pushed the custom-base-and-builder-image-for-go-runner branch from fdee922 to 7826e98 Compare November 11, 2022 15:08
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 11, 2022
@jeremyrickard jeremyrickard force-pushed the custom-base-and-builder-image-for-go-runner branch from 7826e98 to 0ba6a81 Compare November 11, 2022 15:48
@jeremyrickard jeremyrickard self-assigned this Nov 11, 2022
@jeremyrickard jeremyrickard force-pushed the custom-base-and-builder-image-for-go-runner branch from 0ba6a81 to d1afbe7 Compare November 11, 2022 22:13
Signed-off-by: Jeremy Rickard <jrickard@microsoft.com>
@jeremyrickard jeremyrickard force-pushed the custom-base-and-builder-image-for-go-runner branch from d1afbe7 to 305bcd6 Compare November 11, 2022 22:36
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2022
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/lgtm

thanks

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, jeremyrickard, saschagrunert

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 merged commit 61db978 into kubernetes:master Nov 14, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Nov 14, 2022
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. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. 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.

Allow customizable distroless image and builder image for go-runner
4 participants