Kubernetes - Passing multiple commands to the container

前端 未结 3 1691
北海茫月
北海茫月 2020-12-24 06:55

I want send multiple entrypoint commands to a Docker container in the command tag of kubernetes config file.

apiVersion: v1
kind: Pod
metadata:
         


        
3条回答
  •  既然无缘
    2020-12-24 07:15

    There can only be a single entrypoint in a container... if you want to run multiple commands like that, make bash be the entry point, and make all the other commands be an argument for bash to run:

    command: ["/bin/bash","-c","touch /foo && echo 'here' && ls /"]

提交回复
热议问题