docker automatically commit and push

2019-09-06 05:09发布

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

标签: bash docker
1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-09-06 05:39

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.

查看更多
登录 后发表回答