Docker to execute startup script after init

General support questions
Post Reply
tj5527
Posts: 1
Joined: 2018/07/05 08:43:26

Docker to execute startup script after init

Post by tj5527 » 2018/07/05 08:51:09

After searching on the internet (https://hub.docker.com/_/centos/), I notice docker image based on centos7 requires some setup in order to get systemd working. Following that instruction, basically I can build the image without a problem.

However, with that configuration I can't execute startup script after CMD ["/usr/sbin/init"]. What additional steps are required in order to execute script after /usr/sbin/init?

Thanks

gjaltemba
Posts: 49
Joined: 2016/11/29 15:23:25

Re: Docker to execute startup script after init

Post by gjaltemba » 2018/07/05 17:31:42

Try using only your startup script as CMD[] and put /usr/sbin/init first in startup script.

Post Reply