How to clear Docker task history

2019-05-10 17:35发布

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.

enter image description here

How do I clear this log without removing the service?

标签: linux docker
2条回答
别忘想泡老子
2楼-- · 2019-05-10 18:06

You can adjust the history limit in swarm by running:

docker swarm update --task-history-limit=1

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/

查看更多
\"骚年 ilove
3楼-- · 2019-05-10 18:11

Instead this worked better to clear task history and show only the current running containers.

#docker swarm update --task-history-limit 0
查看更多
登录 后发表回答