1

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]
    respawn
    script
      /usr/bin/docker start -a nginx
    end script
    

But nothing to help.

1
  • Command init-checkconf nginx.conf returns this answer ERROR: version of /sbin/initctl too old Sep 30, 2015 at 11:58

0

You must log in to answer this question.

Browse other questions tagged .