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.

  1. How autostart/stop nginx on docker start/stop command?
  2. 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, before exit 0
  • create file nginx.conf containing

    description "Nginx"
    author "Me"
    start on filesystem and started docker.io
    stop on runlevel [!2345]
      /usr/bin/docker start -a nginx
    end script

But nothing to help.

  • Command init-checkconf nginx.conf returns this answer ERROR: version of /sbin/initctl too old – Alexander Ryasnyanskiy Sep 30 '15 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.