Welcome to Qi-U Community for programmer and developer-Open, Learning and Share

Categories

0 votes
107 views
in Technique[技术] by (31.9m points)

dockerfile的 cdm 怎么没有运行

image.png

DokcerFile

FROM centos  
MAINTAINER 11  
WORKDIR /root/  
RUN yum -y upgrade   
    && yum -y update   
    && yum -y install git vim python3 lsof epel-release   
    && yum -y install supervisor   
    && yum -y install screen   
    && mkdir ~/.pip   
    && echo -e "[global]nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.pip/pip.conf   
    && pip3 install tornado==4.3 requests==2.23.0 elasticsearch==7.6.0 pika==1.1.0 pycryptodome==3.9.7 jieba==0.42.1 bert-base==0.0.9 pymongo==3.6.0 Crypto bson apollo-client  
  
RUN git clone https://xxx.git   
    && sed -i 's/ES_HOST = client.get_value("ES_HOST_IN", "", namespace="Data.es")/ES_HOST = "xxxx"/' /root/standard_clean/src/config.py   
    && mkdir /run/supervisor/   
    && echo -e  "[group:tornadoes]nprograms=ana-8000n[program:ana-8000]ndirectory = /root/standard_cleanncommand = python3 run.pynautorestart = truenrestart=truen" >> /etc/supervisord.conf  
#    && python3 standard_clean/run.py   
#    && python3 standard_clean/cron_receive.py  
  
COPY /runSh/screen-start.sh /usr/bin/screen-start.sh  
RUN chmod +x /usr/bin/screen-start.sh  
CMD ["my-start.sh"]

my-start.sh

#!/bin/sh  
/usr/bin/supervisord -c /etc/supervisord.conf  
screen_name="c1"  
screen -dmS $screen_name  
cmd1="python3 /root/standard_clean/cron_receive.py";  
screen -x -S $screen_name -p 0 -X stuff "$cmd1"  
screen -x -S $screen_name -p 0 -X stuff 'n'

启动docker 的命令如下:

docker build -t s_clean:v1 .
创建成功
docker run -i -t s_clean:v1 bash 

进来之后,发现 screen 和 supervisor 都安装了,但是 都没有任务在跑,也就是说,my-start.sh 貌似没有运行?

请问是哪儿写错了吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (31.9m points)
docker run -i -t s_clean:v1 bash 
                            ^^^^

你这个 bash 会覆盖到 CMD 。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Qi-U Community for programmer and developer-Open, Learning and Share
...