nginxinc/nginx-amplify-agent

Autostart containerized Amplify-agent after restart (reboot server)

podguzovvasily opened this issue · 1 comments

Dear developers and community. I've installed Amplify-agent inside docker container, and agent works well. But how can I add autostart of amplify-agent when container will restarted or whole system rebooted?

P.S. I've used nginx:1.19.2 and install.sh for the agent installation. Thanks!

Hello there,

I needed the same thing so my current solution to this is as follows:

  1. Create a file inside /docker-entrypoint.d/ called 40-start-amplify.sh
  2. Make it executable chmod 775 /docker-entrypoint.d/40-start-amplify.sh
  3. Add the necessary command to start the agent-amplify service:
#!/bin/sh
# vim:sw=2:ts=2:sts=2:et

service amplify-agent start
  1. Save, exit and restart the container

I hope this helps!