ofelia icon indicating copy to clipboard operation
ofelia copied to clipboard

docker-compose / scaled container support

Open willfarrell opened this issue 9 years ago • 3 comments

Would be nice to be nice to be able to trigger a script on all instances of a container. Using docker-compose you can end up with docker_nginx_1, docker_nginx_2, ..., docker_nginx_N after scaling nginx up.

Proposal:

Add in the use of

[job-exec "job-executed-on-running-container"]
schedule = @hourly
compose-project= docker
container = nginx
command = /etc/init.d/nginx reload

As a dynamic shortcut for:

[job-exec "job-executed-on-running-container"]
schedule = @hourly
container = docker_nginx_1
command = /etc/init.d/nginx reload

[job-exec "job-executed-on-running-container"]
schedule = @hourly
container = docker_nginx_2
command = /etc/init.d/nginx reload

Where compose-project is -p, --project-name NAME Specify an alternate project name (default: directory name).

Thought?

willfarrell avatar Jan 13 '17 20:01 willfarrell

Yes, looks interesting a PR is welcome

mcuadros avatar Jan 15 '17 17:01 mcuadros

If I knew go, I totally would. Maybe a future side project when I can find the time.

willfarrell avatar Jan 20 '17 04:01 willfarrell

should easily be manageable with labels now.

CybotTM avatar Jun 04 '25 19:06 CybotTM