How to install kubectl in kubernetes container through docker image

后端 未结 4 1840
情书的邮戳
情书的邮戳 2021-02-06 10:36

I want to run \'kubectl\' commands in the container, so i want to install kubectl in the container, through while building the Docker image. Any help is appreciated!

4条回答
  •  温柔的废话
    2021-02-06 11:06

    If you have docker you can do whatever you want really since you can pull and start any image. So if you want to build and deploy:

    docker login
    docker build foo/bar .
    docker push
    docker run -v ~/.kube:/root/.kube lachlanevenson/k8s-kubectl set image deploy bar app=foo/bar
    

提交回复
热议问题