一. 从docker hub 下载centos 官方镜像


docker pull centos:7

运行容器
docker run -i -t centos:7 /bin/bash
二. 安装passwd,openssl,openssh-server



yum -y install epel-release passwd openssh-server openssh-clients 


mkdir /var/run/sshd



ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key




ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key 


#修改root用户的密码


#passwd root
<div style="background-color: inherit;">
    <span style="background-color: inherit;"><span style="background-color: inherit;"><span style="background-color: inherit;">#新用户appadmin</span></span></span>
</div>

<div style="background-color: inherit;">
    <div style="background-color: inherit;">
        #useradd&nbsp;-g&nbsp;users&nbsp;appadmin
    </div>

        &nbsp;

</div>

<div style="background-color: inherit;">
    <span style="background-color: inherit;"><span style="background-color: inherit;"><span style="background-color: inherit;">#</span></span></span><span style="line-height: 1.5; background-color: inherit;">echo &#39;<span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">appadmin</span>:<span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">appadmin</span>&#39; |chpasswd</span>
</div>



 
<div style="background-color: inherit;">
    <span style="line-height: 1.5; background-color: inherit;">#</span><span style="line-height: 1.5; background-color: inherit;">systemctl&nbsp;enable&nbsp;sshd.service</span>
</div>

<div style="background-color: inherit;">
    <span style="background-color: inherit;"><span style="background-color: inherit;">#</span></span><span style="background-color: inherit;">/usr/sbin/sshd&nbsp;restart</span>
</div>

<div style="background-color: inherit;">
    <span style="background-color: inherit;"><span style="background-color: inherit;">#sed&nbsp;-i&nbsp;&#39;s/UsePAM&nbsp;yes/UsePAM&nbsp;no/&#39;&nbsp;/etc/ssh/sshd_config</span></span>
</div>

    #<span style="background-color: inherit;">sed&nbsp;-i&nbsp;&#39;s/<span style="background-color: inherit;">GSSAPIAuthentication<span style="background-color: inherit;">&nbsp;</span><span style="background-color: inherit;">yes</span></span>/<span style="background-color: inherit;"><span style="background-color: inherit;"><span style="background-color: inherit;">GSSAPIAuthentication</span></span></span>&nbsp;no/&#39;&nbsp;/etc/ssh/sshd_config</span>

<div style="background-color: inherit;">
    <span style="background-color: rgb(255, 255, 255);">#sed -i &quot;s/#UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g&quot; /etc/ssh/sshd_config</span>
</div>

<div style="background-color: inherit;">
    <span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">#sed -i &#39;s/.*session.*required.*pam_loginuid.so.*/session optional pam_loginuid.so/g&#39; /etc/pam.d/sshd&nbsp;</span>

        &nbsp;

    <div style="background-color: inherit;">
        <div style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">
            <div style="background-color: inherit;">
                <span style="background-color: inherit;"><span style="background-color: inherit;"><span style="background-color: inherit;"><span style="background-color: inherit;">#</span></span></span><span style="background-color: inherit;">/usr/sbin/sshd&nbsp;reload</span></span>
            </div>

            <div style="background-color: inherit;">
                <span style="background-color: inherit;"><span style="background-color: inherit;"><span style="background-color: inherit;"><span style="background-color: inherit;">#</span></span></span><span style="background-color: inherit;">/usr/sbin/sshd&nbsp;restart</span></span>
            </div>
        </div>
    </div>

        &nbsp;

</div>


最后

#/usr/sbin/sshd -D




 



<span style="background-color: inherit;">参数</span><span style="background-color: inherit;">-D</span><span style="background-color: inherit;">表示sshd运行在前台。这样当前的docker容器就会一直有程序在运行。</span>

退出exit





 
            <div style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">
                <div style="background-color: inherit;">
                    <span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">#&nbsp;</span>docker&nbsp;ps&nbsp;-l
                </div>
            </div>
        </div>
    </div>
</div>

    <span style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">使用commit命令保存镜像</span>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    docker&nbsp;commit&nbsp;<span style="line-height: 1.5; background-color: inherit;">09ae41c11e1a&nbsp;</span><span style="line-height: 1.5; background-color: inherit;">&nbsp; centos7.2.1511-v5:centos7.2.1511-0816</span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">#&nbsp;</span><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">docker images</span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    &nbsp;
</div>

    <span style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">基于新镜像运行容器 </span><span style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">在宿主机上映射端口</span>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    docker&nbsp;run&nbsp;-d&nbsp;-p&nbsp;2222:22&nbsp;<span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">centos7.2.1511-v5:centos7.2.1511-0816</span>&nbsp;/usr/sbin/sshd&nbsp;-D
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <pre style="font-family: Monaco, Consolas, Courier, &quot;Lucida Console&quot;, monospace; font-style: normal; background-color: inherit;">

