Issue
I would like to start ntp service automatically on Debian which is running inside a docker container. I'm using base image: tomcat:8-jre8. I have tried to write an init script inside /etc/init.d and then make it runnable and install it from dockerfile with the following commands:
RUN chmod 755 /etc/init.d/ntp
RUN update-rc.d ntp defaults
I got an error message like: 'missing LSB tags and overrides'
Then I thought maybe my script is bad because I never wrote an init script before so I copied an original ntp init script from an other Ubuntu server into the docker container. After that I got the following error: warning: current stop runlevel(s) (empty) of script `ntp' overrides LSB defaults (1). I appreciate any ideas and help.
Solution
Docker isn't virtual machine - docker is virtualization for one process.
So you should think only about preparing environment like library, some executables and so on which is needed by your application.
When you start docker container only one process is started inside this container. You can specify process executable running into container by CMD or ENTRYPOINT options for docker image.
There isn't standard OS boot sequence in Docker container.
Answered By - Slawomir Jaranowski Answer Checked By - Clifford M. (WPSolving Volunteer)