五、Docker操作管理

1.应用模板

(1)Concrete5

通过“应用商店”部署Concrete5,修改网页访问端口为9091,通过curl命令访问首页,提交执行结果文本到命令行界面。

# curl http://192.168.200.11:9091/                     

<!DOCTYPE html>

<html lang="en">

<head>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <link rel="stylesheet" type="text/css" href="/concrete/themes/elemental/css/bootstrap-modified.css">

    <link href="/application/files/cache/css/elemental/main.css" rel="stylesheet" type="text/css" media="all">   

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<title>xiandian :: Home</title>

<meta name="description" content="" />

 

<meta name="generator" content="concrete5 - 5.7.5.7" />

<script type="text/javascript">

var CCM_IMAGE_PATH = "/concrete/images";p';

var CCM_TOOLS_PATH = "/index.php/tools/required";

var CCM_APPLICATION_URL = "http://192.168.200.11:9091";

var CCM_REL = "";

</script>

<link href="/concrete/css/font-awesome.css" rel="stylesheet" type="text/css" media="all">

<script type="text/javascript" src="/concrete/js/jquery.js"></script>

<!--[if lt IE 9]><script type="text/javascript" src="/concrete/js/ie/html5-shiv.js"></script><![endif]-->

<!--[if lt IE 9]><script type="text/javascript" src="/concrete/js/ie/respond.js"></script><![endif]-->

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <script>

        if (navigator.userAgent.match(/IEMobile\/10\.0/)) {

            var msViewportStyle = document.createElement('style')

            msViewportStyle.appendChild(

                document.createTextNode(

                    '@-ms-viewport{width:auto!important}'

                )

            )

            document.querySelector('head').appendChild(msViewportStyle)

        }

    </script>

</head>

<body>

 

<div class="ccm-page page-template-full">

 

<header>

    <div class="container">

        <div class="row">

            <div class="col-sm-4 col-xs-6">

                            </div>

            <div class="col-sm-8 col-xs-6">

                            </div>

                    </div>

    </div>

</header>

<main>

</main>

<footer id="footer-theme">

        <section>

    <div class="container">

        <div class="row">

            <div class="col-sm-6">

                        </div>

            <div class="col-sm-3">

                            </div>

            <div class="col-sm-3">

                            </div>

        </div>

    </div>

    </section>

</footer>

<footer id="concrete5-brand">

    <div class="container">

        <div class="row">

            <div class="col-sm-12">

                <span>Built with <a href="http://www.concrete5.org" class="concrete5" rel="nofollow">concrete5</a> CMS.</span>

                <span class="pull-right">

                    <a href="http://192.168.200.11:9091/index.php/login">Log in</a>                </span>

            </div>

        </div>

    </div>

</footer>

</div>

<script type="text/javascript" src="/concrete/js/picturefill.js"></script>

</body>

</html>

通过“应用商店”部署Concrete5,修改网页访问端口为9091,通过links命令访问index.php页面,提交执行结果文本到命令行界面。

# links  http://10.0.6.81:9091/index.php

                  xiandian :: Home

   Built with concrete5 CMS. Log in                                                                                                      

 http://www.concrete5.org/                                                                                                        [------]

(2)Ghost

通过“应用商店”部署Ghost,修改网页访问端口为9092通过curl命令访问首页,提交执行结果文本到命令行界面。

[root@registry 6-4]# curl 192.168.200.11:9092

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Ghost</title>

    <meta name="description" content="Just a blogging platform." />

    <meta name="HandheldFriendly" content="True" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="/favicon.ico">

    <link rel="stylesheet" type="text/css" href="/assets/css/screen.css?v=b820b5418c" />

    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400" />

    <link rel="canonical" href="http://localhost:2368/" />

    <meta name="referrer" content="no-referrer-when-downgrade" />

    <meta property="og:site_name" content="Ghost" />

    <meta property="og:type" content="website" />

    <meta property="og:title" content="Ghost" />

    <meta property="og:description" content="Just a blogging platform." />

    <meta property="og:url" content="http://localhost:2368/" />

    <meta name="twitter:card" content="summary" />

    <meta name="twitter:title" content="Ghost" />

    <meta name="twitter:description" content="Just a blogging platform." />

    <meta name="twitter:url" content="http://localhost:2368/" />

    <script type="application/ld+json">

{

    "@context": "https://schema.org",

    "@type": "Website",

    "publisher": {

        "@type": "Organization",

        "name": "Ghost",

        "logo": "http://localhost:2368/ghost/img/ghosticon.jpg"

    },

    "url": "http://localhost:2368/",

    "mainEntityOfPage": {

        "@type": "WebPage",

        "@id": "http://localhost:2368"

    },

    "description": "Just a blogging platform."

}

    </script>

    <meta name="generator" content="Ghost 0.11" />

    <link rel="alternate" type="application/rss+xml" title="Ghost" href="http://localhost:2368/rss/" />

</head>

<body class="home-template nav-closed">

    <div class="nav">

    <h3 class="nav-title">Menu</h3>

    <a href="#" class="nav-close">

        <span class="hidden">Close</span>

    </a>

    <ul>

            <li class="nav-home nav-current" role="presentation"><a href="http://localhost:2368/">Home</a></li>

    </ul>

        <a class="subscribe-button icon-feed" href="http://localhost:2368/rss/">Subscribe</a>

</div>

<span class="nav-cover"></span>

    <div class="site-wrapper">

<header class="main-header no-cover">

    <nav class="main-nav overlay clearfix">

            <a class="menu-button icon-menu" href="#"><span class="word">Menu</span></a>

    </nav>

    <div class="vertical">

        <div class="main-header-content inner">

            <h1 class="page-title">Ghost</h1>

            <h2 class="page-description">Just a blogging platform.</h2>

        </div>

    </div>

    <a class="scroll-down icon-arrow-left" href="#content" data-offset="-45"><span class="hidden">Scroll Down</span></a>

</header>

<main id="content" class="content" role="main">

    <div class="extra-pagination inner">

    <nav class="pagination" role="navigation">

    <span class="page-number">Page 1 of 1</span>

</nav>

</div>

<article class="post tag-getting-started">

    <header class="post-header">

        <h2 class="post-title"><a href="/welcome-to-ghost/">Welcome to Ghost</a></h2>

    </header>

    <section class="post-excerpt">

        <p>You're live! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. You can manage your content by <a class="read-more" href="/welcome-to-ghost/">&raquo;</a></p>

    </section>

    <footer class="post-meta">

        <a href="/author/ghost-owner/">Ghost Owner</a>

         on <a href="/tag/getting-started/">Getting Started</a>

        <time class="post-date" datetime="2017-03-27">27 March 2017</time>

    </footer>

</article>

<nav class="pagination" role="navigation">

    <span class="page-number">Page 1 of 1</span>

</nav>

</main>

        <footer class="site-footer clearfix">

            <section class="copyright"><a href="http://localhost:2368">Ghost</a> &copy; 2017</section>

            <section class="poweredby">Proudly published with <a href="https://ghost.org">Ghost</a></section>

        </footer>

    </div>

    <script type="text/javascript" src="//code.jquery.com/jquery-1.12.0.min.js"></script>

    <script type="text/javascript" src="/assets/js/jquery.fitvids.js?v=b820b5418c"></script>

    <script type="text/javascript" src="/assets/js/index.js?v=b820b5418c"></script>

</body>

</html>

通过“应用商店”部署Ghost,修改网页访问端口为9092通过links命令访问首页,提交执行结果文本到命令行界面。

# links  http://10.0.6.81:9092

                                                                                                                                    Ghost

   Link: canonical                                                                                                                        

   Link: Ghost (alternate)                                                                                                               

  Menu                                                                                                                                    

   Close                                                                                                                                 

     * Home                                                                                                                               

   Subscribe                                                                                                                             

   Menu                                                                                                                                   

                                                                  Ghost                                                                  

Just a blogging platform.                                                                                                                 

   Scroll Down                                                                                                                           

   Page 1 of 1                                                                                                                           

Welcome to Ghost                                                                                                                          

   You're live! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. You can manage your     

   content by »                                                                                                                           

                                                                                                                                         

   Ghost Owner on Getting Started 27 March 2017 Page 1 of 1 Ghost © 2017 Proudly published with Ghost                                    

                                                                                                                                      

http://localhost:2368/                                                                                                           [------]

(3)Gogs

通过“应用商店”部署Gogs,修改网页访问端口为9093,通过curl命令访问用户列表,提交执行结果文本到命令行界面。

# curl -L http://192.168.200.11:9093/explore/users

<!DOCTYPE html>

<html>

<head data-suburl="">

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>

        <meta name="author" content="Gogs - Go Git Service" />

        <meta name="description" content="Gogs (Go Git Service) is a painless self-hosted Git service written in Go" />

        <meta name="keywords" content="go, git, self-hosted, gogs">

        <meta name="referrer" content="no-referrer" />

        <meta name="_csrf" content="gjGI9K1ebPfrZcfM-qN5RMeGC8s6MTQ5MDU4NTYzODY1NDMyMzU3OA==" />

        <meta name="_suburl" content="" />

        <link rel="shortcut icon" href="/img/favicon.png" />

        <script src="/js/jquery-1.11.3.min.js"></script>

        <script src="/js/libs/jquery.are-you-sure.js"></script>

        <link rel="stylesheet" href="/assets/font-awesome-4.6.3/css/font-awesome.min.css">

        <link rel="stylesheet" href="/assets/octicons-4.3.0/octicons.min.css">

        <link rel="stylesheet" href="/css/semantic-2.2.1.min.css">

        <link rel="stylesheet" href="/css/gogs.css?v=cf2709fbc699c6a4f1b1b5f9b7679c23">

        <script src="/js/semantic-2.2.1.min.js"></script>

        <script src="/js/gogs.js?v=cf2709fbc699c6a4f1b1b5f9b7679c23"></script>

        <title>Explore - XianDian</title>

        <meta name="theme-color" content="#ff5343">

</head>

<body>

        <div class="full height">

                <noscript>Please enable JavaScript in your browser!</noscript>

                        <div class="following bar light">

                                <div class="ui container">

                                        <div class="ui grid">

                                                <div class="column">

                                                        <div class="ui top secondary menu">

                                                                <a class="item brand" href="/">

                                                                        <img class="ui mini image" src="/img/favicon.png">

                                                                </a>

                                                                        <a class="item" href="/">Home</a>

                                                                <a class="item active" href="/explore/repos">Explore</a>

                                                                        <a class="item" target="_blank" href="https://gogs.io/docs" rel="noreferrer">Help</a>

                                                                        <div class="right menu">

                                                                                        <a class="item" href="/user/sign_up">

                                                                                                <i class="octicon octicon-person"></i> Register

                                                                                        </a>

                                                                                <a class="item" href="/user/login?redirect_to=%2fexplore%2fusers">

                                                                                        <i class="octicon octicon-sign-in"></i> Sign In

                                                                                </a>

                                                                        </div>

                                                        </div>

                                                </div>

                                        </div>

                                </div>

                        </div>

<div class="explore users">

        <div class="ui container">

                <div class="ui grid">

                        <div class="four wide column">

        <div class="ui vertical menu navbar">

                <div class="header item">Explore</div>

                <a class=" item" href="/explore/repos">

                        <span class="octicon octicon-repo"></span> Repositories

                </a>

                <a class="active item" href="/explore/users">

                        <span class="octicon octicon-person"></span> Users

                </a>

                <a class=" item" href="/explore/organizations">

                        <span class="octicon octicon-organization"></span> Organizations

                </a>

        </div>

</div>

                        <div class="twelve wide column content">

                                <form class="ui form">

        <div class="ui fluid action input">

          <input name="q" value="" placeholder="Search..." autofocus>

          <button class="ui blue button">Search</button>

        </div>

</form>

<div class="ui divider"></div>

                                <div class="ui user list">

 

                                                <div class="item">

                                                  <img class="ui avatar image" src="https://secure.gravatar.com/avatar/db2990ab0ddd6c9dad38de0cb7e3ed88">

                                                  <div class="content">

                                                        <span class="header"><a href="/xiandian">xiandian</a> </span>

                                                    <div class="description">

                                                                        <i class="octicon octicon-clock"></i> Joined on Mar 27, 2017

                                                    </div>

                                                  </div>

                                                </div>

 

                                </div>

                        </div>

                </div>

        </div>

</div>

 

        </div>

        <footer>

                <div class="ui container">

                        <div class="ui left">

                                © 2016 Gogs Version: 0.9.100.1119 Page: <strong>3ms</strong> Template: <strong>0ms</strong>

                        </div>

                        <a target="_blank" href="https://gogs.io">Website</a>

                                <span class="version">Go1.5.4</span>

                        </div>

                </div>

        </footer>

</body>

<script src="/js/libs/emojify-1.1.0.min.js"></script>

<script src="/js/libs/clipboard-1.5.9.min.js"></script>

</html>

(4)Grafana

通过“应用商店”部署Grafana,修改网页访问端口为9094,通过curl命令访问首页,提交执行结果文本到命令行界面。

# curl  -u admin:password  http://192.168.200.11:9094

<!DOCTYPE html>

