指点云用户44 发表于 2022-7-30 13:43:10

linux如何查看docker是否启动成功

<blockquote style="margin: 0.8em 0px; padding: 10.5px 21px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); background-color: rgb(245, 245, 245); border-left: 4px solid rgb(204, 204, 204); color: rgb(85, 85, 85); font-size: 14px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal;"><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); font-size: 16px; box-sizing: border-box; border-radius: 8px;">linux中查看docker是否启动成功的方法:1、利用“systemctl list-units”命令,该命令可以查看当前已经启动的服务;2、利用systemctl命令,该命令用于进行服务管理,当参数设置为“status”时就可以查看当前服务的状态,语法为“systemctl status docker”。</p></blockquote><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">本教程操作环境:linux7.3系统、Dell G3电脑。</p><h2 style="margin: 0px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">linux如何查看docker是否启动成功</h2><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">服务:常驻系统内存中的进程且可以提供一些系统和网络功能</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">现在最新的Linux系统都统一使用systemctl进行服务的管理</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><span style="margin: 0px; padding: 0px; font-size: 18px;"><strong style="margin: 0px; padding: 0px;">1、管理服务 systemctl (root权限)</strong></span></p><table class="wcn_c_table" cellpadding="0" cellspacing="0" width="760"><tbody style="margin: 0px !important; padding: 0px !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;"><tr style="margin: 0px !important; padding: 0px !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;" class="firstRow"><td class="gutter" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); margin: 0px !important; border-radius: 4px 0px 0px 4px !important; background: none !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(175, 175, 175) !important; user-select: none !important;" width="NaN"><p class="line number1 index0 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 0.5em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important; text-align: right !important;">1</p></td><td class="code" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); word-break: break-all; margin: 0px !important; border-radius: 0px !important; background: none !important; inset: auto !important; float: none !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; box-sizing: content-box !important; min-height: auto !important;" width="719"><p class="line number1 index0 alt2" style="margin-top: 15px; margin-bottom: 15px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); line-height: 1.5em; border-radius: 8px; font-size: 16px; color: rgb(61, 70, 77); box-sizing: border-box; padding-right: 1em !important; padding-left: 1em !important; border-left: 3px solid rgb(67, 90, 95) !important; white-space: pre-wrap !important;"><code class="sql plain" style="padding: 2px 4px; font-size: 13px; color: rgb(199, 37, 78); background-color: rgb(249, 242, 244); border-radius: 4px; font-family: Monaco, Menlo, Consolas, Courier New, monospace; margin: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; line-height: 1.5em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">systemctl xxx.service</code></p></td></tr></tbody></table><ul style="padding: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">status 查看当前服务状态</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">start 启动服务</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">stop 关闭服务</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">restart 重启服务</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">enable 设置开机启动</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">disable 设置开机不启动</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">reload 后面不接具体服务名,重新加载配置文件</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">mask 注销服务</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">unmask 取消注销</p></li></ul><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">示例如下:<br style="margin: 0px; padding: 0px;"/></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><strong style="margin: 0px; padding: 0px;">运行级别的分类 runlevel</strong></p><ul style="padding: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">运行级别0:系统停机状态</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">运行级别1:单用户工作状态,root权限,用于系统维护,禁止远程登陆</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">运行级别2:多用户状态(没有NFS)</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">运行级别3:完全的多用户状态(有NFS)</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">运行级别4:系统未使用,保留</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">运行级别5:X11控制台</p></li><li><p style="margin-top: 15px; margin-bottom: 15px; padding-left: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; border-radius: 8px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important;">运行级别6:系统正常关闭并重启</p></li></ul><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; font-size: 18px;">2、一些常用命令 systemctl</span></strong></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><strong style="margin: 0px; padding: 0px;">查看当前已经启动的服务 systemctl list-units</strong></p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">查看所有服务 systemctl list-unit-files</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">查看服务有哪些依赖 systemctl list-dependencies xx.service</p><p style="margin-top: 15px; margin-bottom: 15px; padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); box-sizing: border-box; border-radius: 8px; font-family: Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">查看服务有哪些依赖(反向) systemctl list-dependencies --reverse xx.service</p><p><br/></p><link rel="stylesheet" href="//www.zhidianyun.cn/source/plugin/wcn_editor/public/wcn_editor_fit.css?v134_TZ8" id="wcn_editor_css"/>
页: [1]
查看完整版本: linux如何查看docker是否启动成功