kube-capacity icon indicating copy to clipboard operation
kube-capacity copied to clipboard

Add dockerfile

Open day1118 opened this issue 4 years ago • 6 comments

This PR adds a dockerfile which builds kube-capacity to make it more portable. It would be great to add an automated build step and push it to a docker registry.

day1118 avatar Nov 06 '21 09:11 day1118

Hey @day1118, thanks for the PR! Is there any particular use case you had in mind for this? I've generally intended for kube-capacity to be a standalone cli tool. I'm not sure how helpful a Docker image would be for this.

robscott avatar Nov 08 '21 05:11 robscott

Is there any particular use case you had in mind for this?

TLDR: It means that the kube-capacity can be run from any machine without having to install anything other than docker, making it very portable.

Hi @robscott I have shifted to using almost all cli tools from within docker. Some examples include gcloud, helm, kubectl, jq, kube-linter, kubescore etc. If you create a simple docker compose file for any of those clis, you only need to prepend docker-compose run to a command and it will run within a container. (eg docker-compose run kube-capacity --pods --util) I find this great as my team do no need to install any tools, and you can change version back and forth very easily.

I'd love this option for kube-capacity also, and hope that you will consider automating the container build and pushing it to Dockerhub too! I'd be happy to help you set this up if you'd like.

day1118 avatar Nov 08 '21 06:11 day1118

Hi @robscott Any thoughts on merging this? Thanks

day1118 avatar Nov 17 '21 03:11 day1118

Hey @day1118, thanks for the reminder! Unfortunately I don't have the time to set up (and more importantly maintain) a Docker registry for this image. I am open to including a Dockerfile in the repo though. To minimize maintenance and potential vulnerabilities, I'd prefer an image with a distroless base though.

robscott avatar Nov 17 '21 06:11 robscott

That makes sense - I do find that distroless can be quite frustrating to troubleshoot etc as you don't have a shell, but it is your project after all.

day1118 avatar Nov 17 '21 06:11 day1118

Yeah I completely get that, I've just been on the hook for keeping images patched that we're not distroless and it was quite a task to keep up with. Unfortunately I just don't think I'd have enough time to keep up with that on this project.

robscott avatar Nov 17 '21 07:11 robscott

Going to close this out since I just haven't had much time to spend on this project. Thanks for the idea though!

robscott avatar Jan 19 '23 06:01 robscott