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

发布时间 2023-12-07 15:21:19作者: leiuk
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;" ]