<html lang="en">

  <head>

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta name="viewport" content="width=device-width">

    <meta name="theme-color" content="#000">

    <title>Grafana</title>

                <link href='/public/css/fonts.min.css' rel='stylesheet' type='text/css'>

                  <link rel="stylesheet" href="/public/css/grafana.dark.min.350bab2d.css">

    <link rel="icon" type="image/png" href="/public/img/fav32.png">

                <base href="/" />

        </head>

        <body ng-cloak>

                <grafana-app class="grafana-app">

                        <aside class="sidemenu-wrapper">

                                <sidemenu ng-if="contextSrv.sidemenu"></sidemenu>

                        </aside>

                        <div class="page-alert-list">

                                <div ng-repeat='alert in dashAlerts.list' class="alert-{{alert.severity}} alert">

                                        <button type="button" class="alert-close" ng-click="dashAlerts.clear(alert)">

                                                <i class="fa fa-times-circle"></i>

                                        </button>

                                        <div class="alert-title">{{alert.title}}</div>

                                        <div ng-bind='alert.text'></div>

                                </div>

                        </div>

                        <div ng-view class="main-view"></div>

                        <footer class="footer">

                                <div class="row text-center">

                                        <ul>

                                                <li>

                                                        <a href="http://docs.grafana.org" target="_blank">

                                                                <i class="fa fa-file-code-o"></i>

                                                                Docs

                                                        </a>

                                                </li>

                                                <li>

                                                        <a href="https://grafana.net/support/plans" target="_blank">

                                                                <i class="fa fa-support"></i>

                                                                Support Plans

                                                        </a>

                                                </li>

                                                <li>

                                                        <a href="http://grafana.org/community" target="_blank">

                                                                <i class="fa fa-comments-o"></i>

                                                                Community

                                                        </a>

                                                </li>

                                                <li>

                                                        <a href="http://grafana.org" target="_blank">Grafana</a>

                                                        <span>v4.0.0 (commit: v4.0.0)</span>

                                                </li>

                                                        <li>

                                                                <a href="http://grafana.org/download" target="_blank" bs-tooltip="'4.1.1'">

                                                                        New version available!

                                                                </a>

                                                        </li>

                                        </ul>

                                </div>

                        </footer>

                </grafana-app>

        <script>

                window.grafanaBootData = {

                        user:{"isSignedIn":true,"id":1,"login":"admin","email":"admin@localhost","name":"admin","lightTheme":false,"orgId":1,"orgName":"Main Org.","orgRole":"Admin","isGrafanaAdmin":true,"gravatarUrl":"/avatar/46d229b033af06a191ff2267bca9ae56","timezone":"browser","locale":"en-US"},

                        settings: {"allowOrgCreate":true,"appSubUrl":"","authProxyEnabled":false,"buildInfo":{"buildstamp":1480437678,"commit":"v4.0.0","env":"production","hasUpdate":true,"latestVersion":"4.1.1","version":"4.0.0"},"datasources":{"-- Grafana --":{"meta":{"type":"datasource","name":"Grafana","id":"grafana","info":{"author":{"name":"","url":""},"description":"","links":null,"logos":{"small":"public/img/icn-datasource.svg","large":"public/img/icn-datasource.svg"},"screenshots":null,"version":"","updated":""},"dependencies":{"grafanaVersion":"*","plugins":[]},"includes":null,"module":"app/plugins/datasource/grafana/module","baseUrl":"public/app/plugins/datasource/grafana","annotations":true,"metrics":true,"alerting":false,"builtIn":true,"mixed":false,"app":""},"name":"-- Grafana --","type":"grafana"},"-- Mixed --":{"meta":{"type":"datasource","name":"Mixed datasource","id":"mixed","info":{"author":{"name":"","url":""},"description":"","links":null,"logos":{"small":"public/img/icn-datasource.svg","large":"public/img/icn-datasource.svg"},"screenshots":null,"version":"","updated":""},"dependencies":{"grafanaVersion":"*","plugins":[]},"includes":null,"module":"app/plugins/datasource/mixed/module","baseUrl":"public/app/plugins/datasource/mixed","annotations":false,"metrics":true,"alerting":false,"builtIn":true,"mixed":true,"app":""},"type":"mixed"}},"defaultDatasource":"-- Grafana --","panels":{"alertlist":{"baseUrl":"public/app/plugins/panel/alertlist","id":"alertlist","info":{"author":{"name":"Grafana Project","url":"http://grafana.org"},"description":"","links":null,"logos":{"small":"public/app/plugins/panel/alertlist/img/icn-singlestat-panel.svg","large":"public/app/plugins/panel/alertlist/img/icn-singlestat-panel.svg"},"screenshots":null,"version":"","updated":""},"module":"app/plugins/panel/alertlist/module","name":"Alert List","sort":5},"dashlist":{"baseUrl":"public/app/plugins/panel/dashlist","id":"dashlist","info":{"author":{"name":"Grafana Project","url":"http://grafana.org"},"description":"","links":null,"logos":{"small":"public/app/plugins/panel/dashlist/img/icn-dashlist-panel.svg","large":"public/app/plugins/panel/dashlist/img/icn-dashlist-panel.svg"},"screenshots":null,"version":"","updated":""},"module":"app/plugins/panel/dashlist/module","name":"Dashboard list","sort":6},"graph":{"baseUrl":"public/app/plugins/panel/graph","id":"graph","info":{"author":{"name":"Grafana Project","url":"http://grafana.org"},"description":"","links":null,"logos":{"small":"public/app/plugins/panel/graph/img/icn-graph-panel.svg","large":"public/app/plugins/panel/graph/img/icn-graph-panel.svg"},"screenshots":null,"version":"","updated":""},"module":"app/plugins/panel/graph/module","name":"Graph","sort":1},"pluginlist":{"baseUrl":"public/app/plugins/panel/pluginlist","id":"pluginlist","info":{"author":{"name":"Grafana Project","url":"http://grafana.org"},"description":"","links":null,"logos":{"small":"public/app/plugins/panel/pluginlist/img/icn-dashlist-panel.svg","large":"public/app/plugins/panel/pluginlist/img/icn-dashlist-panel.svg"},"screenshots":null,"version":"","updated":""},"module":"app/plugins/panel/pluginlist/module","name":"Plugin list","sort":100},"singlestat":{"baseUrl":"public/app/plugins/panel/singlestat","id":"singlestat","info":{"author":{"name":"Grafana Project","url":"http://grafana.org"},"description":"","links":null,"logos":{"small":"public/app/plugins/panel/singlestat/img/icn-singlestat-panel.svg","large":"public/app/plugins/panel/singlestat/img/icn-singlestat-panel.svg"},"screenshots":null,"version":"","updated":""},"module":"app/plugins/panel/singlestat/module","name":"Singlestat","sort":2},"table":{"baseUrl":"public/app/plugins/panel/table","id":"table","info":{"author":{"name":"Grafana Project","url":"http://grafana.org"},"description":"","links":null,"logos":{"small":"public/app/plugins/panel/table/img/icn-table-panel.svg","large":"public/app/plugins/panel/table/img/icn-table-panel.svg"},"screenshots":null,"version":"","updated":""},"module":"app/plugins/panel/table/module","name":"Table","sort":3},"text":{"baseUrl":"public/app/plugins/panel/text","id":"text","info":{"author":{"name":"Grafana Project","url":"http://grafana.org"},"description":"","links":null,"logos":{"small":"public/app/plugins/panel/text/img/icn-text-panel.svg","large":"public/app/plugins/panel/text/img/icn-text-panel.svg"},"screenshots":null,"version":"","updated":""},"module":"app/plugins/panel/text/module","name":"Text","sort":4}}},

                        mainNavLinks: [{"text":"Dashboards","icon":"icon-gf icon-gf-dashboard","url":"/","children":[{"text":"Home","url":"/"},{"text":"Playlists","url":"/playlists"},{"text":"Snapshots","url":"/dashboard/snapshots"},{"divider":true},{"text":"New","icon":"fa fa-plus","url":"/dashboard/new"},{"text":"Import","icon":"fa fa-download","url":"/dashboard/new/?editview=import"}]},{"text":"Alerting","icon":"icon-gf icon-gf-alert","url":"/alerting/list","children":[{"text":"Alert List","url":"/alerting/list"},{"text":"Notifications","url":"/alerting/notifications"}]},{"text":"Data Sources","icon":"icon-gf icon-gf-datasources","url":"/datasources"},{"text":"Plugins","icon":"icon-gf icon-gf-apps","url":"/plugins"},{"text":"Admin","icon":"fa fa-fw fa-cogs","url":"/admin","children":[{"text":"Global Users","url":"/admin/users"},{"text":"Global Orgs","url":"/admin/orgs"},{"text":"Server Settings","url":"/admin/settings"},{"text":"Server Stats","url":"/admin/stats"}]}]

                };

        </script>

        <script src="/public/app/boot.fdf40765.js"></script>

       </body>

</html>

通过“应用商店”部署Grafana,修改网页访问端口为9094,通过links命令访问首页,提交执行结果文本到命令行界面。

# links  http://10.0.6.81:9094

                                                                                                                                  Grafana

   {{alert.title}}                                                                                                                        

                                                                                                                                         

     * Docs                                                                                                                              

     * Support Plans                                                                                                                      

     * Community                                                                                                                         

     * Grafana v4.0.0 (commit: v4.0.0)                                                                                                    

     * New version available!                                                                                                             

(5)Jenkis

通过“应用商店”部署Jenkis,修改网页访问端口为9095,创建一个名为xiandian的job,通过curl命令访问这个项目的首页,提交执行结果文本到命令行界面。

# curl http://192.168.200.11:9095/job/xiandian/

<!DOCTYPE html><html><head resURL="/static/14564e51">

<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Jenkins" /><meta name="ROBOTS" content="INDEX,NOFOLLOW" /><link rel="alternate" href="rssAll" title="Jenkins:xiandian (all builds)" type="application/rss+xml" /><link rel="alternate" href="rssAll?flavor=rss20" title="Jenkins:xiandian (all builds) (RSS 2.0)" type="application/rss+xml" /><link rel="alternate" href="rssFailed" title="Jenkins:xiandian (failed builds)" type="application/rss+xml" /><link rel="alternate" href="rssFailed?flavor=rss20" title="Jenkins:xiandian (failed builds) (RSS 2.0)" type="application/rss+xml" /><link rel="alternate" href="rssChangelog" title="Jenkins:xiandian (changelog)" type="application/rss+xml" /><link rel="alternate" href="rssChangelog?flavor=rss20" title="Jenkins:xiandian (changelog) (RSS 2.0)" type="application/rss+xml" /><script src="/static/14564e51/scripts/yui/cookie/cookie-min.js"></script></head><body data-model-type="hudson.model.FreeStyleProject" id="jenkins" class="yui-skin-sam jenkins-1.651.3" data-version="jenkins-1.651.3"><a href="#skip2content" class="skiplink">Skip to content</a><div id="page-head"><div id="header"><div class="logo"><a id="jenkins-home-link" href="/"><img src="/static/14564e51/images/headshot.png" alt="title" id="jenkins-head-icon" /><img src="/static/14564e51/images/title.png" alt="title" width="139" id="jenkins-name-icon" height="34" /></a></div><div class="login"></div><div class="searchbox hidden-xs"><form method="get" name="search" action="/job/xiandian/search/" style="position:relative;" class="no-json"><div id="search-box-minWidth"></div><div id="search-box-sizer"></div><div id="searchform"><input name="q" placeholder="search" id="search-box" class="has-default-text" /> <a href="http://wiki.jenkins-ci.org/display/JENKINS/Search+Box"><img src="/static/14564e51/images/16x16/help.png" style="width: 16px; height: 16px; " class="icon-help icon-sm" /></a><div id="search-box-completion"></div><script>createSearchBox("/job/xiandian/search/");</script></div></form></div></div><div id="breadcrumbBar"><tr id="top-nav"><td id="left-top-nav" colspan="2"><link rel='stylesheet' href='/adjuncts/14564e51/lib/layout/breadcrumbs.css' type='text/css' /><script src='/adjuncts/14564e51/lib/layout/breadcrumbs.js' type='text/javascript'></script><div class="top-sticker noedge"><div class="top-sticker-inner"><div id="right-top-nav"><div id="right-top-nav"><div class="smallfont"><a href="?auto_refresh=true">ENABLE AUTO REFRESH</a></div></div></div><ul id="breadcrumbs"><li class="item"><a href="/" class="model-link inside">Jenkins</a></li><li href="/" class="children"></li><li class="item"><a href="/job/xiandian/" class="model-link inside">xiandian</a></li><li href="/job/xiandian/" class="children"></li></ul><div id="breadcrumb-menu-target"></div></div></div></td></tr></div></div><div id="page-body" class="clear"><div id="side-panel"><div id="tasks"><div class="task"><a href="/" class="task-icon-link"><img src="/static/14564e51/images/24x24/up.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-up icon-md" /></a> <a href="/" class="task-link">Back to Dashboard</a></div><div class="task"><a href="/job/xiandian/" class="task-icon-link"><img src="/static/14564e51/images/24x24/search.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-search icon-md" /></a> <a href="/job/xiandian/" class="task-link"><b>Status</b></a><div class="subtasks"></div></div><div class="task"><a href="/job/xiandian/changes" class="task-icon-link"><img src="/static/14564e51/images/24x24/notepad.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-notepad icon-md" /></a> <a href="/job/xiandian/changes" class="task-link">Changes</a></div><div class="task"><a href="/job/xiandian/ws/" class="task-icon-link"><img src="/static/14564e51/images/24x24/folder.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-folder icon-md" /></a> <a href="/job/xiandian/ws/" class="task-link">Workspace</a></div><div class="task"><a οnclick="return build_id361(this)" href="/job/xiandian/build?delay=0sec" class="task-icon-link"><img src="/static/14564e51/images/24x24/clock.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-clock icon-md" /></a> <a οnclick="return build_id361(this)" href="/job/xiandian/build?delay=0sec" class="task-link">Build Now</a></div>

<div class="task"><a οnclick="confirmPOST_id364(true, '/job/xiandian/doDelete', 'Are you sure about deleting the Project ‘xiandian’?')" href="#" class="task-icon-link"><img src="/static/14564e51/images/24x24/edit-delete.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-edit-delete icon-md" /></a>

