Autostart containerized Amplify-agent after restart (reboot server)
podguzovvasily opened this issue · 1 comments
podguzovvasily commented
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!
miroslavrussev commented
Hello there,
I needed the same thing so my current solution to this is as follows:
- Create a file inside
/docker-entrypoint.d/called40-start-amplify.sh - Make it executable
chmod 775 /docker-entrypoint.d/40-start-amplify.sh - Add the necessary command to start the agent-amplify service:
#!/bin/sh
# vim:sw=2:ts=2:sts=2:et
service amplify-agent start
- Save, exit and restart the container
I hope this helps!