70.使无进程docker容器保持运行

docker容器无进程启动
docker run -i -t c1717d73fd69 /bin/bash

k8s中添加循环使容器保持运行
image: k8s-jingxiang-registry.cn-hangzhou.cr.aliyuncs.com/yaozh.com/nullpython3:v2
name: pod-predict
imagePullPolicy: IfNotPresent
command: [ "/bin/sh", "-c", "--" ]
args: [ "while true; do sleep 30; python3 /data/wwwroot/predict/main.py -i 60 -l /data/wwwlogs/predict/; done;" ]

 

posted @ 2023-12-07 15:20  leiuk  阅读(37)  评论(0编辑  收藏  举报