service command not found

我在使用docker安装nginx时,镜像环境是centos,报如下错误:
nginx.sh service command not found
然后退出了镜像生成过程,解决办法:
进入容器内:
输入
service 发现真的没有

yum list | grep initscripts

会出现以下信息

initscripts.x86_64

使用yum安装一个

yum install initscripts -y

在输入service 就ok啦
那么需要dockerfile里面加

RUN yum install initscripts -y

猜你喜欢

转载自blog.csdn.net/xzpdxz/article/details/84855131