查看映射端口是否成功

    <div style="background-color: inherit;">
        #&nbsp;docker&nbsp;ps&nbsp;-all
    </div>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <div style="background-color: inherit;">
        [root@localhost&nbsp;~]#&nbsp;docker&nbsp;ps&nbsp;-all
    </div>

    <div style="background-color: inherit;">
        CONTAINER&nbsp;ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IMAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMAND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CREATED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PORTS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NAMES
    </div>

    <div style="background-color: inherit;">
        c2bc3c58a115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;centos7.2.1511-v5:centos7.2.1511-0816&nbsp;&nbsp;&nbsp;&quot;/usr/sbin/sshd&nbsp;-D&quot;&nbsp;&nbsp;&nbsp;4&nbsp;seconds&nbsp;ago&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Up&nbsp;2&nbsp;seconds&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0.0.0:2222-&gt;22/tcp&nbsp;&nbsp;&nbsp;ecstatic_dijkstra
    </div>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    &nbsp;
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <div style="background-color: inherit;">
        &nbsp;登入容器<span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">&nbsp;</span><font color="#ff0000" style="background-color: inherit;"><span style="text-align: left; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">ssh</span><span style="text-align: left; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">&nbsp;localhost&nbsp;-p&nbsp;2222</span></font>
    </div>

        &nbsp;

</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    [<span style="background-color: inherit;">root@localhost</span>&nbsp;1]#&nbsp;ssh&nbsp;localhost&nbsp;-p&nbsp;2222
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    The&nbsp;authenticity&nbsp;of&nbsp;host&nbsp;&#39;[localhost]:2222&nbsp;([127.0.0.1]:2222)&#39;&nbsp;can&#39;t&nbsp;be&nbsp;established.
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    ECDSA&nbsp;key&nbsp;fingerprint&nbsp;is&nbsp;eb:b7:28:70:32:fb:e0:c9:b0:b5:f4:26:21:a5:49:20.
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    Are&nbsp;you&nbsp;sure&nbsp;you&nbsp;want&nbsp;to&nbsp;continue&nbsp;connecting&nbsp;(yes/no)?&nbsp;yes
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    Warning:&nbsp;Permanently&nbsp;added&nbsp;&#39;[localhost]:2222&#39;&nbsp;(ECDSA)&nbsp;to&nbsp;the&nbsp;list&nbsp;of&nbsp;known&nbsp;hosts.
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <span style="background-color: inherit;">root@localhost</span>&#39;s&nbsp;password:&nbsp;
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    &nbsp;
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    [<span style="background-color: inherit;">root@3e6023ad2ad8</span>&nbsp;~]#
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    如果要停止服务:
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <div style="background-color: inherit;">
        docker&nbsp;ps&nbsp;-all
    </div>

        &nbsp;

</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <div style="background-color: inherit;">
        docker&nbsp;stop&nbsp;c2bc3c58a115
    </div>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    启用
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <span style="line-height: 1.5; background-color: inherit;">docker&nbsp;start&nbsp;c2bc3c58a115</span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    不想用了就
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">docker</span><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);"><span style="background-color: inherit;">&nbsp;</span>rm<span style="background-color: inherit;">&nbsp;</span><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">c2bc3c58a115</span></span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <div style="background-color: inherit;">
        docker&nbsp;ps&nbsp;-all
    </div>

        &nbsp;

</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    在<span style="line-height: 1.5; background-color: inherit;">docker&nbsp;rm &lsquo;</span><span style="line-height: 1.5; background-color: inherit;">CONTAINER&nbsp;ID&rsquo;&nbsp;</span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    就彻底没有了
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    &nbsp;
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    ps:
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    查看<span style="color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">容器的ip &nbsp;</span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <span style="color: rgb(51, 51, 51); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;WenQuanYi Micro Hei&quot;, &quot;Microsoft Yahei&quot;, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);"><span style="text-align: left; color: rgb(0, 0, 0); font-family: 微软雅黑; font-size: 14px; font-style: normal; font-weight: normal; background-color: rgb(255, 255, 255);">#&nbsp;docker&nbsp;ps&nbsp;-all</span></span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    #docker&nbsp;exec&nbsp;<span style="line-height: 1.5; background-color: inherit;">8f439e8e8208</span><span style="line-height: 1.5; background-color: inherit;">&nbsp;ifconfig &nbsp; (</span><span style="line-height: 1.5; background-color: rgb(255, 255, 255);">ifconfig默认没有,我已经安装过</span><span style="line-height: 1.5; background-color: inherit;">)</span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <span style="line-height: 1.5; background-color: inherit;">得到</span>
</div>

<div style="font: 14px/21px 微软雅黑; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-stroke-width: 0px;">
    <div style="background-color: inherit;">
        172.17.0.2
    </div>

        &nbsp;

</div>