<a οnclick="confirmPOST_id365(true, '/job/xiandian/doDelete', 'Are you sure about deleting the Project ‘xiandian’?')" href="#" class="task-link">Delete Project</a><script>function confirmPOST_id365(post, href, message) {

            if (confirm(message)) {

                var form = document.createElement('form');

                form.setAttribute('method', post ? 'POST' : 'GET');

                form.setAttribute('action', href);

                if (post) {

                    crumb.appendToForm(form);

                }

                document.body.appendChild(form);

                form.submit();

            }

            return false;

        }</script></div><div class="task"><a href="/job/xiandian/configure" class="task-icon-link"><img src="/static/14564e51/images/24x24/setting.png" style="width: 24px; height: 24px; width: 24px; height: 24px; margin: 2px;" class="icon-setting icon-md" /></a> <a href="/job/xiandian/configure" class="task-link">Configure</a></div></div><div page-has-up="false" page-has-down="false" id="buildHistoryPage" page-entry-newest="-9223372036854775808" page-entry-oldest="9223372036854775807"><div id="buildHistoryPageNav"><div class="nav pageOne" title="Page 1 (Newest/Latest Builds)"></div><div class="nav pageUp" title="Newer Builds"></div><div class="nav pageDown" title="Older Builds "></div></div><div id="buildHistory" class="container-fluid pane-frame track-mouse expanded"><div class="row"><div class="col-xs-24 pane-header"><a href="/toggleCollapse?paneId=buildHistory" title="collapse" class="collapse"><img src="/static/14564e51/images/16x16/collapse.png" alt="collapse" style="width: 16px; height: 16px; " class="icon-collapse icon-sm" /></a><div style="float:right"><a href="/job/xiandian/buildTimeTrend">trend</a></div><div data="100" class="healthReport" οnmοuseοver="this.className='healthReport hover';return true;

        " οnmοuseοut="this.className='healthReport';return true;"><img src="/static/14564e51/images/16x16/health-80plus.png" alt="100%" style="width: 16px; height: 16px; " class="icon-health-80plus icon-sm"/></div>Build History</div></div><div class="row pane-content"><table class="pane stripped"><tr class="build-search-row"><td><table><tr><td><span title="Clear" class="clear">x</span><input placeholder="find" /></td></tr></table></td></tr><tr class="build-row"><td colspan="3" align="right"><script>

            function replace(a, b) {

                  var p = a.parentNode;

                  var next = a.nextSibling;

                  p.removeChild(a);

                  p.insertBefore(b,next);

            }

            function loadAllBuildHistory() {

              // first display the "loading..." icon

              var box = $("loadAllBuildHistory");

              box.innerHTML = '<img src="/static/14564e51/images/spinner.gif" alt="" />';

              // then actually fetch the HTML

              new Ajax.Request("/job/xiandian/buildHistory/all",{

                method: "get",

                onComplete: function(rsp,_) {

                 

                  var hist = $("buildHistory");

                  var newhist = document.createElement('div');

                  newhist.innerHTML = rsp.responseText;

                  newhist.headers = hist.headers

                  replace(hist, newhist);

                  fireBuildHistoryChanged();

                }

            });

            }

          </script></td></tr></table></div><div class="row"><div class="col-xs-24 pane-footer"><span class="build-rss-links"><a href="/job/xiandian/rssAll" class="build-rss-all-icon"><img border="0" src="/static/14564e51/images/atom.gif" alt="Feed" width="16" height="16"/></a> <a href="/job/xiandian/rssAll" class="build-rss-all-link">RSS for all</a> <a href="/job/xiandian/rssFailed" class="build-rss-failed-icon"><img border="0" src="/static/14564e51/images/atom.gif" alt="Feed" width="16" height="16"/></a> <a href="/job/xiandian/rssFailed" class="build-rss-failed-link">RSS for failures</a></span></div></div></div></div><script defer="true">updateBuildHistory("/job/xiandian/buildHistory/ajax",1);</script></div><div id="main-panel"><a name="skip2content"></a><h1 class="job-index-headline page-headline">Project xiandian</h1><div id="description"><div>xiandian</div><div align="right"><a οnclick="return replaceDescription();" id="description-link" href="editDescription"><img src="/static/14564e51/images/16x16/notepad.png" style="width: 16px; height: 16px; " class="icon-notepad icon-sm" />edit description</a></div></div><div align="right"><form method="post" id="disable-project" action="disable"><input name="Submit" type="submit" value="Disable Project" class="submit-button primary" /></form></div><div style="float:right"></div><table style="margin-top: 1em; margin-left:1em;"><tr><td><a href="ws/"><img src="/static/14564e51/images/48x48/folder.png" style="width: 48px; height: 48px; " class="icon-folder icon-xlg" /></a></td><td style="vertical-align:middle"><a href="ws/">Workspace</a></td></tr><tr><td><a href="changes"><img src="/static/14564e51/images/48x48/notepad.png" style="width: 48px; height: 48px; " class="icon-notepad icon-xlg" /></a></td><td style="vertical-align:middle"><a href="changes">Recent Changes</a></td></tr></table><h2 class="permalinks-header">Permalinks</h2><ul class="permalinks-list"></ul></div></div><footer><div class="container-fluid"><div class="row"><div class="col-md-6" id="footer"></div><div class="col-md-18"><span class="page_generated">Page generated: Mar 28, 2017 7:55:17 AM UTC</span><span class="rest_api"><a href="api/">REST API</a></span><span class="jenkins_ver"><a href="http://jenkins-ci.org/">Jenkins ver. 1.651.3</a></span><div id="l10n-dialog" class="dialog"></div><div id="l10n-footer" style="display:none; float:left"><a href="#" οnclick="return showTranslationDialog();"><img src="/static/14564e51/plugin/translation/flags.png" />

      Help us localize this page

    </a></div><script>var footer = document.getElementById('l10n-footer');

    var f = document.getElementById('footer');

    f.insertBefore(footer,f.firstChild);

    footer.style.display="block";

    var translation={};

    translation.bundles = "3h5r+zi+abDcRQLe3KcLELvZMup6fQ5cjBKB92yya3sy4c5yJehpXtaDapqbIV2y1hzQKIVTZiu1kEAIJPJT9J/WFtWObHTOOlNrseD9pLY/UzjN6Sk0t63Vl4TMyt8c9d8MNanSICu6gCclYrV8SlEU4bIiVKPS4hBVomzvIUEcN9aRtQoTW1147xAm8rqrWZ/NQu+LqUauB0mlHevPNrCJ3hMrQHvFCKmqCECG5gcv1Z3SkgQhe4pcEAF3/QZ3P5EcoV7Tgxr3J3WSI6KKbQlH1Kk4aqkYiW7aKpdJHnVwI/ap2XolqmkIOyzvZpBBPX0siuJeHQvr/YF19gfSFFAO2JHfdLa7vPhV/CM+pKWGgjgVweMJx2IWP/BDB7QgiWshoSScfzP9SycrwaVhG2L2VPtlccs+NAMzlHlsOx+pqloNWhs7a4jzi/CkiSwKzuR3lvtxyODoZcBOJPVHi21KVnq0jeA/2uhZ6lHqv++ECPKtfuoGm4GoXRF4aM6I1OGeep7aGuiUhoSjcJHoggg+9f/ilqo60Kt0ax4HPO3GQGMczVXYg3arULHaWOZTgOHrtDUjcNrAhm9ZRSEFtRoiNmAjcx92su/KeUcTrD6zUn6Xtatyj9ch6rqlLHGOww/Z2b7P9U3ExVrh3DPHSYlSBsUeb8cWbcRVbhJ7fsp6wz3l7/Sqbyiup+jvWSaemGpQsI3xmeTjcgqgOjf2Eg==";

    translation.detectedLocale = "";

    function showTranslationDialog() {

      if(!translation.launchDialog)

        loadScript("/static/14564e51/plugin/translation/dialog.js");

      else

        translation.launchDialog();

      return false;

    }</script></div></div></div></footer></body></html>

通过“应用商店”部署Jenkis,修改网页访问端口为9095,创建一个名为xiandian的job,通过links命令访问这个项目的首页,提交执行结果文本到命令行界面。

# links  http://10.0.6.81:9095/job/xiandian/

                                                                                                                 xiandian [Jenkins] (2/2)

   trend                                                                                                                                  

   100%Build History                                                                                                                      

   x _____________________                                                                                                               

   Feed RSS for all Feed RSS for failures                                                                                                 

                                                             Project xiandian                                                            

   xiandian                                                                                                                               

                                                                                                                  [IMG]edit description  

                                                                                                                    [ Disable Project ]  

   [IMG] Workspace                                                                                                                        

   [IMG] Recent Changes                                                                                                                  

Permalinks                                                                                                                                

   Page generated: Mar 30, 2017 5:47:12 AM UTCREST APIJenkins ver. 1.651.3                                                               

   [IMG] Help us localize this page                                                                                                       

(6)Owncloud

通过“应用商店”部署Owncloud,修改网页访问端口为9096,通过curl命令访问首页,提交执行结果文本到命令行界面。

# curl  -L  http://192.168.200.11:9096

<!DOCTYPE html>

<html class="ng-csp" data-placeholder-focus="false" lang="en" >

        <head data-requesttoken="LDEdBm5HIzQrDzJYCjgCJyIvCj8OZ18bAGpvLyAkBBc=:IIXP92SqllQorRHCLbHPXW6Bo26UUFMpdBllQn/+iYE=">

                <meta charset="utf-8">

                <title>

                ownCloud                </title>

                <meta http-equiv="X-UA-Compatible" content="IE=edge">

                <meta name="referrer" content="never">

                <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">

                <meta name="apple-itunes-app" content="app-id=543672169">

                <meta name="theme-color" content="#1d2d44">

                <link rel="icon" href="/core/img/favicon.ico">

        <div id="nojavascript">

                <div>

                        This application requires JavaScript for correct operation. Please <a href="http://enable-javascript.com/" target="_blank" rel="noreferrer">enable JavaScript</a> and reload the page.   </div>

        </div>

</noscript>

                <div class="wrapper">

                        <div class="v-align">

                                                                        <header role="banner">

                                                <div id="header">

                                                        <div class="logo svg">

                                                                <h1 class="hidden-visually">

                                                                        ownCloud                                                                </h1>

                                                        </div>

                                                        <div id="logo-claim" style="display:none;"></div>

                                                </div>

                                        </header>

<!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->

<form method="post" name="login">

        <fieldset>

                                                                        <div id="message" class="hidden">

                        <img class="float-spinner" alt=""

                                src="/core/img/loading-dark.gif">

                        <span id="messageText"></span>

                        <!-- the following div ensures that the spinner is always inside the #message div -->

                        <div style="clear: both;"></div>

                </div>

                <p class="grouptop">

                        <input type="text" name="user" id="user"

                                placeholder="Username or email"

                                value=""

                                autofocus                               autocomplete="on" autocapitalize="off" autocorrect="off" required>

                        <label for="user" class="infield">Username or email</label>

                </p>

                <p class="groupbottom">

                        <input type="password" name="password" id="password" value=""

                                placeholder="Password"

                                                                autocomplete="on" autocapitalize="off" autocorrect="off" required>

                        <label for="password" class="infield">Password</label>

                        <input type="submit" id="submit" class="login primary icon-confirm svg" title="Log in" value="" disabled="disabled"/>

                </p>

 

                                                <div class="remember-login-container">

                                                <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white">

                                                <label for="remember_login">Stay logged in</label>

                </div>

                                <input type="hidden" name="timezone-offset" id="timezone-offset"/>

                <input type="hidden" name="timezone" id="timezone"/>

                <input type="hidden" name="requesttoken" value="LDEdBm5HIzQrDzJYCjgCJyIvCj8OZ18bAGpvLyAkBBc=:IIXP92SqllQorRHCLbHPXW6Bo26UUFMpdBllQn/+iYE=">

        </fieldset>

</form>

                                <div class="push"></div><!-- for sticky footer -->

                        </div>

                </div>

                <footer role="contentinfo">

                        <p class="info">

                                <a href="https://owncloud.org" target="_blank" rel="noreferrer">ownCloud</a> – web services under your control                  </p>

                </footer>

        </body>

</html>

(7)RocketChat

通过“应用商店”部署RocketChat,修改网页访问端口为9097,通过inspect命令查看该服务的配置信息,提交执行结果文本到命令行界面。

# docker inspect 4c55d007c682      

