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

Change Dockerfile base images #101

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Conversation

nirarg
Copy link
Contributor

@nirarg nirarg commented Jul 13, 2022

@mfranczy this is the dockerfile I use to build the image localy
Do you think we can use it upstream?
fix issue: #50

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Jul 13, 2022
@kubevirt-bot kubevirt-bot requested review from mfranczy and rmohr July 13, 2022 11:23
@@ -1,6 +1,10 @@
FROM alpine:3.11.2
FROM --platform=linux/amd64 golang:1.18.3-buster AS builder
Copy link
Contributor

@mfranczy mfranczy Jul 13, 2022

Choose a reason for hiding this comment

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

We should use golang 1.17 image since we have this version in go.mod.

However, I would go with go-runner image that wraps stderr and stdout. We are using klog in this project and there is a KEP to remove flags like --log-file link. Additionaly, the whole k8s ecosystem is moving towards that solution https://github.com/kubernetes/kubernetes/blob/release-1.24/build/common.sh#L94

So maybe it's better to use image k8s.gcr.io/build-image/go-runner:v2.3.1-go1.17.11-bullseye.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mfranczy
You right, will change to go 1.17
But this is image used only for the builder, and not for the container itself
I'm using here gcr.io/distroless/static for the container image itself

Copy link
Contributor

@mfranczy mfranczy Jul 13, 2022

Choose a reason for hiding this comment

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

ah yes, you're right I overlooked. But for the container itself maybe we could use the k8s.gcr.io/build-image/go-runner:v2.3.1-go1.17.11-bullseye.0 anyway? Just to keep an option to still write logs to a file if somebody wants.

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionaly, is there any reason why you used buster for the build stage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But for the container itself maybe we could use the k8s.gcr.io/build-image/go-runner:v2.3.1-go1.17.11-bullseye.0 anyway?

I will change the container image and will update

Additionaly, is there any reason why you used buster for the build stage?

I saw some examples in other repo which use this for the build container, no specific reason

Copy link
Contributor

@mfranczy mfranczy Jul 13, 2022

Choose a reason for hiding this comment

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

I saw some examples in other repo which use this for the build container, no specific reason

So to align we could use golang:1.17.11-bullseye.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mfranczy as we discussed, changed the base images:
container image to registry.redhat.io/ubi9/ubi-micro
build image to golang:1.17.11
Please take a look

@kubevirt-bot
Copy link
Contributor

@nirarg: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-cloud-provider-kubevirt-e2e 0921485 link false /test pull-kubevirt-cloud-provider-kubevirt-e2e

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. I understand the commands that are listed here.

@nirarg nirarg changed the title Change Dockerfile to use gcr.io/distroless/static as the base image Change Dockerfile base images Jul 14, 2022
Copy link
Contributor

@mfranczy mfranczy left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mfranczy

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 14, 2022
@kubevirt-bot kubevirt-bot merged commit 16dcc92 into kubevirt:main Jul 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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants