docker automatically commit and push

2019-09-06 05:02发布

问题:

I'm trying to setup a GUI application in docker to use it on different computers with the exact same configuration. The container is working but I always have to commit and push the changes manually.

Is there a way to automatically commit and push the changes of the docker container after the container was stopped (by closing the application).

Thanks for helping, Flo

回答1:

I don't know of a tool which does that automatically, but you could write one. Docker emits events when containers stop, so you could have a process that subscribes to those events (or a cron job that occasionally polls for them) and when it detects a closed container (maybe with your own naming convention?), it could automatically docker commit and tag.

The events are available via docker events (docs), and the Docker Remote REST API.



标签: bash docker