Docker Community Forums

Share and learn in the Docker community.

Execute a script on adding/removing links to container?


(Guillaume Hain) #1

I would like to know if there is a way to detect container links update and use this event in order to execute a script ?

The goal is to re-run a configuration generation script which will update the service configuration file with the add/remove containers and reload the service.

Example:

  • Scale up a container linked to my container will add a new linked container => I need to add the new linked container to the configuration file and reload the service
  • Scale down a container linked to my containers will remove previously linked container => I need to remove the container and reload the service

(Guillaume Hain) #2

Could it be that there is a way to detect added/removed environment variables ?