[

    {

        "Id": "4c55d007c682d148464dd8eb058b675bb69c03e6321e1a2055b180c9c94df17a",

        "Created": "2017-03-27T05:39:03.375787951Z",

        "Path": "node",

        "Args": [

            "main.js"

        ],

        "State": {

            "Status": "running",

            "Running": true,

            "Paused": false,

            "Restarting": false,

            "OOMKilled": false,

            "Dead": false,

            "Pid": 21746,

            "ExitCode": 0,

            "Error": "",

            "StartedAt": "2017-03-27T05:39:07.529597908Z",

            "FinishedAt": "0001-01-01T00:00:00Z"

        },

        "Image": "sha256:786192493b9636f621b8b833cbdacbd0926a70a8ebf8fdebc593a772dd1d0015",

        "ResolvConfPath": "/var/lib/docker/containers/4c55d007c682d148464dd8eb058b675bb69c03e6321e1a2055b180c9c94df17a/resolv.conf",

        "HostnamePath": "/var/lib/docker/containers/4c55d007c682d148464dd8eb058b675bb69c03e6321e1a2055b180c9c94df17a/hostname",

        "HostsPath": "/var/lib/docker/containers/4c55d007c682d148464dd8eb058b675bb69c03e6321e1a2055b180c9c94df17a/hosts",

        "LogPath": "",

        "Name": "/963581eb-74cd-4a2a-91ca-e3afbdc884fa",

        "RestartCount": 0,

        "Driver": "devicemapper",

        "MountLabel": "",

        "ProcessLabel": "",

        "AppArmorProfile": "",

        "ExecIDs": null,

        "HostConfig": {

            "Binds": null,

            "ContainerIDFile": "",

            "LogConfig": {

                "Type": "journald",

                "Config": {}

            },

            "NetworkMode": "default",

            "PortBindings": {

                "3000/tcp": [

                    {

                        "HostIp": "",

                        "HostPort": "3000"

                    }

                ]

            },

            "RestartPolicy": {

                "Name": "",

                "MaximumRetryCount": 0

            },

            "VolumeDriver": "",

            "VolumesFrom": null,

            "CapAdd": null,

            "CapDrop": null,

            "Dns": [

                "169.254.169.250"

            ],

            "DnsOptions": null,

            "DnsSearch": [

                "openstacklocal",

                "rocket-chat.rancher.internal",

                "rocketchat.rocket-chat.rancher.internal",

                "rancher.internal"

            ],

            "ExtraHosts": null,

            "GroupAdd": null,

            "IpcMode": "",

            "Links": null,

            "OomScoreAdj": 0,

            "PidMode": "",

            "Privileged": false,

            "PublishAllPorts": false,

            "ReadonlyRootfs": false,

            "SecurityOpt": null,

            "UTSMode": "",

            "ShmSize": 67108864,

            "ConsoleSize": [

                0,

                0

            ],

            "Isolation": "",

            "CpuShares": 0,

            "CgroupParent": "",

            "BlkioWeight": 0,

            "BlkioWeightDevice": null,

            "BlkioDeviceReadBps": null,

            "BlkioDeviceWriteBps": null,

            "BlkioDeviceReadIOps": null,

            "BlkioDeviceWriteIOps": null,

            "CpuPeriod": 0,

            "CpuQuota": 0,

            "CpusetCpus": "",

            "CpusetMems": "",

            "Devices": null,

            "KernelMemory": 0,

            "Memory": 0,

            "MemoryReservation": 0,

            "MemorySwap": 0,

            "MemorySwappiness": -1,

            "OomKillDisable": false,

            "PidsLimit": 0,

            "Ulimits": null

        },

        "GraphDriver": {

            "Name": "devicemapper",

            "Data": {

                "DeviceId": "297",

                "DeviceName": "docker-253:1-335544513-425c8a0755ee9d0b0543ca613cfa2d13a921383aa15bf5867d6437e4cede3586",

                "DeviceSize": "10737418240"

            }

        },

        "Mounts": [

            {

                "Name": "e27625cd53341f3f4afdc6e713f0e93483b32481e3865017454a0416324ed870",

                "Source": "/var/lib/docker/volumes/e27625cd53341f3f4afdc6e713f0e93483b32481e3865017454a0416324ed870/_data",

                "Destination": "/app/uploads",

                "Driver": "local",

                "Mode": "",

                "RW": true,

                "Propagation": ""

            }

        ],

        "Config": {

            "Hostname": "4c55d007c682",

            "Domainname": "",

            "User": "rocketchat",

            "AttachStdin": false,

            "AttachStdout": false,

            "AttachStderr": false,

            "ExposedPorts": {

                "3000/tcp": {}

            },

            "Tty": false,

            "OpenStdin": false,

            "StdinOnce": false,

            "Env": [

                "MONGO_PORT=tcp://mongo:27017",

                "ROCKET_CHAT_MONGO_1_PORT=tcp://mongo:27017",

                "MONGO_1_PORT_27017_TCP_PORT=27017",

                "MONGO_ENV_MONGO_MAJOR=3.4",

                "MONGO_ENV_MONGO_PACKAGE=mongodb-org",

                "ROCKET_CHAT_MONGO_1_ENV_GOSU_VERSION=1.7",

                "MONGO_PORT_27017_TCP=tcp://mongo:27017",

                "MONGO_PORT_27017_TCP_ADDR=mongo",

                "ROCKET_CHAT_MONGO_1_PORT_27017_TCP_PORT=27017",

                "ROCKET_CHAT_MONGO_1_NAME=/cattle/rocket-chat_mongo_1",

                "MONGO_ENV_GOSU_VERSION=1.7",

                "PORT=3000",

                "MONGO_1_PORT_27017_TCP=tcp://mongo:27017",

                "MONGO_PORT_27017_TCP_PORT=27017",

                "ROCKET_CHAT_MONGO_1_PORT_27017_TCP_PROTO=tcp",

                "ROCKET_CHAT_MONGO_1_ENV_MONGO_MAJOR=3.4",

                "ROOT_URL=http://yourhost:3000",

                "ROCKET_CHAT_MONGO_1_ENV_MONGO_VERSION=3.4.0",

                "MONGO_ENV_MONGO_VERSION=3.4.0",

                "ROCKET_CHAT_MONGO_1_ENV_MONGO_PACKAGE=mongodb-org",

                "MONGO_1_NAME=/cattle/mongo_1",

                "MONGO_1_ENV_MONGO_VERSION=3.4.0",

                "ROCKET_CHAT_MONGO_1_PORT_27017_TCP=tcp://mongo:27017",

                "MONGO_PORT_27017_TCP_PROTO=tcp",

                "MONGO_1_ENV_MONGO_PACKAGE=mongodb-org",

                "MONGO_1_PORT=tcp://mongo:27017",

                "MONGO_1_PORT_27017_TCP_ADDR=mongo",

                "MONGO_1_PORT_27017_TCP_PROTO=tcp",

                "MONGO_1_ENV_MONGO_MAJOR=3.4",

                "MONGO_NAME=/cattle/mongo",

                "ROCKET_CHAT_MONGO_1_PORT_27017_TCP_ADDR=mongo",

                "MONGO_URL=mongodb://mongo:27017/rocketchat",

                "MONGO_1_ENV_GOSU_VERSION=1.7",

                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",

                "NODE_VERSION=4.6.2",

                "NODE_ENV=production",

                "RC_VERSION=latest",

                "HOME=/tmp",

                "Accounts_AvatarStorePath=/app/uploads"

            ],

            "Cmd": [

                "node",

                "main.js"

            ],

            "Image": "rocketchat/rocket.chat:latest",

            "Volumes": {

                "/app/uploads": {}

            },

            "WorkingDir": "/app/bundle",

            "Entrypoint": null,

            "MacAddress": "02:99:77:08:ab:71",

            "OnBuild": null,

            "Labels": {

                "io.rancher.container.ip": "10.42.206.204/16",

                "io.rancher.container.name": "rocket-chat_rocketchat_1",

                "io.rancher.container.uuid": "963581eb-74cd-4a2a-91ca-e3afbdc884fa",

                "io.rancher.project.name": "rocket-chat",

                "io.rancher.project_service.name": "rocket-chat/rocketchat",

                "io.rancher.service.deployment.unit": "4768a84b-6987-47dc-99fa-a7aa75cc79fa",

                "io.rancher.service.hash": "8977397abec00b351475ed4482806bcd88169263",

                "io.rancher.service.launch.config": "io.rancher.service.primary.launch.config",

                "io.rancher.stack.name": "rocket-chat",

                "io.rancher.stack_service.name": "rocket-chat/rocketchat"

            }

        },

        "NetworkSettings": {

            "Bridge": "",

            "SandboxID": "de88d7e2d9ea62c9fb4107dddf88f051e50e32f471ebdf4c2d153c5e76737f52",

            "HairpinMode": false,

            "LinkLocalIPv6Address": "",

            "LinkLocalIPv6PrefixLen": 0,

            "Ports": {

                "3000/tcp": [

                    {

                        "HostIp": "0.0.0.0",

                        "HostPort": "3000"

                    }

                ]

            },

            "SandboxKey": "/var/run/docker/netns/de88d7e2d9ea",

            "SecondaryIPAddresses": null,

            "SecondaryIPv6Addresses": null,

            "EndpointID": "319d689aaefd09f4b46ff808738e94b2bf03b56ee9b0e22d803a6d64afe86617",

            "Gateway": "172.17.0.1",

            "GlobalIPv6Address": "",

            "GlobalIPv6PrefixLen": 0,

            "IPAddress": "172.17.0.17",

            "IPPrefixLen": 16,

            "IPv6Gateway": "",

            "MacAddress": "02:99:77:08:ab:71",

            "Networks": {

                "bridge": {

                    "IPAMConfig": null,

                    "Links": null,

                    "Aliases": null,

                    "NetworkID": "706c806378aa62e5535ae7da77d35e5b06ec8ed1d72e1e0297656db041ead85a",

                    "EndpointID": "319d689aaefd09f4b46ff808738e94b2bf03b56ee9b0e22d803a6d64afe86617",

                    "Gateway": "172.17.0.1",

                    "IPAddress": "172.17.0.17",

                    "IPPrefixLen": 16,

                    "IPv6Gateway": "",

                    "GlobalIPv6Address": "",

                    "GlobalIPv6PrefixLen": 0,

                    "MacAddress": "02:99:77:08:ab:71"

                }

            }

        }

    }

]

(8)Wordpress

通过“应用商店”部署Wordpress,修改网页访问端口为9098,通过curl命令访问首页,提交执行结果文本到命令行界面。

# curl  -U admin:000000 http://192.168.200.11:9098/

<!DOCTYPE html>

<html lang="zh-CN" class="no-js">

<head>

        <meta charset="UTF-8">

        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="profile" href="http://gmpg.org/xfn/11">

                <script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>

<title>XianDian &#8211; 又一个WordPress站点</title>

<link rel='dns-prefetch' href='//fonts.googleapis.com' />

<link rel='dns-prefetch' href='//s.w.org' />

<link rel="alternate" type="application/rss+xml" title="XianDian &raquo; Feed" href="http://192.168.200.11:9098/feed/" />

<link rel="alternate" type="application/rss+xml" title="XianDian &raquo; 评论Feed" href="http://192.168.200.11:9098/comments/feed/" />

 <meta name="generator" content="WordPress 4.6.4" />

                <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>

                </head>

<body class="home blog hfeed">

<div id="page" class="site">

        <div class="site-inner">

                <a class="skip-link screen-reader-text" href="#content">Skip to content</a>

                <header id="masthead" class="site-header" role="banner">

                        <div class="site-header-main">

                                <div class="site-branding">

         <h1 class="site-title"><a href="http://192.168.200.11:9098/" rel="home">XianDian</a></h1>

                                                              <p class="site-description">又一个WordPress站点</p>

                                                                        </div><!-- .site-branding -->

                                                        </div><!-- .site-header-main -->

                                        </header><!-- .site-header -->

                <div id="content" class="site-content">

        <div id="primary" class="content-area">

                <main id="main" class="site-main" role="main">

<article id="post-1" class="post-1 post type-post status-publish format-standard hentry category-uncategorized">

       <header class="entry-header">

                <h2 class="entry-title"><a href="http://192.168.200.11:9098/2017/03/27/hello-world/" rel="bookmark">世界,您好!</a></h2>    </header><!-- .entry-header -->

        <div class="entry-content">

                <p>欢迎使用WordPress。这是您的第一篇文章。编辑或删除它,然后开始写作吧!</p>

        </div><!-- .entry-content -->

        <footer class="entry-footer">

                <span class="byline"><span class="author vcard"><img alt='' src='http://2.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=49&#038;d=mm&#038;r=g' srcset='http://2.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=98&amp;d=mm&amp;r=g 2x' class='avatar avatar-49 photo' height='49' width='49' /><span class="screen-reader-text">Author </span> <a class="url fn n" href="http://192.168.200.11:9098/author/admin/">admin</a></span></span><span class="posted-on"><span class="screen-reader-text">Posted on </span><a href="http://192.168.200.11:9098/2017/03/27/hello-world/" rel="bookmark"><time class="entry-date published updated" datetime="2017-03-27T13:47:48+00:00">2017年3月27日</time></a></span><span class="comments-link"><a href="http://192.168.200.11:9098/2017/03/27/hello-world/#comments"><span class="screen-reader-text">世界,您好!</span>有1条评论</a></span>                     </footer><!-- .entry-footer -->

</article><!-- #post-## -->

                </main><!-- .site-main -->

        </div><!-- .content-area -->

        <aside id="secondary" class="sidebar widget-area" role="complementary">

                <section id="search-2" class="widget widget_search">

<form role="search" method="get" class="search-form" action="http://192.168.200.11:9098/">

        <label>

                <span class="screen-reader-text">Search for:</span>

                <input type="search" class="search-field" placeholder="Search &hellip;" value="" name="s" />

        </label>

        <button type="submit" class="search-submit"><span class="screen-reader-text">Search</span></button>

</form>

</section>              <section id="recent-posts-2" class="widget widget_recent_entries">              <h2 class="widget-title">近期文章</h2>          <ul>

                                        <li>

                                <a href="http://192.168.200.11:9098/2017/03/27/hello-world/">世界,您好!</a>

                                                </li>

                                </ul>

                </section>              <section id="recent-comments-2" class="widget widget_recent_comments"><h2 class="widget-title">近期评论</h2><ul id="recentcomments"><li class="recentcomments"><span class="comment-author-link"><a href='https://wordpress.org/' rel='external nofollow' class='url'>A WordPress Commenter</a></span>发表在《<a href="http://192.168.200.11:9098/2017/03/27/hello-world/#comment-1">世界,您好!</a>》</li></ul></section><section id="archives-2" class="widget widget_archive"><h2 class="widget-title">文章归档</h2>         <ul>

                        <li><a href='http://192.168.200.11:9098/2017/03/'>2017年三月</a></li>

                </ul>

                </section><section id="categories-2" class="widget widget_categories"><h2 class="widget-title">分类目录</h2>            <ul>

        <li class="cat-item cat-item-1"><a href="http://192.168.200.11:9098/category/uncategorized/" >未分类</a>

</li>

                </ul>

</section><section id="meta-2" class="widget widget_meta"><h2 class="widget-title">功能</h2>                    <ul>

                                                <li><a href="http://192.168.200.11:9098/wp-login.php">登录</a></li>

                        <li><a href="http://192.168.200.11:9098/feed/">文章<abbr title="Really Simple Syndication">RSS</abbr></a></li>

                        <li><a href="http://192.168.200.11:9098/comments/feed/">评论<abbr title="Really Simple Syndication">RSS</abbr></a></li>

                        <li><a href="https://cn.wordpress.org/" title="基于WordPress,一个优美、先进的个人信息发布平台。">WordPress.org</a></li>                        </ul>

                        </section>      </aside><!-- .sidebar .widget-area -->

                </div><!-- .site-content -->

                <footer id="colophon" class="site-footer" role="contentinfo">

                        <div class="site-info">

                                                                <span class="site-title"><a href="http://192.168.200.11:9098/" rel="home">XianDian</a></span>

                                <a href="https://wordpress.org/">Proudly powered by WordPress</a>

                        </div><!-- .site-info -->

                </footer><!-- .site-footer -->

        </div><!-- .site-inner -->

</div><!-- .site -->

<script type='text/javascript' src='http://192.168.200.11:9098/wp-content/themes/twentysixteen/js/skip-link-focus-fix.js?ver=20160816'></script>

<script type='text/javascript'>

/* <![CDATA[ */

var screenReaderText = {"expand":"expand child menu","collapse":"collapse child menu"};

/* ]]> */

</script>

<script type='text/javascript' src='http://192.168.200.11:9098/wp-content/themes/twentysixteen/js/functions.js?ver=20160816'></script>

<script type='text/javascript' src='http://192.168.200.11:9098/wp-includes/js/wp-embed.min.js?ver=4.6.4'></script>

</body>

</html>

(9)自定义构建

