如何清除Docker任务历史记录 [英] How to clear Docker task history
本文介绍了如何清除Docker任务历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以群体模式运行docker时,随着docker服务的更新,过去任务的历史记录也会累积。运行 docker node ps
显示任务日志。
When running docker in swarm mode, a history of past tasks accumulate as docker services are updated. Running docker node ps
displays the log of tasks.
如何清除此日志而不删除
How do I clear this log without removing the service?
推荐答案
您可以通过运行以下命令来调整swarm的历史记录限制:
You can adjust the history limit in swarm by running:
docker swarm update --task-history-limit=1
将仅保留一个先前的任务,而不保留默认任务5。有关更多详细信息,请参见cli文档: https://docs.docker.com/engine/reference/commandline/swarm_update/
Which will only keep one previous task instead of the default 5. See the cli docs for more details: https://docs.docker.com/engine/reference/commandline/swarm_update/
这篇关于如何清除Docker任务历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文