鍍金池/ 問(wèn)答/Linux  網(wǎng)絡(luò)安全/ swarm docker service update問(wèn)題

swarm docker service update問(wèn)題

docker swarm集群創(chuàng)建的service

docker service create --name test_web --mode global --publish mode=host,published=10002,target=80 nginx

service 運(yùn)行都正常。但是我想把service的容器都重啟一遍。找到docker service update test_web
嘗試,發(fā)現(xiàn)確實(shí)會(huì)重啟:
#docker service update test_web
test_web
Since --detach=false was not specified, tasks will be updated in the background.

但是有個(gè)問(wèn)題就是重啟后每個(gè)node上都會(huì)有 exit 狀態(tài)的容器。

c9d98b3700d9 nginx "/bin/sh -c 'nginx" 10 minutes ago Exited (137) 8 minutes ago test_web.0xp4mew7v11z1gnwjvh7nzvyc.3wp0rft0qf8n3r9kfgfe71gm3

有什么辦法可以讓service更新后會(huì)自動(dòng)刪除這些exit狀態(tài)的容器嗎?
或者說(shuō)有其他的重啟service容器的思路?

回答
編輯回答
乖乖噠

自己寫(xiě)個(gè)腳本刪除吧,我目前沒(méi)好辦法

2018年3月28日 18:48