Docker: Approaches for watching files and restarting container processes

Are there any workable approaches to watch/reload within docker?

The use case here is development, where switching between branches may change one or more of backend, frontend or database provisioning files.

  • “Not a tty” error in Alpine-based duplicity image
  • Docker REST API is not binding on port for Jenkins
  • Start a dependency unit in CoreOS
  • docker sonarqube checkdependency plugin
  • MupX, graphicsmagick and env var
  • Setting absolute limits on CPU for Docker containers
  • Example: I have a node.js application. If server JS code changes, I want the backend server to restart. If package.json changes, I want the “install” container (runs npm install, saving node_modules to a shared Volume). If SQL files change, I want the provisioning container to run its psql commands again.

    Basically, I want to watch certain files and restart the process if they change (container itself is not technically restarted). Supervisord isn’t cut out for watching, but seems like process managers like PM2 or Forever would normally be the slam dunk choice if it weren’t for the docker consideration.

  • Update docker version where containers are running
  • docker build hangs in directory with many files
  • tomcat7 fail to start inside Ubuntu Docker container
  • Weird terminal formatting on Windows
  • How to use Nomad with Nvidia Docker?
  • Docker Windows Container - DockerFile set iis default document
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.