![](/img/trans.png)
[英]shell script to increment file names when a directory contents changes (centos)
[英]How to launch a init file and shell script file in docker file CMD when using centos/systemd as base image?
我的基本映像是centos/systemd.so
我的cmd將包含/usr/sbin/init
但我也想在創建容器時運行shell腳本文件。
我的Dockerfile:
FROM centos/systemd
#RUN yum -y install dos2unix
CMD ["usr/sbin/init"] //here i also want to launch a shell script file
使用解決方案編輯:
FROM centos/systemd
ADD /path-to-hello/hello.sh ./
ENTRYPOINT ["./hello.sh"]
hola.sh
的最后一行是exec /usr/sbin/init
構建docker build -t DockerImageName:1.0 .
運行docker run --name DockerName DockerImageName:1.0
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.