这是使用kubernetes在一个YAML文件中传递多个命令和参数的方法:
# Write your commands here
command: ["/bin/sh", "-c"]
# Write your multiple arguments in args
args: ["/usr/local/bin/php /var/www/test.php & /usr/local/bin/php /var/www/vendor/api.php"]
yaml文件中的完整容器阻止:
containers:
- name: widc-cron # container name
image: widc-cron # custom docker image
imagePullPolicy: IfNotPresent # advisable to keep
# write your command here
command: ["/bin/sh", "-c"]
# You can declare multiple arguments here, like this example
args: ["/usr/local/bin/php /var/www/tools/test.php & /usr/local/bin/php /var/www/vendor/api.php"]
volumeMounts: # to mount files from config-map generator
- mountPath: /var/www/session/constants.inc.php
subPath: constants.inc.php
name: widc-constants
command
因为它覆盖了DockerfileEntrypoint
;)