利用rancher的应用栈,手工构建一个服务,手工添加一个名叫xd-db的数据库服务,添加两个名为xd-wp的wordpress服务,完成后创建一个名为xd-lb的负载均衡器,绑定外部端口为18888,完成后提交此应用栈的docker-compose.yml文件和rancher-compose.yml文件,将以上操作命令及检查结果填入命令行界面。

docker-compose.yml

xd-wp:

  labels:

    io.rancher.container.pull_image: always

  tty: true

  hostname: wordpress

  image: 192.168.200.12:5000/wordpress:latest

  links:

  - xd-db:mysql

  privileged: true

  stdin_open: true

xd-db:

  environment:

    MYSQL_ROOT_PASSWORD: '000000'

  labels:

    io.rancher.container.pull_image: always

  tty: true

  hostname: mariadb_server

  image: 192.168.200.12:5000/mariadb:latest

  privileged: true

  stdin_open: true

xd-lb:

  ports:

  - 18888:80

  tty: true

  image: rancher/load-balancer-service

  links:

  - xd-wp:xd-wp

  stdin_open: true

rancher-compose.yml

xd-wp:

  scale: 2

xd-db:

  scale: 1

xd-lb:

  scale: 1

  load_balancer_config:

    haproxy_config: {}

  health_check:

    port: 42

    interval: 2000

    unhealthy_threshold: 3

    healthy_threshold: 2

    response_timeout: 2000

2.镜像

(1)获取

在server节点拉取mariadb镜像,拉取完成后查询docker镜像列表目录,将以上操作命令及检查结果填入命令行界面。

[root@server ~]# docker pull mariadb:latest

Trying to pull repository 192.168.200.12:5000/mariadb ...

latest: Pulling from 192.168.200.12:5000/mariadb

386a066cd84a: Pull complete

827c8d62b332: Pull complete

de135f87677c: Pull complete

05822f26ca6e: Pull complete

ad65f56a251e: Pull complete

d71752ae05f3: Pull complete

87cb39e409d0: Pull complete

8e300615ba09: Pull complete

411bb8b40c58: Pull complete

f38e00663fa6: Pull complete

7b8e0ed6d4af: Pull complete

9a599d94dc41: Pull complete

Digest: sha256:7f9f59d0009c2c0b1a3446ef832bc4a46b64d17963aa1adf590b2793a9f95ceb

Status: Downloaded newer image for 192.168.200.12:5000/mariadb:latest

[root@server ~]# docker images

REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE

192.168.200.12:5000/mariadb               latest              66498efd6bd8        4 months ago        389.9 MB

(2)修改

在registry节点运行mariadb镜像,设置数据库密码为xd_root,将宿主机13306端口作为容器3306端口映射,进入容器后创建数据库xd_db,创建用户xiandian,密码为xd_pass,将此用户对xd_db拥有所有权限和和允许此用户远程访问,完成后使用xiandian用户远程登录数据库查询数据库内的数据库列表,将以上操作命令及检查结果填入命令行界面。

# docker run -itdP -e MYSQL_ROOT_PASSWORD=xd_root -p 13306:3306 192.168.200.12:5000/mariadb:latest

# docker exec -it 8998a53f34da /bin/bash

# mysql -uroot -pxd_root

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 2

Server version: 10.1.19-MariaDB-1~jessie mariadb.org binary distribution

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database xd_db;

Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]> grant all privileges on xd_db.* to 'xiandian'@'%'  identified by 'xd_pass';

Query OK, 0 rows affected (0.00 sec)

# mysql -uxiandian -pxd_pass -h172.17.0.66 -e "show databases;"

+--------------------+

| Database           |

+--------------------+

| information_schema |

| xd_db              |

+--------------------+

(3)导出

在server节点将修改的mariadb镜像导出,导出名称为mariadb_images.tar,将以上操作命令及检查结果填入命令行界面。

# docker save b8d391717ee1 > mariadb_images.tar

docker export 66498efd6bd8 > mariadb_images.tar

(4)删除

在server节点将修改的mariadb镜像删除,删除完成后查询镜像列表,将以上操作命令及检查结果填入命令行界面。

# docker rmi -f b8d391717ee1

Untagged: mariadb_new:latest

Deleted: sha256:b8d391717ee14a5f83278a91d9e218a45888a57de113ac92dc91409b108b4aa7

Deleted: sha256:2a4fa9bd49115636b7403e53e5dad740149f9fb2d6761aa196542e76bdd9cd60

# docker images

REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE

rancher/server                       v1.1.4-xd           b4a59c6feee8        3 weeks ago         917.7 MB

192.168.200.12:5000/mariadb               latest              66498efd6bd8        4 months ago        389.9 MB

192.168.200.12:5000/busybox               latest              e02e811dd08f        5 months ago        1.093 MB

192.168.200.12:5000/rancher/agent         v1.0.2              deb5c6987c83        9 months ago        454.3 MB

(5)导入

在server节点将导出的修改的mariadb_images.tar文件导入,命名为mairadb_xiandian:latest,完成后查询镜像列表,将以上操作命令及检查结果填入命令行界面。

# docker load < mariadb_images.tar

# docker tag b8d391717ee1 mairadb_xiandian:latest

# docker images

REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE

mairadb_xiandian                     latest              b8d391717ee1        14 minutes ago      389.9 MB

3.容器

(1)运行

在server节点运行mariadb容器,指定mysql密码为000000,容器运行在后台,使用随机映射端口,容器运行完成后查询容器列表,将以上操作命令及检查结果填入命令行界面。

# docker run -d -P -e MYSQL_ROOT_PASSWORD=000000 192.168.200.12:5000/mariadb:latest

# docker ps -a

CONTAINER ID        IMAGE                           COMMAND                  CREATED              STATUS                  PORTS                            NAMES

a39b8f32b18e        192.168.200.12:5000/mariadb:latest   "docker-entrypoint.sh"   About a minute ago   Up About a minute       0.0.0.0:32846->3306/tcp          romantic_rosalind

(2)开启\停止\重启

在server节点,将运行的mariadb容器停止,完成后查询容器状态,将以上操作命令及检查结果填入命令行界面。

# docker stop a39b8f32b18e

# docker ps -a

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                     PORTS                            NAMES

a39b8f32b18e        192.168.200.12:5000/mariadb:latest   "docker-entrypoint.sh"   7 minutes ago       Exited (0) 5 minutes ago                                    romantic_rosalind

在server节点,将运行的mariadb容器开机,完成后查询容器状态,将以上操作命令及检查结果填入命令行界面。

# docker start a39b8f32b18e

# docker ps -a

CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                  PORTS                            NAMES

a39b8f32b18e        192.168.200.12:5000/mariadb:latest   "docker-entrypoint.sh"   9 minutes ago       Up 18 seconds           0.0.0.0:32848->3306/tcp          romantic_rosalind

在server节点,将运行的mariadb容器重启,将以上操作命令及检查结果填入命令行界面。

# docker restart a39b8f32b18e

(3)attach\exec 连接

在server节点,执行一条命令使用exec获取的rancher/server容器正在运行的网络套接字连接情况,将以上操作命令及检查结果填入命令行界面。

# docker exec 4bffd6c930b5 netstat  -ntpl    

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      -              

tcp6       0      0 :::8080                 :::*                    LISTEN      142/websocket-proxy

tcp6       0      0 :::8081                 :::*                    LISTEN      8/java         

tcp6       0      0 :::8088                 :::*                    LISTEN      149/rancher-catalog

(4)inspect查看底层信息

在server节点,使用inspect只查询rancher/server容器的NetworkSettings内Networks网桥信息,将以上操作命令及检查结果填入命令行界面。

# docker inspect -f {{.NetworkSettings.Networks.bridge}}  4bffd6c930b5

{<nil> [] [] f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515 71c7903c240bbb8ea835e4773a265ec507b557b1ee1733cff99daae43259cec1 172.17.0.1 172.17.0.2 16   0 02:42:ac:11:00:02}

在server节点,使用inspect只查询rancher/server容器的PortBindings

网桥信息,将以上操作命令及检查结果填入命令行界面。

# docker inspect -f '{{.HostConfig.PortBindings}}' 4bffd6c930b5

map[8080/tcp:[{ 80}]]

在server节点,使用inspect只查询rancher/server容器的NetworkSettings内Ports信息,将以上操作命令及检查结果填入命令行界面。

# docker inspect -f '{{.NetworkSettings.Ports}}'  4bffd6c930b5

map[3306/tcp:[] 8080/tcp:[{0.0.0.0 80}]]

在server节点,使用inspect只查询rancher/server镜像的Tags信息,将以上操作命令及检查结果填入命令行界面。

# docker inspect -f '{{.RepoTags}}' b4a59c6feee8

[rancher/server:v1.1.4-xd]

在server节点,使用inspect只查询rancher/server镜像的Volumes卷组信息,将以上操作命令及检查结果填入命令行界面。

# docker inspect -f '{{.ContainerConfig.Volumes}}' b4a59c6feee8       

map[/var/lib/cattle:{} /var/lib/mysql:{} /var/log/mysql:{}]

在server节点,使用inspect只查询rancher/server镜像的Config信息,将以上操作命令及检查结果填入命令行界面。

# docker inspect -f '{{.Config}}' b4a59c6feee8                 

