cyberark / kubeletctl

A client for kubelet
Apache License 2.0
713 stars 81 forks source link

feat(Dockerfile): Updated dockerfile to build from source #6

Closed AlexsJones closed 4 years ago

AlexsJones commented 4 years ago

Let me know what you think @g3rzi

g3rzi commented 4 years ago

It looks good, thanks again for your contribution :)

One weird thing I noticed that is the after build the docker image and trying to run kubeletctl it failed with the error:

/bin/sh: kubeletctl: not found

I found that the reason it because it compiled with amd64 which is weird because it worked for me before.
Maybe the latest image of alpine was changed to use 386 because it worked when I compiled kubeletctl for 386.

I saw they have amd64/alpine image but it didn't work with it neither, is required more research but for the current solution I will replace the building to 386.

g3rzi commented 4 years ago

Another thing we need to think of is for examples for users to run it with external files like kubeconfig.
Because if they will run:

docker run -it --rm kubeletctl:latest -k /etc/kubernetes/kubelet.conf

It won't work because they need to mount it with -v.
I tried maybe like that:

docker run -it -v /etc/kubernetes/kubelet.conf:/tmp/kubelet.conf --rm kubeletctl:latest -k /tmp/kubelet.conf  

But it failed with:

panic: error loading config file "/tmp/kubelet.conf": open /tmp/kubelet.conf: permission denied   
AlexsJones commented 4 years ago

Thanks for the feedback @g3rzi want me to look into that?

g3rzi commented 4 years ago

I will give it a try again, maybe I missed something. If I will see that I don't have time I will check with you.