更新容器的配置
docker update:更新一个或多个容器的配置。 具体内容请访问:https://docs.docker.com/engine/reference/commandline/update/#options
语法:docker update [OPTIONS] CONTAINER [CONTAINER...]
1.OPTIONS说明
--restart:当容器退出时重新启动的策略 --memory-swap:交换空间,“-1”允许无限交换. --memory , -m:内存限制
2.设置abebf7571666容器重启策略
docker update --restart=always abebf7571666
[root@localhost plugins]# docker update -m 1024m --memory-swap -1 174c44e86f31 174c44e86f31 [root@localhost plugins]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7ab7bf7aa2e5 kibana:7.4.2 "/usr/local/bin/dumb…" 7 days ago Up 5 hours 0.0.0.0:5601->5601/tcp kibana 174c44e86f31 elasticsearch:7.4.2 "/usr/local/bin/dock…" 7 days ago Up 9 minutes 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp elasticsearch