{   false false false map[3306/tcp:{} 8080/tcp:{}]  false false false [DEFAULT_CATTLE_CATALOG_URL=library=/opt/temp/library,community=/opt/temp/community PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBIAN_FRONTEND=noninteractive CATTLE_HOME=/var/lib/cattle DEFAULT_CATTLE_API_UI_INDEX=//localhost/openstack/1.1.14 CATTLE_DB_CATTLE_DATABASE=mysql CATTLE_USE_LOCAL_ARTIFACTS=true no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com S6_SERVICE_DIR=/service CATTLE_HOST_API_PROXY_MODE=embedded CATTLE_RANCHER_SERVER_VERSION=v1.1.4 CATTLE_RANCHER_COMPOSE_VERSION=v0.8.6 DEFAULT_CATTLE_RANCHER_COMPOSE_LINUX_URL=http://localhost/openstack/rancher-compose-linux-amd64-v0.8.6.tar.gz DEFAULT_CATTLE_RANCHER_COMPOSE_DARWIN_URL=http://localhost/openstack/rancher-compose-darwin-amd64-v0.8.6.tar.gz DEFAULT_CATTLE_RANCHER_COMPOSE_WINDOWS_URL=http://localhost/openstack/rancher-compose-windows-386-v0.8.6.zip CATTLE_CATTLE_VERSION=v0.165.8.4 DEFAULT_CATTLE_MACHINE_EXECUTE=true DEFAULT_CATTLE_COMPOSE_EXECUTOR_EXECUTE=true DEFAULT_CATTLE_CATALOG_EXECUTE=true CATTLE_RANCHER_SERVER_IMAGE=rancher/server] 0xc8205d2020 false  map[/var/log/mysql:{} /var/lib/cattle:{} /var/lib/mysql:{}]  <nil> false  [] map[] }

(5)查看容器信息

在server节点,使用inspect只查询rancher/server镜像的Config信息,将以上操作命令及检查结果填入命令行界面。

# docker inspect  4bffd6c930b5

[

    {

        "Id": "4bffd6c930b55421417b62b1080c875cd37d61483cd2e466c66d2039a34cd0aa",

        "Created": "2017-03-13T08:48:23.540651805Z",

        "Path": "/usr/bin/s6-svscan",

        "Args": [

            "/service"

        ],

        "State": {

            "Status": "running",

            "Running": true,

            "Paused": false,

            "Restarting": false,

            "OOMKilled": false,

            "Dead": false,

            "Pid": 21310,

            "ExitCode": 0,

            "Error": "",

            "StartedAt": "2017-03-21T00:37:20.035057426Z",

            "FinishedAt": "2017-03-21T00:37:15.63211683Z"

        },

        "Image": "sha256:b4a59c6feee86e8346a593522553dc4a528f63e5b6206f83106b6079bd3a878b",

        "ResolvConfPath": "/var/lib/docker/containers/4bffd6c930b55421417b62b1080c875cd37d61483cd2e466c66d2039a34cd0aa/resolv.conf",

        "HostnamePath": "/var/lib/docker/containers/4bffd6c930b55421417b62b1080c875cd37d61483cd2e466c66d2039a34cd0aa/hostname",

        "HostsPath": "/var/lib/docker/containers/4bffd6c930b55421417b62b1080c875cd37d61483cd2e466c66d2039a34cd0aa/hosts",

        "LogPath": "",

        "Name": "/server",

        "RestartCount": 0,

        "Driver": "devicemapper",

        "MountLabel": "",

        "ProcessLabel": "",

        "AppArmorProfile": "",

        "ExecIDs": null,

        "HostConfig": {

            "Binds": null,

            "ContainerIDFile": "",

            "LogConfig": {

                "Type": "journald",

                "Config": {}

            },

            "NetworkMode": "default",

            "PortBindings": {

                "8080/tcp": [

                    {

                        "HostIp": "",

                        "HostPort": "80"

                    }

                ]

            },

            "RestartPolicy": {

                "Name": "always",

                "MaximumRetryCount": 0

            },

            "VolumeDriver": "",

            "VolumesFrom": null,

            "CapAdd": null,

            "CapDrop": null,

            "Dns": [],

            "DnsOptions": [],

            "DnsSearch": [],

            "ExtraHosts": null,

            "GroupAdd": null,

            "IpcMode": "",

            "Links": null,

            "OomScoreAdj": 0,

            "PidMode": "",

            "Privileged": false,

            "PublishAllPorts": false,

            "ReadonlyRootfs": false,

            "SecurityOpt": null,

            "UTSMode": "",

            "ShmSize": 67108864,

            "ConsoleSize": [

                0,

                0

            ],

            "Isolation": "",

            "CpuShares": 0,

            "CgroupParent": "",

            "BlkioWeight": 0,

            "BlkioWeightDevice": null,

            "BlkioDeviceReadBps": null,

            "BlkioDeviceWriteBps": null,

            "BlkioDeviceReadIOps": null,

            "BlkioDeviceWriteIOps": null,

            "CpuPeriod": 0,

            "CpuQuota": 0,

            "CpusetCpus": "",

            "CpusetMems": "",

            "Devices": [],

            "KernelMemory": 0,

            "Memory": 0,

            "MemoryReservation": 0,

            "MemorySwap": 0,

            "MemorySwappiness": -1,

            "OomKillDisable": false,

            "PidsLimit": 0,

            "Ulimits": null

        },

        "GraphDriver": {

            "Name": "devicemapper",

            "Data": {

                "DeviceId": "77",

                "DeviceName": "docker-253:1-268435649-47f91f74bac39216084496792f44d056dd95fc49f8a64115452621c24e2eff4b",

                "DeviceSize": "10737418240"

            }

        },

        "Mounts": [

            {

                "Name": "a4d71a18abf39258d66bd22e444d0b3740b1d09284035f0987d6faf4ee78ec17",

                "Source": "/var/lib/docker/volumes/a4d71a18abf39258d66bd22e444d0b3740b1d09284035f0987d6faf4ee78ec17/_data",

                "Destination": "/var/lib/cattle",

                "Driver": "local",

                "Mode": "",

                "RW": true,

                "Propagation": ""

            },

            {

                "Name": "9a7e86fc8a647367492b54e94dc8290ae722c5b6a3cf311869b82d907863151d",

                "Source": "/var/lib/docker/volumes/9a7e86fc8a647367492b54e94dc8290ae722c5b6a3cf311869b82d907863151d/_data",

                "Destination": "/var/lib/mysql",

                "Driver": "local",

                "Mode": "",

                "RW": true,

                "Propagation": ""

            },

            {

                "Name": "adf794bc62dd8102a3018bf15034db6b52474d5e4935177ed73ab9b0a5d73630",

                "Source": "/var/lib/docker/volumes/adf794bc62dd8102a3018bf15034db6b52474d5e4935177ed73ab9b0a5d73630/_data",

                "Destination": "/var/log/mysql",

                "Driver": "local",

                "Mode": "",

                "RW": true,

                "Propagation": ""

            }

        ],

        "Config": {

            "Hostname": "4bffd6c930b5",

            "Domainname": "",

            "User": "",

            "AttachStdin": false,

            "AttachStdout": false,

            "AttachStderr": false,

            "ExposedPorts": {

                "3306/tcp": {},

                "8080/tcp": {}

            },

            "Tty": false,

            "OpenStdin": false,

            "StdinOnce": false,

            "Env": [

                "DEFAULT_CATTLE_CATALOG_URL=library=/opt/temp/library,community=/opt/temp/community",

                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",

                "DEBIAN_FRONTEND=noninteractive",

                "CATTLE_HOME=/var/lib/cattle",

                "DEFAULT_CATTLE_API_UI_INDEX=//localhost/openstack/1.1.14",

                "CATTLE_DB_CATTLE_DATABASE=mysql",

                "CATTLE_USE_LOCAL_ARTIFACTS=true",

                "no_proxy=localhost,127.0.0.1,localaddress,.localdomain.com",

                "S6_SERVICE_DIR=/service",

                "CATTLE_HOST_API_PROXY_MODE=embedded",

                "CATTLE_RANCHER_SERVER_VERSION=v1.1.4",

                "CATTLE_RANCHER_COMPOSE_VERSION=v0.8.6",

                "DEFAULT_CATTLE_RANCHER_COMPOSE_LINUX_URL=http://localhost/openstack/rancher-compose-linux-amd64-v0.8.6.tar.gz",

                "DEFAULT_CATTLE_RANCHER_COMPOSE_DARWIN_URL=http://localhost/openstack/rancher-compose-darwin-amd64-v0.8.6.tar.gz",

                "DEFAULT_CATTLE_RANCHER_COMPOSE_WINDOWS_URL=http://localhost/openstack/rancher-compose-windows-386-v0.8.6.zip",

                "CATTLE_CATTLE_VERSION=v0.165.8.4",

                "DEFAULT_CATTLE_MACHINE_EXECUTE=true",

                "DEFAULT_CATTLE_COMPOSE_EXECUTOR_EXECUTE=true",

                "DEFAULT_CATTLE_CATALOG_EXECUTE=true",

                "CATTLE_RANCHER_SERVER_IMAGE=rancher/server"

            ],

            "Cmd": [

                "/usr/bin/s6-svscan",

                "/service"

            ],

            "Image": "rancher/server:v1.1.4-xd",

            "Volumes": {

                "/var/lib/cattle": {},

                "/var/lib/mysql": {},

                "/var/log/mysql": {}

            },

            "WorkingDir": "",

            "Entrypoint": null,

            "OnBuild": null,

            "Labels": {}

        },

        "NetworkSettings": {

            "Bridge": "",

            "SandboxID": "a4d38d0d3ba0c3d7c8ea5c9a6eb2e28bc31ec0a87a44b93acaf16c8014a997ca",

            "HairpinMode": false,

            "LinkLocalIPv6Address": "",

            "LinkLocalIPv6PrefixLen": 0,

            "Ports": {

                "3306/tcp": null,

                "8080/tcp": [

                    {

                        "HostIp": "0.0.0.0",

                        "HostPort": "80"

                    }

                ]

            },

            "SandboxKey": "/var/run/docker/netns/a4d38d0d3ba0",

            "SecondaryIPAddresses": null,

            "SecondaryIPv6Addresses": null,

            "EndpointID": "71c7903c240bbb8ea835e4773a265ec507b557b1ee1733cff99daae43259cec1",

            "Gateway": "172.17.0.1",

            "GlobalIPv6Address": "",

            "GlobalIPv6PrefixLen": 0,

            "IPAddress": "172.17.0.2",

            "IPPrefixLen": 16,

            "IPv6Gateway": "",

            "MacAddress": "02:42:ac:11:00:02",

            "Networks": {

                "bridge": {

                    "IPAMConfig": null,

                    "Links": null,

                    "Aliases": null,

                    "NetworkID": "f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515",

                    "EndpointID": "71c7903c240bbb8ea835e4773a265ec507b557b1ee1733cff99daae43259cec1",

                    "Gateway": "172.17.0.1",

                    "IPAddress": "172.17.0.2",

                    "IPPrefixLen": 16,

                    "IPv6Gateway": "",

                    "GlobalIPv6Address": "",

                    "GlobalIPv6PrefixLen": 0,

                    "MacAddress": "02:42:ac:11:00:02"

                }

            }

        }

    }

]

(6)简单操作

在server节点,使用docker命令查询rancher/server镜像的进程,将以上操作命令及检查结果填入命令行界面。

# docker top  4bffd6c930b5       

UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD

root                19572               21323               0                   00:42               ?                   00:00:09            go-machine-service

root                19585               21323               0                   00:42               ?                   00:00:18            rancher-compose-executor

root                21310               21234               0                   Mar21               ?                   00:00:07            /usr/bin/s6-svscan /service

root                21319               21310               0                   Mar21               ?                   00:00:00            s6-supervise cattle

root                21320               21310               0                   Mar21               ?                   00:00:00            s6-supervise mysql

root                21323               21319               0                   Mar21               ?                   00:55:27            java -Xms128m -Xmx2g -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/lib/cattle/logs -Dlogback.bootstrap.level=WARN -cp /usr/share/cattle/58488b81592773dcae114770406e3e1b:/usr/share/cattle/58488b81592773dcae114770406e3e1b/etc/cattle io.cattle.platform.launcher.Main

102                 21342               21320               0                   Mar21               ?                   00:15:04            /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306

root                21465               21323               0                   Mar21               ?                   00:10:32            websocket-proxy

root                21472               21323               0                   Mar21               ?                   00:01:22            rancher-catalog-service -catalogUrl library=/opt/temp/library,community=/opt/temp/community -refreshInterval 300

在server节点,使用docker命令查列出容器内发生变化的文件和目录,将以上操作命令及检查结果填入命令行界面。

# docker diff   4bffd6c930b5

C /run

C /run/mysqld

C /run/mysqld/mysqld.pid

C /run/mysqld/mysqld.sock

C /service

C /service/cattle

C /service/cattle/supervise

C /service/cattle/supervise/status

C /service/mysql

C /service/mysql/supervise

C /service/mysql/supervise/status

C /service/mysql/supervise/control

C /usr

C /usr/local

C /usr/local/bin

A /usr/local/bin/docker-machine-driver-packet

C /root

C /root/.bash_history

C /etc

C /etc/mysql

C /etc/mysql/my.cnf

C /tmp

C /tmp/hsperfdata_root

C /tmp/hsperfdata_root/8

A /tmp/jetty-0.0.0.0-8081-58488b81592773dcae114770406e3e1b-_-any-2649025364052028092.dir

在server节点,使用docker命令打印指定时间内的容器的实时系统事件,将以上操作命令及检查结果填入命令行界面。

# docker    events

C /run

C /run/mysqld

C /run/mysqld/mysqld.pid

C /run/mysqld/mysqld.sock

C /service

C /service/cattle

C /service/cattle/supervise

C /service/cattle/supervise/status

C /service/mysql

C /service/mysql/supervise

C /service/mysql/supervise/status

C /service/mysql/supervise/control

C /usr

C /usr/local

C /usr/local/bin

A /usr/local/bin/docker-machine-driver-packet

C /root

C /root/.bash_history

C /etc

C /etc/mysql

C /etc/mysql/my.cnf

C /tmp

C /tmp/hsperfdata_root

C /tmp/hsperfdata_root/8

A /tmp/jetty-0.0.0.0-8081-58488b81592773dcae114770406e3e1b-_-any-2649025364052028092.dir

在server节点,使用docker命令查看最后退出的容器的ID,将以上操作命令及检查结果填入命令行界面。

[root@registry ~]# docker ps -l

CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS                      PORTS               NAMES

72ad2719b721        192.168.200.12:5000/taicai/java_web:v1.0   "/bin/sh -c '${CATALI"   22 hours ago        Exited (143) 19 hours ago                       berserk_wright

(7)打包\拷贝\删除

在server节点将运行的mariadb容器保存为mariadb.tar文件,将以上操作命令及检查结果填入命令行界面。

# docker export 8998a53f34da  > mariadb.tar

在server节点将运行的mariadb容器创建为镜像名为mariadb_new:latest,完成后查询镜像列表,将以上操作命令及检查结果填入命令行界面。

# docker commit 8998a53f34da mariadb_new:latest

# docker images

REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE

mariadb_new                          latest              b8d391717ee1        6 seconds ago       389.9 MB

在server节点删除正在运行的mariadb容器,完成后查询容器列表,将以上操作命令及检查结果填入命令行界面。

# docker rm -f 8998a53f34da

# docker ps -a

be3cefcbf7f3        192.168.200.12:5000/taicai/nginx:v1.0            "/bin/sh -c /usr/sbin"   3 days ago          Exited (0) About an hour ago                              jolly_elion

940568599bb2        192.168.200.12:5000/registry:latest              "/entrypoint.sh /etc/"   6 weeks ago         Up About an hour                 0.0.0.0:5000->5000/tcp   registry

在registry节点查询registry容器的CPU、内存等统计信息,将以上操作命令及检查结果填入命令行界面。

# docker stats 940568599bb2

CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O               BLOCK I/O

940568599bb2        0.00%               155.4 MB / 2.099 GB   7.40%               276.5 kB / 131.5 MB   151.8 MB / 0 B

在registry节点查所有容器的CPU、内存等统计信息,将以上操作命令及检查结果填入命令行界面。

# docker stats –a

CONTAINER           CPU %               MEM USAGE / LIMIT     MEM %               NET I/O               BLOCK I/O

28c212378a55        0.00%               0 B / 0 B             0.00%               0 B / 0 B             0 B / 0 B

6cef0055e66d        0.00%               0 B / 0 B             0.00%               0 B / 0 B             0 B / 0 B

72ad2719b721        0.00%               0 B / 0 B             0.00%               0 B / 0 B             0 B / 0 B

940568599bb2        0.00%               155.4 MB / 2.099 GB   7.40%               276.5 kB / 131.5 MB   151.8 MB / 0 B

be3cefcbf7f3        0.00%               0 B / 0 B             0.00%               0 B / 0 B             0 B / 0 B

在server节点修改运行的rancher/server容器的名称,修改名称为xiandian_server,完成后查询容器列表,将以上操作命令及检查结果填入命令行界面。

# docker rename 4bffd6c930b5 xiandian_ server

# docker ps -a

4bffd6c930b5        rancher/server:v1.1.4-xd        "/usr/bin/s6-svscan /"   2 weeks ago         Up 12 minutes           3306/tcp, 0.0.0.0:80->8080/tcp   xiandian_ server

(8)其他

在server节点,使用docker命令列举所有的网络,将以上操作命令及检查结果填入命令行界面。

# docker network  ls

NETWORK ID          NAME                DRIVER

98f6f49a08a9        host                host               

f1924f102406        bridge              bridge             

f4b61dd01d6d        none                null        

在server节点,使用docker命令查询bridge网络的所有详情,将以上操作命令及检查结果填入命令行界面。

# docker network inspect bridge

[

    {

        "Name": "bridge",

        "Id": "f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515",

        "Scope": "local",

        "Driver": "bridge",

        "IPAM": {

            "Driver": "default",

            "Options": null,

            "Config": [

                {

                    "Subnet": "172.17.0.0/16",

                    "Gateway": "172.17.0.1"

                }

            ]

        },

        "Containers": {

            "0096f7587e08a22d44882c770623ea711cacbd2fa967632065f583d79f44a65f": {

                "Name": "determined_bose",

                "EndpointID": "9bb37919a2c403c8c6c76589ec254204f2f8ae16e59ed3b34ab179da4fdf58cc",

                "MacAddress": "02:42:ac:11:00:3f",

                "IPv4Address": "172.17.0.63/16",

                "IPv6Address": ""

            },

            "012dea2bb42cf71f35fe71699a0d140558fd3f9dc73e7f2fc757c36edf220763": {

                "Name": "compassionate_lalande",

                "EndpointID": "192ca1a63dc0153cb8b86f3a801c275a0a83b60a1fbdf8651d05384713903930",

                "MacAddress": "02:42:ac:11:00:37",

                "IPv4Address": "172.17.0.55/16",

                "IPv6Address": ""

            },

        },

        "Options": {

            "com.docker.network.bridge.default_bridge": "true",

            "com.docker.network.bridge.enable_icc": "true",

            "com.docker.network.bridge.enable_ip_masquerade": "true",

            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",

            "com.docker.network.bridge.name": "docker0",

            "com.docker.network.driver.mtu": "1500"

        }

    }

]

在server节点,使用docker命令创建名为xd_net的网络,网络网段为192.168.3.0/24,网关为192.168.3.1,创建完成后查询网络列表,将以上操作命令及检查结果填入命令行界面。

# docker network create --subnet=192.168.3.0/24 --ip-range=192.168.3.0/24 --gateway=192.168.3.1   xd_net

# docker network ls

NETWORK ID          NAME                DRIVER

98f6f49a08a9        host                host               

ffa150e53889        xd_net              bridge             

f1924f102406        bridge              bridge             

f4b61dd01d6d        none                null

在server节点,使用docker命令创建名为xd_net的网络,网络网段为192.168.3.0/24,网关为192.168.3.1,创建完成后查询此网络的详细信息,将以上操作命令及检查结果填入命令行界面。

# docker network create --subnet=192.168.3.0/24 --ip-range=192.168.3.0/24 --gateway=192.168.3.1   xd_net

# docker network inspect xd_net

[

    {

        "Name": "xd_net",

        "Id": "ffa150e538894f9c2a4e8e9a53f716a5a8ad86ea1b61aff3f9971e48c1e25588",

        "Scope": "local",

        "Driver": "bridge",

        "IPAM": {

            "Driver": "default",

            "Options": {},

            "Config": [

                {

                    "Subnet": "192.168.3.0/24",

                    "IPRange": "192.168.3.0/24",

                    "Gateway": "192.168.3.1"

                }

            ]

        },

        "Containers": {},

        "Options": {}

    }

]

在server节点,创建镜像为ubuntu,容器名称为ubuntu,使用docker网络为xd_net,创建完成后查询容器使用的网络名称和查询该容器的运行状态,将以上操作命令及检查结果填入命令行界面。

# docker run -ditP --net=xd_net --name ubuntu ubuntu:14.04.3

# docker inspect -f '{{.NetworkSettings.Networks}}' ubuntu

map[xd_net:0xc8200ba0c0]

# docker ps -a

CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS              PORTS                            NAMES

35058aa35fa5        ubuntu:14.04.3             "/bin/bash"              2 minutes ago       Up 2 minutes                                         ubuntu

在server节点,创建镜像为ubuntu,容器名称为ubuntu,使用docker网络为xd_net,创建完成后查询容器IP地址和查询该容器的运行状态,将以上操作命令及检查结果填入命令行界面。

# docker run -ditP --net=xd_net --name ubuntu ubuntu:14.04.3

docker inspect -f '{{.NetworkSettings.Networks.xd_net.IPAddress}}' ubuntu

192.168.3.2

# docker ps -a

CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS              PORTS                            NAMES

35058aa35fa5        ubuntu:14.04.3             "/bin/bash"              2 minutes ago       Up 2 minutes                                         ubuntu

在server节点,删除docker网络xd_net,完成后查询docker网络列表,将以上操作命令及检查结果填入命令行界面。

# docker network rm xd_net

# docker network ls

NETWORK ID          NAME                DRIVER

f4b61dd01d6d        none                null               

98f6f49a08a9        host                host               

f1924f102406        bridge              bridge  

在server节点,使用docker命令只列举rancher/server容器的端口映射状态,将以上操作命令及检查结果填入命令行界面。

# docker port 4bffd6c930b5

8080/tcp -> 0.0.0.0:80

在server节点,使用docker命令打印rancher/server镜像的大小和日期历史更新信息。将以上操作命令及检查结果填入命令行界面。

# docker history -H rancher/server:v1.1.4-xd 

IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT

b4a59c6feee8        3 weeks ago         /usr/bin/s6-svscan /service                     53.64 kB           

<missing>           3 weeks ago         /usr/bin/s6-svscan /service                     3.776 MB           

<missing>           3 weeks ago         /usr/bin/s6-svscan /service                     3.221 MB           

<missing>           3 weeks ago         /usr/bin/s6-svscan /service                     716.1 kB           

<missing>           3 weeks ago         /usr/bin/s6-svscan /service                     36.79 kB           

<missing>           4 weeks ago         /usr/bin/s6-svscan /service                     70.29 kB           

<missing>           4 weeks ago         /usr/bin/s6-svscan /service                     36.6 kB            

<missing>           4 weeks ago         /bin/sh -c #(nop)  CMD ["/usr/bin/s6-svscan"    0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_RANCHER_SERVER_   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_CATALOG   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_COMPOSE   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_MACHINE   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  VOLUME [/var/lib/mysql /va   0 B                

<missing>           4 weeks ago         /bin/sh -c for i in $DEFAULT_CATTLE_CATALOG_U   997.5 kB           

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:b14ee9c6198b8ebc9   13.62 MB           

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:8c4d85a8afd9ff91f   13.62 MB           

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:61a0875be62ec5386   38.51 MB           

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:8daaff4a6b942739b   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:659a2ee532a77ef03   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:ea77dfac21014fbee   0 B                

<missing>           4 weeks ago         /bin/sh -c cd $CATTLE_HOME && export IFS=","    0 B                

<missing>           4 weeks ago         /bin/sh -c /opt/install_cattle_binaries         163.3 MB           

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:69a7f5663566287b1   1.456 kB           

<missing>           4 weeks ago         /bin/sh -c tar xvzf /root/1.1.14.tar.gz  -C /   27.4 MB            

<missing>           4 weeks ago         /bin/sh -c /usr/share/cattle/cattle.sh extrac   106.1 MB           

<missing>           4 weeks ago         /bin/sh -c mkdir -p $CATTLE_HOME                0 B                

<missing>           4 weeks ago         /bin/sh -c rm -rf /s6-statics/*static.tar.gz    0 B                

<missing>           4 weeks ago         /bin/sh -c cd / && for i in $(ls /s6-statics/   4.289 MB           

<missing>           4 weeks ago         /bin/sh -c #(nop) ADD tarsum.v1+sha256:37ff07   12.35 MB           

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_CATTLE_VERSION=   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  EXPOSE 3306/tcp              0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_CATALOG   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_RANCHER   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_RANCHER   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_RANCHER   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_RANCHER_COMPOSE   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_RANCHER_SERVER_   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_HOST_API_PROXY_   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop)  EXPOSE 8080/tcp              0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY multi:c4e33239823be219   1.569 MB           

<missing>           4 weeks ago         /bin/sh -c #(nop)  ENV S6_SERVICE_DIR=/servic   0 B                

<missing>           4 weeks ago         /bin/sh -c #(nop) ADD dir:e460a162de3ab187d80   420 B              

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:a91fbc37bceb3dd4f   4.568 kB           

<missing>           4 weeks ago         /bin/sh -c #(nop) COPY file:8fac002511c5eb540   5.084 MB           

<missing>           5 weeks ago         /bin/sh -c #(nop) ADD dir:da6ea441cc92b1730ac   252.8 kB           

<missing>           5 weeks ago         /bin/sh -c #(nop)  ENV no_proxy=localhost,127   0 B                

<missing>           5 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_USE_LOCAL_ARTIF   0 B                 

<missing>           5 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_DB_CATTLE_DATAB   0 B                

<missing>           5 weeks ago         /bin/sh -c #(nop)  ENV DEFAULT_CATTLE_API_UI_   0 B                

<missing>           5 weeks ago         /bin/sh -c #(nop)  ENV CATTLE_HOME=/var/lib/c   0 B                

<missing>           5 weeks ago         /bin/sh -c #(nop) COPY multi:ae0933d1936489aa   4.206 kB           

<missing>           5 weeks ago         /bin/sh -c chmod +x /usr/bin/giddyup /usr/bin   20.78 MB           

<missing>           5 weeks ago         /bin/sh -c #(nop) ADD tarsum.v1+sha256:f6f649   14.44 MB           

<missing>           5 weeks ago         /bin/sh -c #(nop) ADD tarsum.v1+sha256:65604f   6.343 MB           

<missing>           5 weeks ago         /bin/sh -c apt-get update && apt-get install    293.1 MB           

<missing>           5 weeks ago         /bin/sh -c #(nop)  ENV DEBIAN_FRONTEND=nonint   0 B                

<missing>           8 months ago        /bin/sh -c #(nop) CMD ["/bin/bash"]             0 B                

<missing>           8 months ago        /bin/sh -c sed -i 's/^#\s*\(deb.*universe\)$/   1.895 kB           

<missing>           8 months ago        /bin/sh -c rm -rf /var/lib/apt/lists/*          0 B                

<missing>           8 months ago        /bin/sh -c set -xe   && echo '#!/bin/sh' > /u   194.6 kB           

<missing>           8 months ago        /bin/sh -c #(nop) ADD file:dc3b1b2c44af75026b   187.7 MB 

在server节点,使用docker命令运行ubuntu镜像,运行输出打印“Hello world”,将以上操作命令及检查结果填入命令行界面。

# docker run ubuntu:14.04.3  /bin/echo "Hello world"

Hello world

在server节点,使用docker命令运行ubuntu镜像,运行输出打印“Hello world”,要求启动命令包含打印完成后自动删除此容器及产生的数据。将以上操作命令及检查结果填入命令行界面。

# docker run --rm ubuntu:14.04.3  /bin/echo "Hello world"

Hello world

在server节点,使用docker命令查询2017-03-01至2017-03-02之间的所有时间记录。将以上操作命令及检查结果填入命令行界面。

# docker events  --since="2017-03-01" --until="2017-03-01"

2017-03-28T02:15:16.056464309Z network disconnect f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515 (container=f851747fd59dd907a76d11e643287d4ae0033537ccf14b186adf8e829004cc73, name=bridge, type=bridge)

2017-03-28T02:15:18.254105469Z container destroy f851747fd59dd907a76d11e643287d4ae0033537ccf14b186adf8e829004cc73 (image=xd-centos6.5-ssh, name=high_bassi, License=GPLv2, Vendor=CentOS)

2017-03-28T02:15:18.255150999Z container kill 1b872e423e4e314abc75b3ac578b607cb538b433ee9b5d08bcd89542819caa4b (License=GPLv2, Vendor=CentOS, image=xd-centos6.5-ssh, name=gigantic_shirley)

2017-03-28T02:15:18.277789480Z container die 1b872e423e4e314abc75b3ac578b607cb538b433ee9b5d08bcd89542819caa4b (License=GPLv2, Vendor=CentOS, image=xd-centos6.5-ssh, name=gigantic_shirley)

2017-03-28T02:15:19.004695174Z network disconnect f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515 (container=1b872e423e4e314abc75b3ac578b607cb538b433ee9b5d08bcd89542819caa4b, name=bridge, type=bridge)

2017-03-28T02:15:22.351027094Z container destroy 1b872e423e4e314abc75b3ac578b607cb538b433ee9b5d08bcd89542819caa4b (image=xd-centos6.5-ssh, name=gigantic_shirley, License=GPLv2, Vendor=CentOS)

2017-03-28T02:15:22.352106069Z container kill 6aba1efbaff9b712c08466eaf790de32c24df6e151e11c508976027e500d1e4f (Vendor=CentOS, image=xd-centos6.5-ssh, name=loving_snyder, License=GPLv2)

2017-03-28T02:15:22.374417791Z container die 6aba1efbaff9b712c08466eaf790de32c24df6e151e11c508976027e500d1e4f (name=loving_snyder, License=GPLv2, Vendor=CentOS, image=xd-centos6.5-ssh)

2017-03-28T02:15:22.558057748Z network disconnect f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515 (type=bridge, container=6aba1efbaff9b712c08466eaf790de32c24df6e151e11c508976027e500d1e4f, name=bridge)

2017-03-28T02:15:24.177540060Z container destroy 6aba1efbaff9b712c08466eaf790de32c24df6e151e11c508976027e500d1e4f (License=GPLv2, Vendor=CentOS, image=xd-centos6.5-ssh, name=loving_snyder)

2017-03-28T02:15:24.178570068Z container kill d332d4d77849503464d30ac6a2b8b121d94a1fc94e57e305386f4ac8cd6ea419 (License=GPLv2, Vendor=CentOS, image=xd-centos6.5-ssh, name=modest_pike)

2017-03-28T02:15:24.200395874Z container die d332d4d77849503464d30ac6a2b8b121d94a1fc94e57e305386f4ac8cd6ea419 (License=GPLv2, Vendor=CentOS, image=xd-centos6.5-ssh, name=modest_pike)

2017-03-28T02:15:24.420600287Z network disconnect f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515 (container=d332d4d77849503464d30ac6a2b8b121d94a1fc94e57e305386f4ac8cd6ea419, name=bridge, type=bridge)

2017-03-28T02:20:29.519944245Z container die e310a266fc7b6e466832e8389a85cc344fd5f9e570b57870eb653f7c694fc968 (image=ubuntu:14.04.3, name=ubuntu)

2017-03-28T02:20:30.033914440Z network disconnect ffa150e538894f9c2a4e8e9a53f716a5a8ad86ea1b61aff3f9971e48c1e25588 (container=e310a266fc7b6e466832e8389a85cc344fd5f9e570b57870eb653f7c694fc968, name=xd_net, type=bridge)

2017-03-28T02:21:08.322569700Z container destroy e310a266fc7b6e466832e8389a85cc344fd5f9e570b57870eb653f7c694fc968 (image=ubuntu:14.04.3, name=ubuntu)

2017-03-28T02:21:19.206790021Z container create 35058aa35fa5a43e79966f7b640c167ae34467c83532a65b49e8a36a8e401a01 (image=ubuntu:14.04.3, name=ubuntu)

2017-03-28T02:21:19.695610782Z network connect ffa150e538894f9c2a4e8e9a53f716a5a8ad86ea1b61aff3f9971e48c1e25588 (container=35058aa35fa5a43e79966f7b640c167ae34467c83532a65b49e8a36a8e401a01, name=xd_net, type=bridge)

2017-03-28T02:51:54.253349571Z network disconnect f1924f1024065fa5a634c1ca5583e4231445b3b4e8dd7d790ea6f964f27ff515 (type=bridge, container=6eb048e142c2ce276bef8c346fe7b1566fca81e23366057accc6b48c08065f0a, name=bridge)

2017-03-28T02:51:55.813156762Z container destroy 6eb048e142c2ce276bef8c346fe7b1566fca81e23366057accc6b48c08065f0a (image=ubuntu:14.04.3, name=elated_mirzakhani)

在server节点,使用docker命令运行ubuntu镜像,运行输出打印“Hello world”,要求启动命令包含打印完成后自动删除此容器。将以上操作命令及检查结果填入命令行界面。

# docker run --rm ubuntu:14.04.3  /bin/echo "Hello world"

Hello world

在server节点,使用docker命令将rancher/server容器内的/opt/目录下rancher.tar.gz文件拷贝到宿主机的/opt/目录下。完成后查询文件大小,将以上操作命令及检查结果填入命令行界面。

# docker cp 4bffd6c930b5:/opt/rancher.tar.gz .

# du -sh rancher.tar.gz

2.5M    rancher.tar.gz

在server节点,使用docker命令将当前操作系统的yum源repo文件拷贝到rancher/server容器内的/opt/目录下。完成后查询容器的/opt目录下的所有文件列表,并查询文件内容,将以上操作命令及检查结果填入命令行界面。

# docker cp /etc/yum.repos.d/local.repo  4bffd6c930b5:/opt/

# docker exec -it 4bffd6c930b5 /bin/ls /opt/

cattle-global.properties  local.repo      temp

install_cattle_binaries   rancher.tar.gz

# docker exec -it 4bffd6c930b5 /bin/cat  /opt/local.repo

[centos]

name=centos

baseurl=ftp://10.0.0.254/file/cr/2017/centos7.2/

gpgcheck=0

enabled=1

[iaas]

name=iaas

baseurl=ftp://10.0.0.254/file/cr/2017/docker/docker/

gpgcheck=0

enabled=1

在client节点,使用docker命令查询正在实时运行的容器列表,将以上操作命令及检查结果填入命令行界面。

# docker ps

CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS                                          NAMES

3949b68a8b6e        rocketchat/hubot-rocketchat:latest   "/bin/sh -c 'node -e "   21 hours ago        Up 21 hours         0.0.0.0:3001->8080/tcp                         07ca61f2-3657-464e-8872-25180ff0c18f

4c55d007c682        rocketchat/rocket.chat:latest        "node main.js"           21 hours ago        Up 20 hours         0.0.0.0:3000->3000/tcp                         963581eb-74cd-4a2a-91ca-e3afbdc884fa

5e1bd01263d5        mongo:latest                         "/entrypoint.sh mongo"   21 hours ago        Up 20 hours         27017/tcp                                      cbf83738-f90a-4030-88bc-170e8f3d7504

e796884b627e        jenkins:1.651.3                      "/usr/share/jenkins/r"   21 hours ago        Up 20 hours         50000/tcp, 0.0.0.0:9095->8080/tcp              f7cc7b20-c2a7-4b6e-9190-b25f474cd42e

f0043c7907b7        rancher/jenkins-plugins:v0.1.1       "/confd --backend ran"   22 hours ago        Up 20 hours                                                        r-jenkins_jenkins-primary_jenkins-plugins_1

a905c0b003fe        opensaas/concrete5:latest            "apache2-foreground"     22 hours ago        Up 21 hours         80/tcp                                         r-Concrete5_Concrete5App_1

bc9825ef1818        mysql:latest                         "docker-entrypoint.sh"   22 hours ago        Up 21 hours         3306/tcp                                       r-Concrete5_CMSMysql_1

bd9f804d9ccc        owncloud:latest                      "/entrypoint.sh apach"   23 hours ago        Up 21 hours         0.0.0.0:80->80/tcp                             r-owncloud_owncloud_1

0a801449b132        wordpress:latest                     "docker-entrypoint.sh"   23 hours ago        Up 20 hours         0.0.0.0:9098->80/tcp                           r-wordpress_wordpress_1

d723cdceb8f0        mariadb:latest                       "docker-entrypoint.sh"   23 hours ago        Up 20 hours         3306/tcp                                       r-wordpress_db_1

286de803b06c        gogs/gogs:latest                     "docker/start.sh /bin"   23 hours ago        Up 21 hours         0.0.0.0:222->22/tcp, 0.0.0.0:9093->3000/tcp    r-gogs_gogs_1

99697671f552        mariadb:latest                       "docker-entrypoint.sh"   24 hours ago        Up 20 hours         3306/tcp                                       r-owncloud_db_1

781376644b98        grafana/grafana:latest               "/run.sh"                24 hours ago        Up 21 hours         0.0.0.0:9094->3000/tcp                         r-grafana_grafana_1

58987ce8c284        mysql:latest                         "docker-entrypoint.sh"   24 hours ago        Up 21 hours         0.0.0.0:3306->3306/tcp                         r-gogs_mysql_1

6fa86a287731        ghost:latest                         "/entrypoint.sh npm s"   24 hours ago        Up 21 hours         0.0.0.0:9092->2368/tcp                         r-ghost_ghost_1

4792a9cc5e26        rancher/agent-instance:v0.8.3        "/etc/init.d/agent-in"   7 days ago          Up 21 hours         0.0.0.0:500->500/udp, 0.0.0.0:4500->4500/udp   227ccb46-72f6-4271-a8e5-3b2ed8a054e2

e9d751dfb08c        rancher/agent:v1.0.2                 "/run.sh run"            2 weeks ago         Up 21 hours                                                        rancher-agent

在client节点,使用docker命令查询所有的容器列表,将以上操作命令及检查结果填入命令行界面。

# docker ps -a

CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                    PORTS                                          NAMES

3949b68a8b6e        rocketchat/hubot-rocketchat:latest   "/bin/sh -c 'node -e "   21 hours ago        Up 21 hours               0.0.0.0:3001->8080/tcp                         07ca61f2-3657-464e-8872-25180ff0c18f

4c55d007c682        rocketchat/rocket.chat:latest        "node main.js"           21 hours ago        Up 21 hours               0.0.0.0:3000->3000/tcp                         963581eb-74cd-4a2a-91ca-e3afbdc884fa

5e1bd01263d5        mongo:latest                         "/entrypoint.sh mongo"   21 hours ago        Up 21 hours               27017/tcp                                      cbf83738-f90a-4030-88bc-170e8f3d7504

e796884b627e        jenkins:1.651.3                      "/usr/share/jenkins/r"   21 hours ago        Up 20 hours               50000/tcp, 0.0.0.0:9095->8080/tcp              f7cc7b20-c2a7-4b6e-9190-b25f474cd42e

444b56b643c3        opensaas/concrete5:latest            "bash -c 'chown -R ww"   21 hours ago        Exited (1) 20 hours ago                                                  r-Concrete5_Concrete5App_CMSConfig_1

a80c1184ab76        busybox:latest                       "chown -R 1000:1000 /"   21 hours ago        Exited (0) 20 hours ago                                                  r-jenkins_jenkins-primary_jenkins-datavolume_1

f0043c7907b7        rancher/jenkins-plugins:v0.1.1       "/confd --backend ran"   22 hours ago        Up 21 hours                                                              r-jenkins_jenkins-primary_jenkins-plugins_1

a905c0b003fe        opensaas/concrete5:latest            "apache2-foreground"     22 hours ago        Up 21 hours               80/tcp                                         r-Concrete5_Concrete5App_1

bc9825ef1818        mysql:latest                         "docker-entrypoint.sh"   22 hours ago        Up 21 hours               3306/tcp                                       r-Concrete5_CMSMysql_1

bd9f804d9ccc        owncloud:latest                      "/entrypoint.sh apach"   23 hours ago        Up 21 hours               0.0.0.0:80->80/tcp                             r-owncloud_owncloud_1

0a801449b132        wordpress:latest                     "docker-entrypoint.sh"   23 hours ago        Up 21 hours               0.0.0.0:9098->80/tcp                           r-wordpress_wordpress_1

d723cdceb8f0        mariadb:latest                       "docker-entrypoint.sh"   23 hours ago        Up 21 hours               3306/tcp                                       r-wordpress_db_1

286de803b06c        gogs/gogs:latest                     "docker/start.sh /bin"   23 hours ago        Up 21 hours               0.0.0.0:222->22/tcp, 0.0.0.0:9093->3000/tcp    r-gogs_gogs_1

99697671f552        mariadb:latest                       "docker-entrypoint.sh"   24 hours ago        Up 21 hours               3306/tcp                                       r-owncloud_db_1

781376644b98        grafana/grafana:latest               "/run.sh"                24 hours ago        Up 21 hours               0.0.0.0:9094->3000/tcp                         r-grafana_grafana_1

 

在server节点,使用docker查询当前系统使用的卷组信息,将以上操作命令及检查结果填入命令行界面。

# docker volume ls

DRIVER              VOLUME NAME

local               0f272e99d983c52b7a1099b47158f261a3c8ed3b69ad6857980328bb37469c25

local               a4d71a18abf39258d66bd22e444d0b3740b1d09284035f0987d6faf4ee78ec17

local               a94e079509a6e13d69989d6a3b1bd478640cd57e47de1147939ee5dca68fbc6e

local               1211eb76e9d7f6302cb2a17de5a0a1077df10d069d35bb30dc11bf515d64e15f

server节点,启动镜像为ubuntu:14.04.3的镜像创建容器,容器挂载使用创建的为xd_volume的卷组挂载到root分区,完成后通过inspect指定查看容器的挂载情况,将以上操作命令及检查结果填入命令行界面。

[root@server opt]# docker volume create --name=xd_volume

xd_volume

[root@server opt]# docker run -dit -v xd_volume:/root/ ubuntu:14.04.3 /bin/bash

19fbb129fa1e0a0d2337305d9dd20a23bcaf5eabbb5d980bf99e7add0bbb563a

[root@server opt]# docker inspect -f '{{.HostConfig.Binds}}' 19fbb129fa1e

[xd_volume:/root/]

 

4.构建基础镜像

使用supermin5命令构建centos7系统的docker镜像,镜像名称为centos-7,镜像预装yum、net-tools、initscripts和vi命令,构建完成后提交镜像仓库上传操作完成后以运行该容器,查询容器的操作系统版本信息,提交查询docker容器列表信息、以上所有操作命令及执行结果填入命令行界面。

# supermin5 -v --prepare bash yum  net-tools initscripts  vi coreutils -o supermin.d

# supermin5 -v --build --format chroot supermin.d -o appliance.d

# echo 7 > appliance.d/etc/yum/vars/releasever

# tar --numeric-owner -cpf centos-7.tar -C appliance.d .

# cat centos-7.tar | docker import - 192.168.200.12:5000/centos-7

# docker push 192.168.200.12:5000/centos-7:latest

# docker run -i -t --rm 192.168.200.12:5000/centos-7 /bin/bash    

bash-4.2# cat /etc/redhat-release

Derived from Red Hat Enterprise Linux 7.1 (Source)

# docker images

REPOSITORY                                   TAG                 IMAGE ID            CREATED             SIZE

192.168.200.12:5000/centos-7                      latest              e40242986ac3        3 minutes ago       258.1 MB

5. 状态删除

在client节点查看各容器的id,使用过滤将所有处于Exited状态的容器删除,将操作命令及查询结果填入命令行界面。

# docker ps -a

CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS                      PORTS                                          NAMES

9da098d227fb        ubuntu:14.04.3                   "/bin/bash"              5 minutes ago       Up 5 minutes                                                               insane_snyder

7d85d770ffe9        opensaas/concrete5:latest        "apache2-foreground"     24 minutes ago      Up 24 minutes               80/tcp                                         r-Concrete5_Concrete5App_1

20bd10052310        opensaas/concrete5:latest        "bash -c 'chown -R ww"   24 minutes ago      Exited (1) 22 minutes ago                                                  r-Concrete5_Concrete5App_CMSConfig_1

f723b2459935        mysql:latest                     "docker-entrypoint.sh"   25 minutes ago      Up 25 minutes               3306/tcp                                       r-Concrete5_CMSMysql_1

cf2cee039edd        jenkins:1.651.3                  "/usr/share/jenkins/r"   30 minutes ago      Up 30 minutes               50000/tcp, 0.0.0.0:8082->8080/tcp              r-jenkins-ci_jenkins-primary_1

aaa85cc7d545        rancher/jenkins-plugins:v0.1.1   "/confd --backend ran"   31 minutes ago      Up 31 minutes                                                              r-jenkins-ci_jenkins-primary_jenkins-plugins_1

2376ca341634        busybox:latest                   "chown -R 1000:1000 /"   31 minutes ago      Exited (0) 31 minutes ago                                                  r-jenkins-ci_jenkins-primary_jenkins-datavolume_1

cc79715e0c5b        wordpress:latest                 "docker-entrypoint.sh"   37 minutes ago      Up 37 minutes               0.0.0.0:8083->80/tcp                           r-wordpress_wordpress_1

76d025a120d4        mariadb:latest                   "docker-entrypoint.sh"   38 minutes ago      Up 38 minutes               3306/tcp                                       r-wordpress_db_1

3d3926cbc40a        rancher/agent-instance:v0.8.3    "/etc/init.d/agent-in"   38 minutes ago      Up 38 minutes               0.0.0.0:500->500/udp, 0.0.0.0:4500->4500/udp   5e748e03-3ff0-472c-893a-73567bf1dab8

fb31f3d1f253        rancher/agent:v1.0.2             "/run.sh run"            40 minutes ago      Up 40 minutes                                                              rancher-agent

fd07017d0dde        rancher/agent:v1.0.2             "/run.sh state"          40 minutes ago      Exited (0) 40 minutes ago                                                  rancher-agent-state

5a8aaf8075b4        rancher/agent:v1.0.2             "/run.sh http://192.1"   40 minutes ago      Exited (0) 40 minutes ago                                                  modest_carson

# docker rm $(docker ps -a -q -f status=exited)

cf2cee039edd

aaa85cc7d545

2376ca341634

fd07017d0dde

Failed to remove container (5a8aaf8075b4): Error response from daemon: Unable to remove filesystem for 5a8aaf8075b4962e99e254dac662960812d352ef282821330c2c2213be5d040b: remove /var/lib/docker/containers/5a8aaf8075b4962e99e254dac662960812d352ef282821330c2c2213be5d040b/shm: device or resource busy

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