1. 程式人生 > >service command not found

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