I have installed nginx to Docker container (container from ubuntu:trusty image).
And every time when I call docker stop nginx
and after docker start nginx
, my nginx server in shut down state.
- How autostart/stop nginx on
docker start/stop
command? - How I can see logs for commands, that executed on start and stop container?
dmesg
is empty.
Sorry, I think I don't understand the root of the problem, and making bad steps.
I tried to fix it using:
- add
service nginx start
to/etc/rc.local
file, beforeexit 0
create file
nginx.conf
containingdescription "Nginx" author "Me" start on filesystem and started docker.io stop on runlevel [!2345] respawn script /usr/bin/docker start -a nginx end script
But nothing to help.
init-checkconf nginx.conf
returns this answerERROR: version of /sbin/initctl too old