I\'ve a container with odoo on it on the dir \"/opt/odoo/\".
A init script on \"/etc/init.d/odoo-server\"
#!/bin/bash
### BEGIN INIT INFO
# Provides:
I found that the service not starting is because of the /usr/sbin/policy-rc.d
returns a 101 code:
See: http://jpetazzo.github.io/2013/10/06/policy-rc-d-do-not-start-services-automatically/
And docker set it to return 101 in a container.
So, change that script on build will work, you can make a build.sh
to run in Dockerfile
and runs the below script:
cat << EOF > /usr/sbin/policy-rc.d
#!/bin/sh
# For most Docker users, "apt-get install" only happens during "docker build",
# where starting services doesn't work and often fails in humorous ways. This
# prevents those failures by stopping the services from attempting to start.
# exit 101
exit 0
EOF