How to install kubectl in kubernetes container through docker image

后端 未结 4 1843
情书的邮戳
情书的邮戳 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条回答
  •  Happy的楠姐
    2021-02-06 11:20

    put this in your Dockerfile

    RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
    RUN chmod +x ./kubectl
    RUN mv ./kubectl /usr/local/bin
    

提交回复
热议问题