如何通过puppet管理远程docker容器
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,小编给大家分享一下如何通过puppet管理远程docker容器,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!使用脚本访问d
千家信息网最后更新 2026年11月01日如何通过puppet管理远程docker容器
小编给大家分享一下如何通过puppet管理远程docker容器,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
使用脚本访问docker容器:
root@docker:~# ./control.sh What you want to do?try input 'help' to get some tips(please input the words in ''): accessPlease input the specific container's name:web1root@050ebb07cf25:/# #已经进入docker容器,输入exit退出,不过脚本也会退出
获取帮助信息(不妨多试试其他命令):
root@docker:~# ./control.sh What you want to do?try input 'help' to get some tips(please input the words in ''): help################################################################################################################################ The helping information about this script ################################################################################################################################COMMAND INFO ################################################################################################################################'status' get the info about the running containers. 'access' access the specific contianer. 'manage' manage the contianer,such as 'start','stop' and 'delete'. 'exit' exit this script. 'statusa' show the infomation about all containers. 'statusl' show the latest infomation about container. ################################################################################################################################MAINCOMMAND SUBCOMMAND INFO ################################################################################################################################'manage' 'start' launch a exist contianer 'manage' 'stop' stop a running container 'manage' 'delete' detele a not-running container 'manage' 'status' get the info about the running containers 'manage' 'statusa' show the infomation about all containers. 'manage' 'statusl' show the latest infomation about container. ################################################################################################################################What you want to do?try input 'help' to get some tips(please input the words in ''):
stop容器,delete容器,start容器:
stop容器web1:
root@docker:~# ./control.sh What you want to do?try input 'help' to get some tips(please input the words in ''): managePlease input the container name which you want to manage,or 'exit',or 'help'?: statusRunning container:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES050ebb07cf25 training/webapp:latest "python app.py" 12 minutes ago Up 12 minutes 0.0.0.0:2000->5000/tcp web1 0ef5d56e4c89 training/webapp:latest "python app.py" 12 minutes ago Up 12 minutes 0.0.0.0:1000->5000/tcp web1/webbase,webbase Please input the container name which you want to manage,or 'exit',or 'help'?: web1Do you want to 'start' or 'stop' or 'delete' your container?: stopNotice:container is stoppingweb1Please input the container name which you want to manage,or 'exit',or 'help'?:
web1被停掉
start容器web1:
Please input the container name which you want to manage,or 'exit',or 'help'?: web1Do you want to 'start' or 'stop' or 'delete' your container?: startNotice:Please make sure this container is not runningweb1Please input the container name which you want to manage,or 'exit',or 'help'?: statusRunning container:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES050ebb07cf25 training/webapp:latest "python app.py" 14 minutes ago Up 6 seconds 0.0.0.0:2000->5000/tcp web1 0ef5d56e4c89 training/webapp:latest "python app.py" 14 minutes ago Up 14 minutes 0.0.0.0:1000->5000/tcp web1/webbase,webbase Please input the container name which you want to manage,or 'exit',or 'help'?:
web1又启动了
delete容器web1(必须先把它关闭):
Please input the container name which you want to manage,or 'exit',or 'help'?: web1Do you want to 'start' or 'stop' or 'delete' your container?: stopNotice:container is stoppingweb1Please input the container name which you want to manage,or 'exit',or 'help'?: statusRunning container:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES0ef5d56e4c89 training/webapp:latest "python app.py" 15 minutes ago Up 15 minutes 0.0.0.0:1000->5000/tcp web1/webbase,webbase #web1被关闭Please input the container name which you want to manage,or 'exit',or 'help'?: web1Do you want to 'start' or 'stop' or 'delete' your container?: deleteNotice:You cannot delete a running container,if the container is running,please stop it first!web1Please input the container name which you want to manage,or 'exit',or 'help'?: statusaAll infomation about containers:\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES0ef5d56e4c89 training/webapp:latest "python app.py" 17 minutes ago Up 17 minutes 0.0.0.0:1000->5000/tcp webbase 4de1685a386e training/webapp:latest "/bin/bash" 37 hours ago Exited (0) 37 hours ago backstabbing_lovelace c915cb516b02 training/webapp:latest "python app.py" 37 hours ago Exited (-1) 37 hours ago clever_mccarthy #没有web1的相关信息了
web1被删除
tips:在manage会话下输入exit,将会返回主会话,再输入一次exit退出脚本:
root@docker:~# ./control.sh What you want to do?try input 'help' to get some tips(please input the words in ''): managePlease input the container name which you want to manage,or 'exit',or 'help'?: exit #退出manage会话ExitingWhat you want to do?try input 'help' to get some tips(please input the words in ''): exit #主会话中退出root@docker:~#
以上是"如何通过puppet管理远程docker容器"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!
容器
篇文章
脚本
输入
管理
信息
内容
帮助
不怎么
命令
大部分
更多
知识
行业
资讯
资讯频道
频道
参考
学习
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
伟宏互联网科技
蓝思科技飞鸽互联网
关于新基建和互联网科技
中国 科技 互联网
互联网科技小贷
互联网科技股票
贷财互联网科技
万达互联网科技
撒么互联网科技公司
互联网科技公司招聘
千方科技属于互联网企业吗
未来五年的互联网科技
如何创新互联网科技
华夏恒生互联网科技013171
互联网金融科技公司的优势
广东工业互联网大赛深圳学泰科技
上海乐五互联网科技有限公司
宁波跨境商互联网科技有限公司
全球科技与互联网公司市值变化
河南商务圈互联网科技有限公司
互联网科技有限公司
深圳九邦互联网科技有限公司
互联网科技公司税收优惠
人人互联网科技是培训
中国最先进互联网科技公司
上海宁丞科技互联网
深圳市罗太互联网科技有限公司
神州科技互联网有限公司
互联网科技手机排行榜
互联网科技创业有什么好项目