0

So elasticbeanstalk when updating or changing a docker deployed image will use docker kill in order to terminate the running docker container in order to be able to switch it for the new container that it is going to stage.

I'd like to be able to capture the logging information from that container, but the container is sent a SIGKILL so I cannot directly have the container shutdown gracefully. I could hack the EB staging and deployment scripts to use docker stop instead of docker kill, but I'm confused why EB doesn't give me the chance to clean up the app first before shutting it down.

I know it's a long shot, but is there anyway I can hook around this in order to be able to capture this log output outside of constantly pushing it off the machine? I don't really want to mess with amazon's deployment scripts, but that seems like the only way to get this functionality. Anyone have any insight into this?

Stephen Carman
  • 999
  • 7
  • 25
  • Have you already looked at cloudwatch logs? It's very simple to setup for Elastic Beanstalk. – Dave Maple Jan 16 '17 at 22:41
  • I'm not sure what you're asking, if the app is shut down there is no chance to push logs to cloud watch because of the sigkill. – Stephen Carman Jan 16 '17 at 22:43
  • i may be missing the issue -- but the cloudwatch logs agent would run as a discreet service so it wouldn't die with the docker container. – Dave Maple Jan 16 '17 at 22:52
  • That isn't the point, the docker container is given a SIGKILL it can't react to anything. – Stephen Carman Jan 16 '17 at 23:05
  • i see -- `docker stop` is what you want to implement -- persistent log capture is not the issue. It looks like a similar question has been previously posted and the OP used .ebextensions to modify the deployment scripts: http://stackoverflow.com/questions/32483088/howto-elastic-beanstalk-deploy-docker-graceful-shutdown – Dave Maple Jan 16 '17 at 23:22

0 Answers0