docker 学习操作记录 2

记录2

   1 [BEGIN] 2019/12/4 13:56:06
   2 Connecting to 192.168.114.130:22...
   3 Connection established.
   4 To escape to local shell, press Ctrl+Alt+].
   5 
   6 Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-70-generic x86_64)
   7 
   8  * Documentation:  https://help.ubuntu.com
   9  * Management:     https://landscape.canonical.com
  10  * Support:        https://ubuntu.com/advantage
  11 
  12  * Overheard at KubeCon: "microk8s.status just blew my mind".
  13 
  14      https://microk8s.io/docs/commands#microk8s.status
  15 
  16 3 个可升级软件包。
  17 0 个安全更新。
  18 
  19 New release '18.04.3 LTS' available.
  20 Run 'do-release-upgrade' to upgrade to it.
  21 
  22 *** 需要重启系统 ***
  23 Last login: Wed Dec  4 13:20:35 2019 from 192.168.114.1
  24 Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-70-generic x86_64)
  25  * Documentation:  https://help.ubuntu.com
  26  * Management:     https://landscape.canonical.com
  27  * Support:        https://ubuntu.com/advantage
  28  * Overheard at KubeCon: "microk8s.status just blew my mind".
  29      https://microk8s.io/docs/commands#microk8s.status
  30 3 个可升级软件包。
  31 0 个安全更新。
  32 New release '18.04.3 LTS' available.
  33 Run 'do-release-upgrade' to upgrade to it.
  34 *** 需要重启系统 ***
  35 Last login: Wed Dec  4 13:20:35 2019 from 192.168.114.1
  36 root@coder:~# whoami
  37 root
  38 root@coder:~# ls
  39 root@coder:~# 
  40 root@coder:~# 
  41 root@coder:~# su - coder
  42 -->@coder:~$ ls
  43 code  examples.desktop  公共的  模板  视频  图片  文档  下载  音乐  桌面
  44 -->@coder:~$ 
  45 -->@coder:~$ 
  46 -->@coder:~$ pwd
  47 /home/coder
  48 -->@coder:~$ cd ..
  49 -->@coder:/home$ ls
  50 coder
  51 -->@coder:/home$ cd coder
  52 -->@coder:~$ ls
  53 code  examples.desktop  公共的  模板  视频  图片  文档  下载  音乐  桌面
  54 -->@coder:~$ mkdir myninx
  55 -->@coder:~$ cd myninx/
  56 -->@coder:~/myninx$ ls
  57 -->@coder:~/myninx$ touch Dockerfile
  58 -->@coder:~/myninx$ ls
  59 Dockerfile
  60 -->@coder:~/myninx$ FROM nginx
  61 FROM:未找到命令
  62 -->@coder:~/myninx$ ls
  63 Dockerfile
  64 -->@coder:~/myninx$ 
  65 -->@coder:~/myninx$ vim Dockerfile 
  66   1 
  67   1 FROM nginx
  68   1 FROM nginx
  69   2 RUN echo '<h1> hello, Docker1<h1>' > /usr/share/nginx/html/index.html
  70 ~                                                                                                                                                                        
  71 ~                                                                                                                                                                        
  72 ~                                                                                                                                                                        
  73 ~                                                                                                                                                                        
  74 ~                                                                                                                                                                        
  75 ~                                                                                                                                                                        
  76 "Dockerfile" 2L, 81C 已写入
  77 -->@coder:~/myninx$ docker search redis
  78 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/search?limit=25&term=redis: dial unix /var/run/docker.sock: connect: permission denied
  79 -->@coder:~/myninx$ sudo docker search redis
  80 [sudo] coder 的密码: 
  81 NAME                             DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
  82 redis                            Redis is an open source key-value store that…   7587                [OK]                
  83 bitnami/redis                    Bitnami Redis Docker Image                      133                                     [OK]
  84 sameersbn/redis                                                                  78                                      [OK]
  85 grokzen/redis-cluster            Redis cluster 3.0, 3.2, 4.0 & 5.0               62                                      
  86 rediscommander/redis-commander   Alpine image for redis-commander - Redis man32                                      [OK]
  87 kubeguide/redis-master           redis-master with "Hello World!"                31                                      
  88 redislabs/redis                  Clustered in-memory database engine compatib…   24                                      
  89 arm32v7/redis                    Redis is an open source key-value store that…   20                                      
  90 oliver006/redis_exporter          Prometheus Exporter for Redis Metrics. Supp…   18                                      
  91 redislabs/redisearch             Redis With the RedisSearch module pre-loaded…   17                                      
  92 webhippie/redis                  Docker images for Redis                         10                                      [OK]
  93 s7anley/redis-sentinel-docker    Redis Sentinel                                  9                                       [OK]
  94 insready/redis-stat              Docker image for the real-time Redis monitor…   9                                       [OK]
  95 bitnami/redis-sentinel           Bitnami Docker Image for Redis Sentinel         8                                       [OK]
  96 redislabs/redisgraph             A graph database module for Redis               8                                       [OK]
  97 arm64v8/redis                    Redis is an open source key-value store that…   6                                       
  98 redislabs/redismod               An automated build of redismod - latest Redi…   5                                       [OK]
  99 centos/redis-32-centos7          Redis in-memory data structure store, used a…   4                                       
 100 circleci/redis                   CircleCI images for Redis                       2                                       [OK]
 101 frodenas/redis                   A Docker Image for Redis                        2                                       [OK]
 102 runnable/redis-stunnel           stunnel to redis provided by linking contain…   1                                       [OK]
 103 tiredofit/redis                  Redis Server w/ Zabbix monitoring and S6 Ove…   1                                       [OK]
 104 wodby/redis                      Redis container image with orchestration        1                                       [OK]
 105 xetamus/redis-resource           forked redis-resource                           0                                       [OK]
 106 cflondonservices/redis           Docker image for running redis                  0                                       
 107 -->@coder:~/myninx$ sudo docker search mysql
 108 NAME                              DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 109 mysql                             MySQL is a widely used, open-source relation…   8891                [OK]                
 110 mariadb                           MariaDB is a community-developed fork of MyS…   3126                [OK]                
 111 mysql/mysql-server                Optimized MySQL Server Docker images. Create…   657                                     [OK]
 112 centos/mysql-57-centos7           MySQL 5.7 SQL database server                   64                                      
 113 centurylink/mysql                 Image containing mysql. Optimized to be link…   61                                      [OK]
 114 mysql/mysql-cluster               Experimental MySQL Cluster Docker images. Cr…   58                                      
 115 deitch/mysql-backup               REPLACED! Please use http://hub.docker.com/r…   41                                      [OK]
 116 bitnami/mysql                     Bitnami MySQL Docker Image                      35                                      [OK]
 117 tutum/mysql                       Base docker image to run a MySQL database se…   34                                      
 118 schickling/mysql-backup-s3        Backup MySQL to S3 (supports periodic backup…   28                                      [OK]
 119 prom/mysqld-exporter                                                              23                                      [OK]
 120 linuxserver/mysql                 A Mysql container, brought to you by LinuxSe…   22                                      
 121 centos/mysql-56-centos7           MySQL 5.6 SQL database server                   17                                      
 122 circleci/mysql                    MySQL is a widely used, open-source relation…   16                                      
 123 mysql/mysql-router                MySQL Router provides transparent routing be…   14                                      
 124 arey/mysql-client                 Run a MySQL client from a docker container      12                                      [OK]
 125 openshift/mysql-55-centos7        DEPRECATED: A Centos7 based MySQL v5.5 image…   6                                       
 126 yloeffler/mysql-backup            This image runs mysqldump to backup data usi…   6                                       [OK]
 127 fradelg/mysql-cron-backup         MySQL/MariaDB database backup using cron tas…   4                                       [OK]
 128 genschsa/mysql-employees          MySQL Employee Sample Database                  3                                       [OK]
 129 devilbox/mysql                    Retagged MySQL, MariaDB and PerconaDB offici…   2                                       
 130 ansibleplaybookbundle/mysql-apb   An APB which deploys RHSCL MySQL                2                                       [OK]
 131 jelastic/mysql                    An image of the MySQL database server mainta…   1                                       
 132 monasca/mysql-init                A minimal decoupled init container for mysql    0                                       
 133 widdpim/mysql-client              Dockerized MySQL Client (5.7) including Curl…   0                                       [OK]
 134 -->@coder:~/myninx$ sudo docker search httpd
 135 NAME                                 DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 136 httpd                                The Apache HTTP Server Project                  2760                [OK]                
 137 centos/httpd-24-centos7              Platform for running Apache httpd 2.4 or bui…   26                                      
 138 centos/httpd                                                                         26                                      [OK]
 139 armhf/httpd                          The Apache HTTP Server Project                  8                                       
 140 salim1983hoop/httpd24                Dockerfile running apache config                2                                       [OK]
 141 dariko/httpd-rproxy-ldap             Apache httpd reverse proxy with LDAP authent…   1                                       [OK]
 142 solsson/httpd-openidc                mod_auth_openidc on official httpd image, ve…   1                                       [OK]
 143 lead4good/httpd-fpm                  httpd server which connects via fcgi proxy h…   1                                       [OK]
 144 manasip/httpd                                                                        0                                       
 145 itsziget/httpd24                     Extended HTTPD Docker image based on the off…   0                                       [OK]
 146 dockerpinata/httpd                                                                   0                                       
 147 interlutions/httpd                   httpd docker image with debian-based config …   0                                       [OK]
 148 manageiq/httpd_configmap_generator   Httpd Configmap Generator                       0                                       [OK]
 149 appertly/httpd                       Customized Apache HTTPD that uses a PHP-FPM …   0                                       [OK]
 150 izdock/httpd                         Production ready Apache HTTPD Web Server + m…   0                                       
 151 trollin/httpd                                                                        0                                       
 152 amd64/httpd                          The Apache HTTP Server Project                  0                                       
 153 publici/httpd                        httpd:latest                                    0                                       [OK]
 154 e2eteam/httpd                                                                        0                                       
 155 buzzardev/httpd                      Based on the official httpd image               0                                       [OK]
 156 manageiq/httpd                       Container with httpd, built on CentOS for Ma…   0                                       [OK]
 157 ppc64le/httpd                        The Apache HTTP Server Project                  0                                       
 158 alvistack/httpd                      Docker Image Packaging for Apache               0                                       [OK]
 159 hypoport/httpd-cgi                   httpd-cgi                                       0                                       [OK]
 160 tugboatqa/httpd                      The Apache HTTP Server Project                  0                                       
 161 -->@coder:~/myninx$ sudo docker search php
 162 NAME                            DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 163 php                             While designed for web development, the PHP …   4910                [OK]                
 164 phpmyadmin/phpmyadmin           A web interface for MySQL and MariaDB.          900                                     [OK]
 165 php-zendserver                  Zend Server - the integrated PHP application…   173                 [OK]                
 166 webdevops/php-nginx             Nginx with PHP-FPM                              144                                     [OK]
 167 webdevops/php-apache-dev        PHP with Apache for Development (eg. with xd…   114                                     [OK]
 168 webdevops/php-apache            Apache with PHP-FPM (based on webdevops/php)    96                                      [OK]
 169 bitnami/php-fpm                 Bitnami PHP-FPM Docker Image                    82                                      [OK]
 170 phpunit/phpunit                 PHPUnit is a programmer-oriented testing fra…   74                                      [OK]
 171 nazarpc/phpmyadmin              phpMyAdmin as Docker container, based on off…   60                                      [OK]
 172 thecodingmachine/php            General-purpose ultra-configurable PHP images   26                                      [OK]
 173 circleci/php                    CircleCI images for PHP                         25                                      
 174 phpdockerio/php72-fpm           PHP 7.2 FPM base container for PHPDocker.io.    18                                      [OK]
 175 adrianharabula/php7-with-oci8   Latest PHP 7.1 with apache and Oracle oci8      18                                      [OK]
 176 bitnami/phpmyadmin              Bitnami Docker Image for phpMyAdmin             15                                      [OK]
 177 phpdockerio/php7-fpm            PHP 7 FPM base container for PHPDocker.io.      14                                      [OK]
 178 devilbox/php-fpm                PHP-FPM Docker images based on original PHP …   14                                      
 179 graze/php-alpine                Smallish php7 alpine image with some common …   12                                      [OK]
 180 phpdockerio/php56-fpm           PHP 5.6 FPM base container for PHPDocker.io     10                                      [OK]
 181 appsvc/php                      Azure App Service php dockerfiles               10                                      [OK]
 182 phpdockerio/php71-fpm           PHP 7.1 FPM base container for PHPDocker.io.    7                                       [OK]
 183 phpdockerio/php72-cli           PHP 7.2 CLI base container for PHPDocker.io.    4                                       [OK]
 184 phpdockerio/php7-cli            PHP 7 CLI base container image for PHPDocker…   1                                       [OK]
 185 phpdockerio/php71-cli           PHP 7.1 CLI base container for PHPDocker.io.    1                                       [OK]
 186 phpdockerio/php56-cli           PHP 5.6 CLI base container for PHPDocker.io …   1                                       [OK]
 187 isotopab/php                    Docker PHP                                      0                                       [OK]
 188 -->@coder:~/myninx$ sudo docker search tomcat
 189 NAME                          DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 190 tomcat                        Apache Tomcat is an open source implementati…   2574                [OK]                
 191 tomee                         Apache TomEE is an all-Apache Java EE certif…   71                  [OK]                
 192 dordoka/tomcat                Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 base…   53                                      [OK]
 193 bitnami/tomcat                Bitnami Tomcat Docker Image                     30                                      [OK]
 194 kubeguide/tomcat-app          Tomcat image for Chapter 1                      28                                      
 195 consol/tomcat-7.0             Tomcat 7.0.57, 8080, "admin/admin"              16                                      [OK]
 196 cloudesire/tomcat             Tomcat server, 6/7/8                            15                                      [OK]
 197 aallam/tomcat-mysql           Debian, Oracle JDK, Tomcat & MySQL              12                                      [OK]
 198 tutum/tomcat                  Base docker image to run a Tomcat applicatio…   11                                      
 199 arm32v7/tomcat                Apache Tomcat is an open source implementati…   10                                      
 200 rightctrl/tomcat              CentOS , Oracle Java, tomcat application ssl…   5                                       [OK]
 201 maluuba/tomcat7-java8         Tomcat7 with java8.                             4                                       
 202 arm64v8/tomcat                Apache Tomcat is an open source implementati…   2                                       
 203 amd64/tomcat                  Apache Tomcat is an open source implementati…   2                                       
 204 oobsri/tomcat8                Testing CI Jobs with different names.           1                                       
 205 camptocamp/tomcat-logback     Docker image for tomcat with logback integra…   1                                       [OK]
 206 i386/tomcat                   Apache Tomcat is an open source implementati…   1                                       
 207 99taxis/tomcat7               Tomcat7                                         1                                       [OK]
 208 ppc64le/tomcat                Apache Tomcat is an open source implementati…   1                                       
 209 secoresearch/tomcat-varnish   Tomcat and Varnish 5.0                          0                                       [OK]
 210 picoded/tomcat7               tomcat7 with jre8 and MANAGER_USER / MANAGER…   0                                       [OK]
 211 s390x/tomcat                  Apache Tomcat is an open source implementati…   0                                       
 212 jelastic/tomcat               An image of the Tomcat Java application serv…   0                                       
 213 appsvc/tomcat                                                                 0                                       
 214 cfje/tomcat-resource          Tomcat Concourse Resource                       0                                       
 215 -->@coder:~/myninx$ sudo docker search node
 216 NAME                                   DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 217 node                                   Node.js is a JavaScript-based platform for s…   8147                [OK]                
 218 mongo-express                          Web-based MongoDB admin interface, written w563                 [OK]                
 219 nodered/node-red-docker                Deprecated - older Node-RED Docker images.      342                                     [OK]
 220 selenium/node-chrome                                                                   201                                     [OK]
 221 prom/node-exporter                                                                     158                                     [OK]
 222 selenium/node-firefox                                                                  128                                     [OK]
 223 circleci/node                          Node.js is a JavaScript-based platform for s…   99                                      
 224 readytalk/nodejs                       Node.js based off the official Debian Wheezy…   51                                      [OK]
 225 kkarczmarczyk/node-yarn                Node docker image with yarn package manager …   48                                      [OK]
 226 digitallyseamless/nodejs-bower-grunt    Node.js w/ Bower & Grunt Dockerfile for tru…   48                                      [OK]
 227 bitnami/node                           Bitnami Node.js Docker Image                    40                                      [OK]
 228 iron/node                              Tiny Node image                                 29                                      
 229 calico/node                                                                            17                                      [OK]
 230 appsvc/node                            Azure App Service Node.js dockerfiles           13                                      [OK]
 231 centos/nodejs-8-centos7                Platform for building and running Node.js 810                                      
 232 cusspvz/node                           🌐 Super small Node.js container (~15MB) bas…    7                                       [OK]
 233 basi/node-exporter                     Node exporter image that allows to expose th…   7                                       [OK]
 234 centos/nodejs-6-centos7                Platform for building and running Node.js 64                                       
 235 ppc64le/node                           Node.js is a JavaScript-based platform for s…   2                                       
 236 openwhisk/nodejs6action                Apache OpenWhisk runtime for Node.js v6 Acti…   2                                       [OK]
 237 ogazitt/node-env                       node app that shows environment variables       1                                       
 238 nodecg/nodecg                          Create broadcast graphics using Node.js and …   1                                       [OK]
 239 camptocamp/node-collectd               rancher node monitoring agent                   0                                       [OK]
 240 testim/node-chrome                     Selenium Chrome Node + Testim Extension         0                                       [OK]
 241 appsvctest/node                        node build                                      0                                       [OK]
 242 -->@coder:~/myninx$ sudo docker search openjdk
 243 NAME                            DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 244 openjdk                         OpenJDK is an open-source implementation of …   2009                [OK]                
 245 adoptopenjdk/openjdk11          Docker Images for OpenJDK Version 11 binarie…   64                                      
 246 oracle/openjdk                  Docker images containing OpenJDK Oracle Linux   57                                      [OK]
 247 adoptopenjdk/openjdk8           Docker Images for OpenJDK Version 8 binaries…   50                                      
 248 adoptopenjdk/openjdk8-openj9    Docker Images for Eclipse OpenJ9 Version 8 b…   30                                      
 249 adoptopenjdk/openjdk11-openj9   Docker Images for Eclipse OpenJ9 Version 1123                                      
 250 adoptopenjdk/openjdk12          Docker Images for OpenJDK Version 12 binarie…   15                                      
 251 shipilev/openjdk                OpenJDK development builds                      11                                      
 252 arm32v7/openjdk                 OpenJDK is an open-source implementation of …   10                                      
 253 arm64v8/openjdk                 OpenJDK is an open-source implementation of …   9                                       
 254 circleci/openjdk                CircleCI images for OpenJDK                     5                                       [OK]
 255 adoptopenjdk/openjdk10          Docker Images for OpenJDK Version 10 binarie…   3                                       
 256 adoptopenjdk/openjdk9           Docker Images for OpenJDK Version 9 binaries…   2                                       
 257 opennms/openjdk                 Base image providing OpenJDK for OpenNMS ser…   2                                       [OK]
 258 i386/openjdk                    OpenJDK is an open-source implementation of …   1                                       
 259 symphonicsoft/openjdkbase       Openjdk base images with dumb-init and gette…   1                                       
 260 winamd64/openjdk                OpenJDK is an open-source implementation of …   1                                       
 261 cfje/openjdk                    OpenJDK Builder Image                           0                                       
 262 classmethod/openjdk-with-git    docker image for openjdk and git                0                                       [OK]
 263 suranagivinod/openjdk8          openjdk:8-jre-slim, zip & unzip                 0                                       
 264 amd64/openjdk                   OpenJDK is an open-source implementation of …   0                                       
 265 ccistaging/openjdk              CircleCI images for OpenJDK                     0                                       [OK]
 266 ccitest/openjdk                 CircleCI test images for OpenJDK                0                                       [OK]
 267 trollin/openjdk                                                                 0                                       
 268 s390x/openjdk                   OpenJDK is an open-source implementation of …   0                                       
 269 -->@coder:~/myninx$ sudo docker search python
 270 NAME                             DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 271 python                           Python is an interpreted, interactive, objec…   4736                [OK]                
 272 django                           Django is a free web application framework, …   902                 [OK]                
 273 pypy                             PyPy is a fast, compliant alternative implem…   222                 [OK]                
 274 kaggle/python                    Docker image for Python scripts run on Kaggle   130                                     [OK]
 275 arm32v7/python                   Python is an interpreted, interactive, objec…   43                                      
 276 joyzoursky/python-chromedriver   Python with Chromedriver, for running automa…   39                                      [OK]
 277 centos/python-35-centos7         Platform for building and running Python 3.537                                      
 278 circleci/python                  Python is an interpreted, interactive, objec…   33                                      
 279 nikolaik/python-nodejs           Python with Node.js                             31                                      [OK]
 280 centos/python-36-centos7         Platform for building and running Python 3.623                                      
 281 hylang                           Hy is a Lisp dialect that translates express…   23                  [OK]                
 282 arm64v8/python                   Python is an interpreted, interactive, objec…   18                                      
 283 centos/python-27-centos7         Platform for building and running Python 2.716                                      
 284 publicisworldwide/python-conda   Basic Python environments with Conda.           6                                       [OK]
 285 bitnami/python                   Bitnami Python Docker Image                     4                                       [OK]
 286 dockershelf/python               Repository for docker images of Python. Test…   4                                       [OK]
 287 i386/python                      Python is an interpreted, interactive, objec…   3                                       
 288 komand/python-plugin             DEPRECATED: Komand Python SDK                   2                                       [OK]
 289 ppc64le/python                   Python is an interpreted, interactive, objec…   2                                       
 290 centos/python-34-centos7         Platform for building and running Python 3.42                                       
 291 amd64/python                     Python is an interpreted, interactive, objec…   1                                       
 292 openshift/python-33-centos7      DEPRECATED: A Centos7 based Python v3.3 imag…   0                                       
 293 ccitest/python                   CircleCI test images for Python                 0                                       [OK]
 294 qbtrade/python                   python 3.6.5 with requirements last update s…   0                                       
 295 saagie/python                    Repo for python jobs                            0                                       
 296 -->@coder:~/myninx$ sudo docker search python3.8
 297 NAME                           DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 298 czentye/opencv-video-minimal   OpenCV 4.1.2 with Python3.8 and video suppor…   1                                       [OK]
 299 wfarn86/python3.8-requests                                                     0                                       
 300 arhatdev/python3.8                                                             0                                       
 301 jesavius/python3.8                                                             0                                       
 302 7orb1/python3.8                                                                0                                       
 303 blbraner/python3.8.0                                                           0                                       
 304 vadosl/python3.8                                                               0                                       
 305 voidsnax/python3.8-build                                                       0                                       
 306 codewarsnl/codewars            Pre-installed python3.8 with the codewars li…   0                                       
 307 ayixi/centos                   python3.8                                       0                                       
 308 -->@coder:~/myninx$ sudo docker search ruby
 309 NAME                         DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 310 ruby                         Ruby is a dynamic, reflective, object-orient…   1782                [OK]                
 311 circleci/ruby                Ruby is a dynamic, reflective, object-orient…   65                                      
 312 starefossen/ruby-node        Docker Image with Ruby and Node.js installed    32                                      [OK]
 313 heroku/ruby                  Docker Image for Heroku Ruby                    22                                      [OK]
 314 rubylang/ruby                Experimental Ruby docker images officially p…   18                                      
 315 bitnami/ruby                 Bitnami Ruby Docker Image                       17                                      [OK]
 316 iron/ruby                    Tiny Ruby image.                                7                                       
 317 hoteltonight/ruby-jemalloc   Fork of official Ruby image but compiled jem…   5                                       
 318 centos/ruby-23-centos7       Platform for building and running Ruby 2.3 a…   4                                       
 319 centos/ruby-24-centos7       Platform for building and running Ruby 2.4 a…   3                                       
 320 centos/ruby-22-centos7       Platform for building and running Ruby 2.2 a…   3                                       
 321 openshift/ruby-20-centos7    DEPRECATED: A Centos7 based Ruby v2.0 image …   3                                       
 322 centos/ruby-25-centos7       Platform for building and running Ruby 2.5 a…   2                                       
 323 appsvc/ruby                  ruby                                            2                                       [OK]
 324 instructure/ruby             Instructure base ruby image                     2                                       [OK]
 325 ppc64le/ruby                 Ruby is a dynamic, reflective, object-orient…   1                                       
 326 thredup/ruby                 A base image for ruby-lang.                     1                                       [OK]
 327 i386/ruby                    Ruby is a dynamic, reflective, object-orient…   1                                       
 328 instructure/ruby-passenger   Instructure ruby passenger images               1                                       [OK]
 329 ccitest/ruby                 CircleCI test images for Ruby                   0                                       [OK]
 330 resource/rubygems            RubyGems Integration for Concourse Pipelines    0                                       [OK]
 331 appsvctest/ruby              ruby build                                      0                                       [OK]
 332 kapost/ruby                  Ruby rbenv and ruby runtime environment         0                                       [OK]
 333 wealthsimple/ruby            Base Ruby image for VPC services.               0                                       
 334 bedrockibm/ruby-runtime      Prepackaged ruby runtime.                       0                                       
 335 -->@coder:~/myninx$ sudo docker search golang
 336 NAME                               DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 337 golang                             Go (golang) is a general purpose, higher-lev…   2940                [OK]                
 338 ilanyu/golang-reverseproxy         golang-ReverseProxy                             81                                      [OK]
 339 circleci/golang                    CircleCI images for Go                          14                                      [OK]
 340 golangci/golangci-lint                                                             6                                       
 341 portainer/golang-builder           Utility to build Golang binaries.               4                                       [OK]
 342 desertbit/golang-gb                Golang GB Docker Image                          4                                       [OK]
 343 comptel/golang-kafkaclient         Official golang image plus the kafka client …   3                                       [OK]
 344 mxschmitt/golang_url_shortener     URL Shortener written in Golang using Bolt D…   3                                       
 345 instructure/golang                 Instructure base golang image                   2                                       [OK]
 346 theyorkshiredev/golang-git         A custom container with Golang and Git insta…   2                                       [OK]
 347 webhippie/golang                   Docker images for Golang                        1                                       [OK]
 348 golangci/build-runner              Image for running analysis (build) for https…   1                                       
 349 amsokol/golang-openshift                                                           1                                       
 350 mpfmedical/golang-glide            golang:1.7 with glide installed                 1                                       
 351 nimmis/golang                      Builds a Docker container with golang on ubu…   1                                       [OK]
 352 eugenmayer/golang-glide            golang official alpine with glide / git prei…   1                                       
 353 pivotalcfreleng/golang                                                             0                                       
 354 kaiterra/golang-base               small-ish base image for golang that works w0                                       [OK]
 355 creack/golang-dcind                Golang with Docker in Docker                    0                                       
 356 cloudfoundry/golang-ci                                                             0                                       
 357 cfinfrastructure/golang                                                            0                                       
 358 strarsis/golang-nightly            Docker image packaging for golang nightly bu…   0                                       [OK]
 359 jelastic/golang                    An image of the Golang application server ma…   0                                       
 360 jetbrainsinfra/golang              Golang + custom build tools                     0                                       [OK]
 361 pivotalcfreleng/golang-om-source                                                   0                                       
 362 -->@coder:~/myninx$ sudo docker search ubuntu
 363 NAME                                                      DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 364 ubuntu                                                    Ubuntu is a Debian-based Linux operating sys…   10225               [OK]                
 365 dorowu/ubuntu-desktop-lxde-vnc                            Docker image to provide HTML5 VNC interface …   367                                     [OK]
 366 rastasheep/ubuntu-sshd                                    Dockerized SSH service, built on top of offi…   236                                     [OK]
 367 consol/ubuntu-xfce-vnc                                    Ubuntu container with "headless" VNC session…   199                                     [OK]
 368 ubuntu-upstart                                            Upstart is an event-based replacement for th…   102                 [OK]                
 369 ansible/ubuntu14.04-ansible                               Ubuntu 14.04 LTS with ansible                   98                                      [OK]
 370 neurodebian                                               NeuroDebian provides neuroscience research s…   61                  [OK]                
 371 1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5      ubuntu-16-nginx-php-phpmyadmin-mysql-5          50                                      [OK]
 372 ubuntu-debootstrap                                        debootstrap --variant=minbase --components=m…   41                  [OK]                
 373 nuagebec/ubuntu                                           Simple always updated Ubuntu docker images w24                                      [OK]
 374 i386/ubuntu                                               Ubuntu is a Debian-based Linux operating sys…   18                                      
 375 1and1internet/ubuntu-16-apache-php-5.6                    ubuntu-16-apache-php-5.6                        14                                      [OK]
 376 1and1internet/ubuntu-16-apache-php-7.0                    ubuntu-16-apache-php-7.0                        13                                      [OK]
 377 1and1internet/ubuntu-16-nginx-php-phpmyadmin-mariadb-10   ubuntu-16-nginx-php-phpmyadmin-mariadb-10       11                                      [OK]
 378 1and1internet/ubuntu-16-nginx-php-5.6                     ubuntu-16-nginx-php-5.6                         8                                       [OK]
 379 1and1internet/ubuntu-16-nginx-php-5.6-wordpress-4         ubuntu-16-nginx-php-5.6-wordpress-4             7                                       [OK]
 380 1and1internet/ubuntu-16-apache-php-7.1                    ubuntu-16-apache-php-7.1                        6                                       [OK]
 381 darksheer/ubuntu                                          Base Ubuntu Image -- Updated hourly             5                                       [OK]
 382 1and1internet/ubuntu-16-nginx-php-7.0                     ubuntu-16-nginx-php-7.0                         4                                       [OK]
 383 pivotaldata/ubuntu                                        A quick freshening-up of the base Ubuntu doc…   2                                       
 384 1and1internet/ubuntu-16-php-7.1                           ubuntu-16-php-7.1                               1                                       [OK]
 385 smartentry/ubuntu                                         ubuntu with smartentry                          1                                       [OK]
 386 pivotaldata/ubuntu-gpdb-dev                               Ubuntu images for GPDB development              1                                       
 387 pivotaldata/ubuntu16.04-build                             Ubuntu 16.04 image for GPDB compilation         1                                       
 388 1and1internet/ubuntu-16-sshd                              ubuntu-16-sshd                                  1                                       [OK]
 389 -->@coder:~/myninx$ sudo docker search debian
 390 NAME                                                 DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 391 ubuntu                                               Ubuntu is a Debian-based Linux operating sys…   10225               [OK]                
 392 debian                                               Debian is a Linux distribution that's compos…   3290                [OK]                
 393 arm32v7/debian                                       Debian is a Linux distribution that's compos…   62                                      
 394 itscaro/debian-ssh                                   debian:jessie                                   26                                      [OK]
 395 samueldebruyn/debian-git                             a minimal docker container with debian and g…   21                                      [OK]
 396 arm64v8/debian                                       Debian is a Linux distribution that's compos…   21                                      
 397 i386/debian                                          Debian is a Linux distribution that's compos…   10                                      
 398 multiarch/debian-debootstrap                         multiarch ports of debian-debootstrap           10                                      
 399 eboraas/debian                                       Debian base images, for all currently-availa…   8                                       [OK]
 400 vergissberlin/debian-development                     Docker debian image to use for development, …   6                                       [OK]
 401 smartentry/debian                                    debian with smartentry                          4                                       [OK]
 402 ppc64le/debian                                       Debian is a Linux distribution that's compos…   4                                       
 403 vicamo/debian                                        Debian docker images for all versions/archit…   3                                       
 404 vpgrp/debian                                         Docker images of Debian.                        2                                       
 405 s390x/debian                                         Debian is a Linux distribution that's compos…   2                                       
 406 arm32v5/debian                                       Debian is a Linux distribution that's compos…   2                                       
 407 dockershelf/debian                                   Repository for docker images of Debian. Test…   1                                       [OK]
 408 amd64/debian                                         Debian is a Linux distribution that's compos…   1                                       
 409 holgerimbery/debian                                  debian multiarch docker base image              1                                       
 410 1and1internet/debian-9-apache-php-7.1-shopware-5.4   Shopware on our Apache, PHP 7.1, Debian 9 ba…   1                                       [OK]
 411 casept/debian-amd64                                  A debian image built from scratch. Mostly fo…   0                                       
 412 spritsail/debian-builder                             A Docker image based on debian:slim ideal fo…   0                                       [OK]
 413 jdub/debian-sources-resource                         Concourse CI resource to check for updated D…   0                                       [OK]
 414 1and1internet/debian-9-nginx-php-7.2-wordpress-4     debian-9-nginx-php-7.2-wordpress-4              0                                       [OK]
 415 fleshgrinder/debian                                  Debian base images for production and multis…   0                                       [OK]
 416 -->@coder:~/myninx$ sudo docker search centos
 417 NAME                               DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 418 centos                             The official build of CentOS.                   5705                [OK]                
 419 ansible/centos7-ansible            Ansible on Centos7                              126                                     [OK]
 420 jdeathe/centos-ssh                 OpenSSH / Supervisor / EPEL/IUS/SCL Repos - …   114                                     [OK]
 421 consol/centos-xfce-vnc             Centos container with "headless" VNC session…   100                                     [OK]
 422 centos/mysql-57-centos7            MySQL 5.7 SQL database server                   64                                      
 423 imagine10255/centos6-lnmp-php56    centos6-lnmp-php56                              57                                      [OK]
 424 tutum/centos                       Simple CentOS docker image with SSH access      44                                      
 425 centos/postgresql-96-centos7       PostgreSQL is an advanced Object-Relational …   39                                      
 426 centos/python-35-centos7           Platform for building and running Python 3.537                                      
 427 kinogmt/centos-ssh                 CentOS with SSH                                 29                                      [OK]
 428 pivotaldata/centos-gpdb-dev        CentOS image for GPDB development. Tag names…   10                                      
 429 nathonfowlie/centos-jre            Latest CentOS image with the JRE pre-install8                                       [OK]
 430 drecom/centos-ruby                 centos ruby                                     6                                       [OK]
 431 mamohr/centos-java                 Oracle Java 8 Docker image based on Centos 7    3                                       [OK]
 432 darksheer/centos                   Base Centos Image -- Updated hourly             3                                       [OK]
 433 pivotaldata/centos                 Base centos, freshened up a little with a Do…   3                                       
 434 pivotaldata/centos-gcc-toolchain   CentOS with a toolchain, but unaffiliated wi…   2                                       
 435 pivotaldata/centos-mingw           Using the mingw toolchain to cross-compile t…   2                                       
 436 blacklabelops/centos               CentOS Base Image! Built and Updates Daily!     1                                       [OK]
 437 mcnaughton/centos-base             centos base image                               1                                       [OK]
 438 indigo/centos-maven                Vanilla CentOS 7 with Oracle Java Developmen…   1                                       [OK]
 439 pivotaldata/centos6.8-dev          CentosOS 6.8 image for GPDB development         0                                       
 440 pivotaldata/centos7-dev            CentosOS 7 image for GPDB development           0                                       
 441 smartentry/centos                  centos with smartentry                          0                                       [OK]
 442 fortinj66/centos7-s2i-nodejs       based off of ryanj/centos7-s2i-nodejs.  Bigg…   0                                       
 443 -->@coder:~/myninx$ sudo docker search fedora
 444 NAME                               DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 445 fedora                             Official Docker builds of Fedora                834                 [OK]                
 446 fedora/apache                                                                      36                                      [OK]
 447 fedora/nginx                                                                       20                                      [OK]
 448 mattsch/fedora-nzbhydra            Fedora NZBHydra                                 5                                       [OK]
 449 darksheer/fedora22                 Base Fedora 22 Image -- Updated hourly          3                                       [OK]
 450 vbatts/fedora-varnish              https://github.com/vbatts/laughing-octo/tree…   2                                       [OK]
 451 vergissberlin/fedora-development   Docker fedora image to use for development, …   2                                       [OK]
 452 darksheer/fedora23                 Hourly updated Fedora 23                        1                                       [OK]
 453 darksheer/fedora24                 Hourly update Fedora 24                         1                                       [OK]
 454 darksheer/fedora                   Hourly update latest Fedora Image               1                                       [OK]
 455 ppc64le/fedora                     Official Docker builds of Fedora                1                                       
 456 darksheer/fedora25                 Hourly updated Fedora 24 Docker Hub Image       1                                       [OK]
 457 rhub/fedora-gcc-devel              R-devel on Fedora latest                        0                                       
 458 mattsch/fedora-nzbhydra2           Fedora NZBHydra2 (Java based)                   0                                       [OK]
 459 smartentry/fedora                  fedora with smartentry                          0                                       [OK]
 460 dokken/fedora-latest               fedora-latest image for kitchen-dokken          0                                       
 461 langdon/fedora-mssqlserver         Microsoft SQL Server running on Fedora. You …   0                                       [OK]
 462 rhub/fedora-clang-devel            R-devel on Fedora latest, with clang and gfo…   0                                       
 463 ovirtguestagent/fedora-atomic      The oVirt Guest Agent for Fedora Atomic Host…   0                                       
 464 arm64v8/fedora                     Official Docker builds of Fedora                0                                       
 465 amd64/fedora                       Official Docker builds of Fedora                0                                       
 466 vcatechnology/fedora               A Fedora image that is updated daily            0                                       [OK]
 467 embreedocker/fedora                Automated build of Fedora Docker images for0                                       [OK]
 468 vcatechnology/fedora-ci            A Fedora image that is used in the VCA Techn…   0                                       [OK]
 469 mattsch/fedora-sonarr              Fedora Sonarr                                   0                                       [OK]
 470 -->@coder:~/myninx$ sudo docker search alpine
 471 NAME                                   DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 472 alpine                                 A minimal Docker image based on Alpine Linux…   5882                [OK]                
 473 mhart/alpine-node                      Minimal Node.js built on Alpine Linux           445                                     
 474 anapsix/alpine-java                    Oracle Java 8 (and 7) with GLIBC 2.28 over A…   431                                     [OK]
 475 frolvlad/alpine-glibc                  Alpine Docker image with glibc (~12MB)          221                                     [OK]
 476 gliderlabs/alpine                      Image based on Alpine Linux will help you wi…   180                                     
 477 mvertes/alpine-mongo                   light MongoDB container                         106                                     [OK]
 478 alpine/git                             A  simple git container running in alpine li…   105                                     [OK]
 479 yobasystems/alpine-mariadb             MariaDB running on Alpine Linux [docker] [am…   52                                      [OK]
 480 kiasaki/alpine-postgres                PostgreSQL docker image based on Alpine Linux   45                                      [OK]
 481 alpine/socat                           Run socat command in alpine container           41                                      [OK]
 482 davidcaste/alpine-tomcat               Apache Tomcat 7/8 using Oracle Java 7/8 with…   39                                      [OK]
 483 zzrot/alpine-caddy                     Caddy Server Docker Container running on Alp…   35                                      [OK]
 484 easypi/alpine-arm                      AlpineLinux for RaspberryPi                     32                                      
 485 jfloff/alpine-python                   A small, more complete, Python Docker image …   29                                      [OK]
 486 byrnedo/alpine-curl                    Alpine linux with curl installed and set as …   28                                      [OK]
 487 hermsi/alpine-sshd                     Dockerize your OpenSSH-server with rsync and…   26                                      [OK]
 488 etopian/alpine-php-wordpress           Alpine WordPress Nginx PHP-FPM WP-CLI           22                                      [OK]
 489 hermsi/alpine-fpm-php                  Dockerize your FPM PHP 7.4 upon a lightweigh…   21                                      [OK]
 490 zenika/alpine-chrome                   Chrome running in headless mode in a tiny Al…   15                                      [OK]
 491 bashell/alpine-bash                    Alpine Linux with /bin/bash as a default she…   14                                      [OK]
 492 davidcaste/alpine-java-unlimited-jce   Oracle Java 8 (and 7) with GLIBC 2.21 over A…   13                                      [OK]
 493 spotify/alpine                         Alpine image with `bash` and `curl`.            9                                       [OK]
 494 tenstartups/alpine                     Alpine linux base docker image with useful p…   9                                       [OK]
 495 roribio16/alpine-sqs                   Dockerized ElasticMQ server + web UI over Al…   7                                       [OK]
 496 cfmanteiga/alpine-bash-curl-jq         Docker Alpine image with Bash, curl and jq p…   4                                       [OK]
 497 -->@coder:~/myninx$ docker pull alpine
 498 Using default tag: latest
 499 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/create?fromImage=alpine&tag=latest: dial unix /var/run/docker.sock: connect: permission denied
 500 -->@coder:~/myninx$ sudo docker pull alpine
 501 Using default tag: latest
 502 latest: Pulling from library/alpine
 503 
 504 Digest: sha256:c19173c5ada610a5989151111163d28a67368362762534d8a8121ce95cf2bd5a
 505 Status: Downloaded newer image for alpine:latest
 506 docker.io/library/alpine:latest
 507 -->@coder:~/myninx$ docker image ls
 508 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json: dial unix /var/run/docker.sock: connect: permission denied
 509 -->@coder:~/myninx$ sudo docker image ls
 510 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
 511 nginx                         v2                  50776ea0e5a4        21 minutes ago      126MB
 512 nginx                         latest              231d40e811cd        11 days ago         126MB
 513 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
 514 centos                        latest              0f3e07c0138f        2 months ago        220MB
 515 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
 516 -->@coder:~/myninx$ sudo make
 517 make: *** 没有指明目标并且找不到 makefile。 停止。
 518 -->@coder:~/myninx$ man make
 519 MAKE(1)                                                                     User Commands                                                                    MAKE(1)
 520 
 521 NAME
 522        make - GNU make utility to maintain groups of programs
 523 
 524 SYNOPSIS
 525        make [OPTION]... [TARGET]...
 526 
 527 MAKE(1)                                                                     User Commands                                                                    MAKE(1)
 528 
 529 NAME
 530        make - GNU make utility to maintain groups of programs
 531 
 532 SYNOPSIS
 533        make [OPTION]... [TARGET]...
 534 
 535 MAKE(1)                                                                     User Commands                                                                    MAKE(1)
 536 
 537 NAME
 538        make - GNU make utility to maintain groups of programs
 539 
 540 SYNOPSIS
 541        make [OPTION]... [TARGET]...
 542 
 543 ...skipping...
 544        -C dir, --directory=dir
 545             Change to directory dir before reading the makefiles or doing anything else.  If multiple -C options are specified, each is interpreted relative to  the
 546             previous one: -C / -C etc is equivalent to -C /etc.  This is typically used with recursive invocations of make.
 547 
 548        -d   Print debugging information in addition to normal processing.  The debugging information says which files are being considered for remaking, which file-
 549             times are being compared and with what results,  which  files  actually  need  to  be  remade,  which  implicit  rules  are  considered  and  which  are
 550             applied---everything interesting about how make decides what to do.
 551 
 552 -->@coder:~/myninx$ ls
 553 Dockerfile
 554 -->@coder:~/myninx$ docker build -t ngingx:v3 .
 555 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=ej2md3xpsleluumovexd6sazz&shmsize=0&t=ngingx%3Av3&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied
 556 -->@coder:~/myninx$ sudo docker build -t ngingx:v3 .
 557 Sending build context to Docker daemon  2.048kB
 558 Step 1/2 : FROM nginx
 559  ---> 231d40e811cd
 560 Step 2/2 : RUN    echo '<h1> hello, Docker1<h1>' > /usr/share/nginx/html/index.html
 561  ---> Running in 507b2e7abc0f
 562 Removing intermediate container 507b2e7abc0f
 563  ---> 4afd6b31fab7
 564 Successfully built 4afd6b31fab7
 565 Successfully tagged ngingx:v3
 566 -->@coder:~/myninx$ more Dockerfile 
 567 FROM nginx
 568 RUN    echo '<h1> hello, Docker1<h1>' > /usr/share/nginx/html/index.html
 569 -->@coder:~/myninx$ ls
 570 Dockerfile
 571 -->@coder:~/myninx$ more Dockerfile 
 572 FROM nginx
 573 RUN    echo '<h1> hello, Docker1<h1>' > /usr/share/nginx/html/index.html
 574 -->@coder:~/myninx$ curl -s http://ip/cn
 575 -->@coder:~/myninx$ ls
 576 Dockerfile
 577 -->@coder:~/myninx$ touch dockerfile
 578 -->@coder:~/myninx$ vim dockerfile 
 579   1 
 580   1 
 581   2 
 582 ~                                                                                                                                                                        
 583 ~                                                                                                                                                                        
 584 ~                                                                                                                                                                        
 585 ~                                                                                                                                                                        
 586 ~                                                                                                                                                                        
 587 ~                                                                                                                                                                        
 588 ~                                                                                                                                                                        
 589 ~                                                                                                                                                                        
 590 -->@coder:~/myninx$ ls
 591 dockerfile  Dockerfile
 592 -->@coder:~/myninx$ rm * -rf
 593 -->@coder:~/myninx$ ls
 594 -->@coder:~/myninx$ vim Dockerfile
 595   1 
 596   1 FROM ubuntu:16:04
 597   2 RUN apt-get update \
 598   3     && apt-get install -y curl \
 599   4     && rm -rf /var/lib/apt/lists/*
 600   5 CMD [ "curl", "-s", "https://ip.cn" ]
 601 ~                                                                                                                                                                        
 602 ~                                                                                                                                                                        
 603 ~                                                                                                                                                                        
 604 ~                                                                                                                                                                        
 605 ~                                                                                                                                                                        
 606 "Dockerfile" [新] 5L, 139C 已写入                                                                                                                      
 607 -->@coder:~/myninx$ docker build -t myip .
 608 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=uf0prohvfg5qdpuh83toeat3j&shmsize=0&t=myip&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied
 609 -->@coder:~/myninx$ sudo docker build -t myip .
 610 [sudo] coder 的密码: 
 611 Sending build context to Docker daemon  2.048kB
 612 Step 1/3 : FROM ubuntu:16:04
 613 invalid reference format
 614 -->@coder:~/myninx$ vim Dockerfile 
 615   1 FROM ubuntu:16:04
 616   2 RUN apt-get update \
 617   3     && apt-get install -y curl \
 618   4     && rm -rf /var/lib/apt/lists/*
 619   5 CMD [ "curl", "-s", "https://ip.cn" ]
 620 ~                                                                                                                                                                        
 621 ~                                                                                                                                                                        
 622 ~                                                                                                                                                                        
 623 ~                                                                                                                                                                        
 624 ~                                                                                                                                                                        
 625 "Dockerfile" 5L, 139C 已写入
 626 -->@coder:~/myninx$ ls
 627 Dockerfile
 628 -->@coder:~/myninx$ 
 629 -->@coder:~/myninx$ 
 630 -->@coder:~/myninx$ sudo docker build -t myip .
 631 Sending build context to Docker daemon  2.048kB
 632 Step 1/3 : FROM ubuntu:16:04
 633 invalid reference format
 634 -->@coder:~/myninx$ docker run myip
 635 docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
 636 See 'docker run --help'.
 637 -->@coder:~/myninx$ docker run myip
 638 docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
 639 See 'docker run --help'.
 640 -->@coder:~/myninx$ ls
 641 Dockerfile
 642 -->@coder:~/myninx$ 
 643 -->@coder:~/myninx$ vim Dockerfile 
 644   1 FROM ubuntu:16:04
 645   2 RUN apt-get update \
 646   3     && apt-get install -y curl \
 647   4     && rm -rf /var/lib/apt/lists/*
 648   5 CMD [ "curl", "-s", "https://ip.cn" ]
 649   4 CMD [ "curl", "-s", "https://ip.cn" ]
 650   3 CMD [ "curl", "-s", "https://ip.cn" ]
 651   2 CMD [ "curl", "-s", "https://ip.cn" ]
 652   1 CMD [ "curl", "-s", "https://ip.cn" ]
 653   1 FROM
 654   2 
 655   2 RUN
 656   3 
 657   4 
 658 ~                                                                                                                                                                        
 659 ~                                                                                                                                                                        
 660 ~                                                                                                                                                                        
 661 ~                                                                                                                                                                        
 662 ~                                                                                                                                                                        
 663 ~                                                                                                                                                                        
 664 :! man 'CMD'                                                                                                                                           
 665 [已修改但尚未保存]
 666 没有 CMD 的手册页条目
 667 
 668 Shell 已返回16
 669 请按 ENTER 或其它命令继续
 670   1 FROM
 671   2 RUN
 672   3 CMD
 673   4 
 674 ~                                                                                                                                                                        
 675 ~                                                                                                                                                                        
 676 ~                                                                                                                                                                        
 677 ~                                                                                                                                                                        
 678 ~                                                                                                                                                                        
 679 ~                                                                                                                                                                        
 680 :! man 'CMD'                                                                                                                                           
 681 [已修改但尚未保存]
 682 没有 CMD 的手册页条目
 683 
 684 Shell 已返回16
 685 请按 ENTER 或其它命令继续
 686   1 FROM
 687   2 RUN
 688   3 CMD
 689   4 
 690 ~                                                                                                                                                                        
 691 ~                                                                                                                                                                        
 692 ~                                                                                                                                                                        
 693 ~                                                                                                                                                                        
 694 ~                                                                                                                                                                        
 695 ~                                                                                                                                                                        
 696 :! man 'CMD'                                                                                                                                           
 697 [已修改但尚未保存]
 698 没有 CMD 的手册页条目
 699 
 700 Shell 已返回16
 701 请按 ENTER 或其它命令继续
 702   1 FROM
 703   2 RUN
 704   3 CMD
 705   4 
 706 ~                                                                                                                                                                        
 707 ~                                                                                                                                                                        
 708 ~                                                                                                                                                                        
 709 ~                                                                                                                                                                        
 710 ~                                                                                                                                                                        
 711 ~                                                                                                                                                                        
 712 :! man 'CMD'                                                                                                                                           
 713 [已修改但尚未保存]
 714 没有 CMD 的手册页条目
 715 
 716 Shell 已返回16
 717 请按 ENTER 或其它命令继续
 718   1 FROM
 719   2 RUN
 720   3 CMD
 721   4 
 722   4 CMD
 723   4 CMD
 724   5 CMD
 725   6 CMD
 726 ~                                                                                                                                                                        
 727 ~                                                                                                                                                                        
 728 ~                                                                                                                                                                        
 729 ~                                                                                                                                                                        
 730 "Dockerfile" 6L, 139C 已写入                                                                                                                           
 731 -->@coder:~/myninx$ sudo docker images
 732 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
 733 ngingx                        v3                  4afd6b31fab7        About an hour ago   126MB
 734 nginx                         v2                  50776ea0e5a4        2 hours ago         126MB
 735 nginx                         latest              231d40e811cd        11 days ago         126MB
 736 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
 737 centos                        latest              0f3e07c0138f        2 months ago        220MB
 738 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
 739 -->@coder:~/myninx$ sudo docker search ubuntu:16.04
 740 NAME                                 DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 741 fuyuanli/xampp                       XAMPP based on Ubuntu:16.04                     5                                       
 742 jaehyeon/r-java                      r docker image from ubuntu:16.04 (r-base, r-…   3                                       [OK]
 743 rocm/dev-ubuntu-16.04                Docker image based on Ubuntu:16.04 with the …   2                                       
 744 islandsound/vowpal_wabbit            vowpal_wabbit 8.0.5 FROM ubuntu:16.04           1                                       
 745 jaehyeon/r-basic                     r docker image from ubuntu:16.04 (r-base, r-…   1                                       [OK]
 746 netdodo/android-emulator             Android-emulator API-25 with armeabi-v7a ima…   1                                       [OK]
 747 beeven/docker-sqlcmd                 sqlcmd run on top of ubuntu:16.04               1                                       [OK]
 748 abienkowski/jnlp-slave               Based on jenkins/jnlp-slave and ubuntu:16.04…   1                                       [OK]
 749 sneak/sandbox                        fully loaded ubuntu:16.04 sandbox for immedi…   1                                       [OK]
 750 fizzymatt/nessus-7-ubuntu            Nessus version 7.0.1 (unlicensed). Uses Ubun…   0                                       
 751 hasarden/ubuntu-integration          ubuntu:16.04 with docker and dotnet-sdk         0                                       
 752 tecposter/nginx                      Nginx build from source code on Ubuntu:16.04    0                                       [OK]
 753 akatiyar/ros-py-base                 ROS Kinetic base with python image based off…   0                                       [OK]
 754 moritzf/virtualhere                  Auto-Updating Docker image based on ubuntu:1…   0                                       [OK]
 755 rightscale/ops_java_base             A base image based on ubuntu:16.04 that for …   0                                       
 756 insready/nginx                       A folk from the official nginx library. This…   0                                       [OK]
 757 cosmiqworks/spacenet-utilities-cpu   CPU Docker Container for SpaceNetUtilities B…   0                                       [OK]
 758 ptpadan1246/ubuntu-node-go           base image is ubuntu:16.04 golang nodejs pyt…   0                                       [OK]
 759 wtanaka/ubuntu-1604                  ubuntu:16.04 with apt-get update and apt-get…   0                                       [OK]
 760 c6prmk/r-base-dev                    Based on ubuntu:16.04 (wget, curl, git)         0                                       [OK]
 761 roongr2k7/google-chrome              ubuntu:16.04, google-chrome-stable              0                                       [OK]
 762 acntechie/openldap                   Docker image with OpenLDAP and phpLDAPadmin,…   0                                       [OK]
 763 cristo/password_manager              Password_storage on Ubuntu:16.04                0                                       [OK]
 764 sungsu7437/ubuntu_spark              install spark in ubuntu:16.04                   0                                       [OK]
 765 chhuang/docker_image_filebeat        build filebeat image based on ubuntu:16.04      0                                       [OK]
 766 -->@coder:~/myninx$ sudo docker search ubuntu
 767 NAME                                                      DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
 768 ubuntu                                                    Ubuntu is a Debian-based Linux operating sys…   10225               [OK]                
 769 dorowu/ubuntu-desktop-lxde-vnc                            Docker image to provide HTML5 VNC interface …   367                                     [OK]
 770 rastasheep/ubuntu-sshd                                    Dockerized SSH service, built on top of offi…   236                                     [OK]
 771 consol/ubuntu-xfce-vnc                                    Ubuntu container with "headless" VNC session…   199                                     [OK]
 772 ubuntu-upstart                                            Upstart is an event-based replacement for th…   102                 [OK]                
 773 ansible/ubuntu14.04-ansible                               Ubuntu 14.04 LTS with ansible                   98                                      [OK]
 774 neurodebian                                               NeuroDebian provides neuroscience research s…   61                  [OK]                
 775 1and1internet/ubuntu-16-nginx-php-phpmyadmin-mysql-5      ubuntu-16-nginx-php-phpmyadmin-mysql-5          50                                      [OK]
 776 ubuntu-debootstrap                                        debootstrap --variant=minbase --components=m…   41                  [OK]                
 777 nuagebec/ubuntu                                           Simple always updated Ubuntu docker images w…   24                                      [OK]
 778 i386/ubuntu                                               Ubuntu is a Debian-based Linux operating sys…   18                                      
 779 1and1internet/ubuntu-16-apache-php-5.6                    ubuntu-16-apache-php-5.6                        14                                      [OK]
 780 1and1internet/ubuntu-16-apache-php-7.0                    ubuntu-16-apache-php-7.0                        13                                      [OK]
 781 ppc64le/ubuntu                                            Ubuntu is a Debian-based Linux operating sys…   13                                      
 782 eclipse/ubuntu_jdk8                                       Ubuntu, JDK8, Maven 3, git, curl, nmap, mc, …   12                                      [OK]
 783 1and1internet/ubuntu-16-nginx-php-phpmyadmin-mariadb-10   ubuntu-16-nginx-php-phpmyadmin-mariadb-10       11                                      [OK]
 784 1and1internet/ubuntu-16-nginx-php-5.6-wordpress-4         ubuntu-16-nginx-php-5.6-wordpress-4             7                                       [OK]
 785 1and1internet/ubuntu-16-apache-php-7.1                    ubuntu-16-apache-php-7.1                        6                                       [OK]
 786 darksheer/ubuntu                                          Base Ubuntu Image -- Updated hourly             5                                       [OK]
 787 1and1internet/ubuntu-16-nginx-php-7.0                     ubuntu-16-nginx-php-7.0                         4                                       [OK]
 788 pivotaldata/ubuntu                                        A quick freshening-up of the base Ubuntu doc…   2                                       
 789 1and1internet/ubuntu-16-php-7.1                           ubuntu-16-php-7.1                               1                                       [OK]
 790 smartentry/ubuntu                                         ubuntu with smartentry                          1                                       [OK]
 791 pivotaldata/ubuntu-gpdb-dev                               Ubuntu images for GPDB development              1                                       
 792 1and1internet/ubuntu-16-sshd                              ubuntu-16-sshd                                  1                                       [OK]
 793 -->@coder:~/myninx$ sudo docker pull ubuntu:16.04
 794 16.04: Pulling from library/ubuntu
 795 
 796 
 797 
 798 
 799 Digest: sha256:e10375c69cf9e22989c82b0a87c932a21e33619ee322d6c7ce6a61456f54c30c
 800 Status: Downloaded newer image for ubuntu:16.04
 801 docker.io/library/ubuntu:16.04
 802 -->@coder:~/myninx$ sudo docker image ls
 803 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
 804 ngingx                        v3                  4afd6b31fab7        About an hour ago   126MB
 805 nginx                         v2                  50776ea0e5a4        2 hours ago         126MB
 806 ubuntu                        16.04               56bab49eef2e        7 days ago          123MB
 807 nginx                         latest              231d40e811cd        11 days ago         126MB
 808 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
 809 centos                        latest              0f3e07c0138f        2 months ago        220MB
 810 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
 811 -->@coder:~/myninx$ ls
 812 Dockerfile
 813 -->@coder:~/myninx$ 
 814 -->@coder:~/myninx$ 
 815 -->@coder:~/myninx$ sudo docker build -t myip .
 816 Sending build context to Docker daemon  2.048kB
 817 Step 1/3 : FROM ubuntu:16.04
 818  ---> 56bab49eef2e
 819 Step 2/3 : RUN apt-get update     && apt-get install -y curl     && rm -rf /var/lib/apt/lists/*
 820  ---> Running in 914bd7a7403b
 821 Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
 822 Get:2 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
 823 Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1015 kB]
 824 Get:4 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
 825 Get:5 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [594 kB]
 826 Get:6 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [6283 B]
 827 Get:7 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
 828 Get:8 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
 829 Get:9 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
 830 Get:10 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
 831 Get:11 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
 832 
 833 
 834 ^C
 835 -->@coder:~/myninx$ sudo docker build -t myip .
 836 Sending build context to Docker daemon  2.048kB
 837 Step 1/3 : FROM ubuntu:16.04
 838  ---> 56bab49eef2e
 839 Step 2/3 : RUN apt-get update     && apt-get install -y curl     && rm -rf /var/lib/apt/lists/*
 840  ---> Running in dfb587cd2b8f
 841 Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
 842 Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
 843 Get:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1015 kB]
 844 Get:4 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
 845 Get:5 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [594 kB]
 846 Get:6 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
 847 Get:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
 848 Get:8 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
 849 Get:9 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
 850 Get:10 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
 851 Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [6283 B]
 852 Get:10 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
 853 Get:10 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
 854 Get:12 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
 855 Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1393 kB]
 856 Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1393 kB]
 857 Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [13.1 kB]
 858 Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [998 kB]
 859 Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [998 kB]
 860 Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [19.3 kB]
 861 Get:17 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [7942 B]
 862 Get:18 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [8807 B]
 863 Fetched 14.4 MB in 17min 38s (13.6 kB/s)
 864 Reading package lists...
 865 Reading package lists...
 866 Building dependency tree...
 867 Reading state information...
 868 The following additional packages will be installed:
 869   ca-certificates krb5-locales libasn1-8-heimdal libcurl3-gnutls libffi6
 870   libgmp10 libgnutls30 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal
 871   libheimbase1-heimdal libheimntlm0-heimdal libhogweed4 libhx509-5-heimdal
 872   libidn11 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3
 873   libkrb5support0 libldap-2.4-2 libnettle6 libp11-kit0 libroken18-heimdal
 874   librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsqlite3-0
 875   libssl1.0.0 libtasn1-6 libwind0-heimdal openssl
 876 Suggested packages:
 877   gnutls-bin krb5-doc krb5-user libsasl2-modules-otp libsasl2-modules-ldap
 878   libsasl2-modules-sql libsasl2-modules-gssapi-mit
 879   | libsasl2-modules-gssapi-heimdal
 880 The following NEW packages will be installed:
 881   ca-certificates curl krb5-locales libasn1-8-heimdal libcurl3-gnutls libffi6
 882   libgmp10 libgnutls30 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal
 883   libheimbase1-heimdal libheimntlm0-heimdal libhogweed4 libhx509-5-heimdal
 884   libidn11 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3
 885   libkrb5support0 libldap-2.4-2 libnettle6 libp11-kit0 libroken18-heimdal
 886   librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsqlite3-0
 887   libssl1.0.0 libtasn1-6 libwind0-heimdal openssl
 888 0 upgraded, 34 newly installed, 0 to remove and 0 not upgraded.
 889 Need to get 5346 kB of archives.
 890 After this operation, 19.0 MB of additional disk space will be used.
 891 Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 libffi6 amd64 3.2.1-4 [17.8 kB]
 892 Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 libgmp10 amd64 2:6.1.0+dfsg-2 [240 kB]
 893 Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libnettle6 amd64 3.2-1ubuntu0.16.04.1 [93.5 kB]
 894 Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libhogweed4 amd64 3.2-1ubuntu0.16.04.1 [136 kB]
 895 Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libidn11 amd64 1.32-3ubuntu1.2 [46.5 kB]
 896 Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libp11-kit0 amd64 0.23.2-5~ubuntu16.04.1 [105 kB]
 897 Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libtasn1-6 amd64 4.7-3ubuntu0.16.04.3 [43.5 kB]
 898 Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgnutls30 amd64 3.4.10-4ubuntu1.5 [548 kB]
 899 Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsqlite3-0 amd64 3.11.0-1ubuntu1.3 [397 kB]
 900 Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libssl1.0.0 amd64 1.0.2g-1ubuntu4.15 [1084 kB]
 901 Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 openssl amd64 1.0.2g-1ubuntu4.15 [492 kB]
 902 Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 ca-certificates all 20170717~16.04.2 [167 kB]
 903 Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 krb5-locales all 1.13.2+dfsg-5ubuntu2.1 [13.6 kB]
 904 Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libroken18-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [41.4 kB]
 905 Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libasn1-8-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [174 kB]
 906 Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libkrb5support0 amd64 1.13.2+dfsg-5ubuntu2.1 [31.2 kB]
 907 Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libk5crypto3 amd64 1.13.2+dfsg-5ubuntu2.1 [81.3 kB]
 908 Get:18 http://archive.ubuntu.com/ubuntu xenial/main amd64 libkeyutils1 amd64 1.5.9-8ubuntu1 [9904 B]
 909 Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libkrb5-3 amd64 1.13.2+dfsg-5ubuntu2.1 [273 kB]
 910 Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgssapi-krb5-2 amd64 1.13.2+dfsg-5ubuntu2.1 [120 kB]
 911 Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libhcrypto4-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [85.0 kB]
 912 Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libheimbase1-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [29.3 kB]
 913 Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libwind0-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [47.8 kB]
 914 Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libhx509-5-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [107 kB]
 915 Get:25 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libkrb5-26-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [202 kB]
 916 Get:26 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libheimntlm0-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [15.1 kB]
 917 Get:27 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libgssapi3-heimdal amd64 1.7~git20150920+dfsg-4ubuntu1.16.04.1 [96.1 kB]
 918 Get:28 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsasl2-modules-db amd64 2.1.26.dfsg1-14ubuntu0.1 [14.5 kB]
 919 Get:29 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsasl2-2 amd64 2.1.26.dfsg1-14ubuntu0.1 [48.6 kB]
 920 Get:30 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libldap-2.4-2 amd64 2.4.42+dfsg-2ubuntu3.7 [160 kB]
 921 Get:31 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d-1ubuntu0.1 [54.4 kB]
 922 Get:32 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libcurl3-gnutls amd64 7.47.0-1ubuntu2.14 [184 kB]
 923 Get:33 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libsasl2-modules amd64 2.1.26.dfsg1-14ubuntu0.1 [47.5 kB]
 924 Get:34 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 curl amd64 7.47.0-1ubuntu2.14 [139 kB]
 925 debconf: delaying package configuration, since apt-utils is not installed
 926 Fetched 5346 kB in 27s (195 kB/s)
 927 Selecting previously unselected package libffi6:amd64.
 928 (Reading database ... 4781 files and directories currently installed.)
 929 Preparing to unpack .../libffi6_3.2.1-4_amd64.deb ...
 930 Unpacking libffi6:amd64 (3.2.1-4) ...
 931 Selecting previously unselected package libgmp10:amd64.
 932 Preparing to unpack .../libgmp10_2%3a6.1.0+dfsg-2_amd64.deb ...
 933 Unpacking libgmp10:amd64 (2:6.1.0+dfsg-2) ...
 934 Selecting previously unselected package libnettle6:amd64.
 935 Preparing to unpack .../libnettle6_3.2-1ubuntu0.16.04.1_amd64.deb ...
 936 Unpacking libnettle6:amd64 (3.2-1ubuntu0.16.04.1) ...
 937 Selecting previously unselected package libhogweed4:amd64.
 938 Preparing to unpack .../libhogweed4_3.2-1ubuntu0.16.04.1_amd64.deb ...
 939 Unpacking libhogweed4:amd64 (3.2-1ubuntu0.16.04.1) ...
 940 Selecting previously unselected package libidn11:amd64.
 941 Preparing to unpack .../libidn11_1.32-3ubuntu1.2_amd64.deb ...
 942 Unpacking libidn11:amd64 (1.32-3ubuntu1.2) ...
 943 Selecting previously unselected package libp11-kit0:amd64.
 944 Preparing to unpack .../libp11-kit0_0.23.2-5~ubuntu16.04.1_amd64.deb ...
 945 Unpacking libp11-kit0:amd64 (0.23.2-5~ubuntu16.04.1) ...
 946 Selecting previously unselected package libtasn1-6:amd64.
 947 Preparing to unpack .../libtasn1-6_4.7-3ubuntu0.16.04.3_amd64.deb ...
 948 Unpacking libtasn1-6:amd64 (4.7-3ubuntu0.16.04.3) ...
 949 Selecting previously unselected package libgnutls30:amd64.
 950 Preparing to unpack .../libgnutls30_3.4.10-4ubuntu1.5_amd64.deb ...
 951 Unpacking libgnutls30:amd64 (3.4.10-4ubuntu1.5) ...
 952 Selecting previously unselected package libsqlite3-0:amd64.
 953 Preparing to unpack .../libsqlite3-0_3.11.0-1ubuntu1.3_amd64.deb ...
 954 Unpacking libsqlite3-0:amd64 (3.11.0-1ubuntu1.3) ...
 955 Selecting previously unselected package libssl1.0.0:amd64.
 956 Preparing to unpack .../libssl1.0.0_1.0.2g-1ubuntu4.15_amd64.deb ...
 957 Unpacking libssl1.0.0:amd64 (1.0.2g-1ubuntu4.15) ...
 958 Selecting previously unselected package openssl.
 959 Preparing to unpack .../openssl_1.0.2g-1ubuntu4.15_amd64.deb ...
 960 Unpacking openssl (1.0.2g-1ubuntu4.15) ...
 961 Selecting previously unselected package ca-certificates.
 962 Preparing to unpack .../ca-certificates_20170717~16.04.2_all.deb ...
 963 Unpacking ca-certificates (20170717~16.04.2) ...
 964 Selecting previously unselected package krb5-locales.
 965 Preparing to unpack .../krb5-locales_1.13.2+dfsg-5ubuntu2.1_all.deb ...
 966 Unpacking krb5-locales (1.13.2+dfsg-5ubuntu2.1) ...
 967 Selecting previously unselected package libroken18-heimdal:amd64.
 968 Preparing to unpack .../libroken18-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
 969 Unpacking libroken18-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
 970 Selecting previously unselected package libasn1-8-heimdal:amd64.
 971 Preparing to unpack .../libasn1-8-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
 972 Unpacking libasn1-8-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
 973 Selecting previously unselected package libkrb5support0:amd64.
 974 Preparing to unpack .../libkrb5support0_1.13.2+dfsg-5ubuntu2.1_amd64.deb ...
 975 Unpacking libkrb5support0:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
 976 Selecting previously unselected package libk5crypto3:amd64.
 977 Preparing to unpack .../libk5crypto3_1.13.2+dfsg-5ubuntu2.1_amd64.deb ...
 978 Unpacking libk5crypto3:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
 979 Selecting previously unselected package libkeyutils1:amd64.
 980 Preparing to unpack .../libkeyutils1_1.5.9-8ubuntu1_amd64.deb ...
 981 Unpacking libkeyutils1:amd64 (1.5.9-8ubuntu1) ...
 982 Selecting previously unselected package libkrb5-3:amd64.
 983 Preparing to unpack .../libkrb5-3_1.13.2+dfsg-5ubuntu2.1_amd64.deb ...
 984 Unpacking libkrb5-3:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
 985 Selecting previously unselected package libgssapi-krb5-2:amd64.
 986 Preparing to unpack .../libgssapi-krb5-2_1.13.2+dfsg-5ubuntu2.1_amd64.deb ...
 987 Unpacking libgssapi-krb5-2:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
 988 Selecting previously unselected package libhcrypto4-heimdal:amd64.
 989 Preparing to unpack .../libhcrypto4-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
 990 Unpacking libhcrypto4-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
 991 Selecting previously unselected package libheimbase1-heimdal:amd64.
 992 Preparing to unpack .../libheimbase1-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
 993 Unpacking libheimbase1-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
 994 Selecting previously unselected package libwind0-heimdal:amd64.
 995 Preparing to unpack .../libwind0-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
 996 Unpacking libwind0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
 997 Selecting previously unselected package libhx509-5-heimdal:amd64.
 998 Preparing to unpack .../libhx509-5-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
 999 Unpacking libhx509-5-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1000 Selecting previously unselected package libkrb5-26-heimdal:amd64.
1001 Preparing to unpack .../libkrb5-26-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
1002 Unpacking libkrb5-26-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1003 Selecting previously unselected package libheimntlm0-heimdal:amd64.
1004 Preparing to unpack .../libheimntlm0-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
1005 Unpacking libheimntlm0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1006 Selecting previously unselected package libgssapi3-heimdal:amd64.
1007 Preparing to unpack .../libgssapi3-heimdal_1.7~git20150920+dfsg-4ubuntu1.16.04.1_amd64.deb ...
1008 Unpacking libgssapi3-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1009 Selecting previously unselected package libsasl2-modules-db:amd64.
1010 Preparing to unpack .../libsasl2-modules-db_2.1.26.dfsg1-14ubuntu0.1_amd64.deb ...
1011 Unpacking libsasl2-modules-db:amd64 (2.1.26.dfsg1-14ubuntu0.1) ...
1012 Selecting previously unselected package libsasl2-2:amd64.
1013 Preparing to unpack .../libsasl2-2_2.1.26.dfsg1-14ubuntu0.1_amd64.deb ...
1014 Unpacking libsasl2-2:amd64 (2.1.26.dfsg1-14ubuntu0.1) ...
1015 Selecting previously unselected package libldap-2.4-2:amd64.
1016 Preparing to unpack .../libldap-2.4-2_2.4.42+dfsg-2ubuntu3.7_amd64.deb ...
1017 Unpacking libldap-2.4-2:amd64 (2.4.42+dfsg-2ubuntu3.7) ...
1018 Selecting previously unselected package librtmp1:amd64.
1019 Preparing to unpack .../librtmp1_2.4+20151223.gitfa8646d-1ubuntu0.1_amd64.deb ...
1020 Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d-1ubuntu0.1) ...
1021 Selecting previously unselected package libcurl3-gnutls:amd64.
1022 Preparing to unpack .../libcurl3-gnutls_7.47.0-1ubuntu2.14_amd64.deb ...
1023 Unpacking libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.14) ...
1024 Selecting previously unselected package libsasl2-modules:amd64.
1025 Preparing to unpack .../libsasl2-modules_2.1.26.dfsg1-14ubuntu0.1_amd64.deb ...
1026 Unpacking libsasl2-modules:amd64 (2.1.26.dfsg1-14ubuntu0.1) ...
1027 Selecting previously unselected package curl.
1028 Preparing to unpack .../curl_7.47.0-1ubuntu2.14_amd64.deb ...
1029 Unpacking curl (7.47.0-1ubuntu2.14) ...
1030 Processing triggers for libc-bin (2.23-0ubuntu11) ...
1031 Setting up libffi6:amd64 (3.2.1-4) ...
1032 Setting up libgmp10:amd64 (2:6.1.0+dfsg-2) ...
1033 Setting up libnettle6:amd64 (3.2-1ubuntu0.16.04.1) ...
1034 Setting up libhogweed4:amd64 (3.2-1ubuntu0.16.04.1) ...
1035 Setting up libidn11:amd64 (1.32-3ubuntu1.2) ...
1036 Setting up libp11-kit0:amd64 (0.23.2-5~ubuntu16.04.1) ...
1037 Setting up libtasn1-6:amd64 (4.7-3ubuntu0.16.04.3) ...
1038 Setting up libgnutls30:amd64 (3.4.10-4ubuntu1.5) ...
1039 Setting up libsqlite3-0:amd64 (3.11.0-1ubuntu1.3) ...
1040 Setting up libssl1.0.0:amd64 (1.0.2g-1ubuntu4.15) ...
1041 debconf: unable to initialize frontend: Dialog
1042 debconf: (TERM is not set, so the dialog frontend is not usable.)
1043 debconf: falling back to frontend: Readline
1044 debconf: unable to initialize frontend: Readline
1045 debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
1046 debconf: falling back to frontend: Teletype
1047 Setting up openssl (1.0.2g-1ubuntu4.15) ...
1048 Setting up ca-certificates (20170717~16.04.2) ...
1049 debconf: unable to initialize frontend: Dialog
1050 debconf: (TERM is not set, so the dialog frontend is not usable.)
1051 debconf: falling back to frontend: Readline
1052 debconf: unable to initialize frontend: Readline
1053 debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
1054 debconf: falling back to frontend: Teletype
1055 Setting up krb5-locales (1.13.2+dfsg-5ubuntu2.1) ...
1056 Setting up libroken18-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1057 Setting up libasn1-8-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1058 Setting up libkrb5support0:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
1059 Setting up libk5crypto3:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
1060 Setting up libkeyutils1:amd64 (1.5.9-8ubuntu1) ...
1061 Setting up libkrb5-3:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
1062 Setting up libgssapi-krb5-2:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
1063 Setting up libhcrypto4-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1064 Setting up libheimbase1-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1065 Setting up libwind0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1066 Setting up libhx509-5-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1067 Setting up libkrb5-26-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1068 Setting up libheimntlm0-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1069 Setting up libgssapi3-heimdal:amd64 (1.7~git20150920+dfsg-4ubuntu1.16.04.1) ...
1070 Setting up libsasl2-modules-db:amd64 (2.1.26.dfsg1-14ubuntu0.1) ...
1071 Setting up libsasl2-2:amd64 (2.1.26.dfsg1-14ubuntu0.1) ...
1072 Setting up libldap-2.4-2:amd64 (2.4.42+dfsg-2ubuntu3.7) ...
1073 Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d-1ubuntu0.1) ...
1074 Setting up libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.14) ...
1075 Setting up libsasl2-modules:amd64 (2.1.26.dfsg1-14ubuntu0.1) ...
1076 Setting up curl (7.47.0-1ubuntu2.14) ...
1077 Processing triggers for libc-bin (2.23-0ubuntu11) ...
1078 Processing triggers for ca-certificates (20170717~16.04.2) ...
1079 Updating certificates in /etc/ssl/certs...
1080 148 added, 0 removed; done.
1081 Running hooks in /etc/ca-certificates/update.d...
1082 done.
1083 Removing intermediate container dfb587cd2b8f
1084  ---> 27a714eb7d09
1085 Step 3/3 : CMD [ "curl", "-s", "http://ip.cn" ]
1086  ---> Running in ba7b6e192992
1087 Removing intermediate container ba7b6e192992
1088  ---> fec6dab28edf
1089 Successfully built fec6dab28edf
1090 Successfully tagged myip:latest
1091 -->@coder:~/myninx$ docker info
1092 Client:
1093  Debug Mode: false
1094 
1095 Server:
1096 ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/info: dial unix /var/run/docker.sock: connect: permission denied
1097 errors pretty printing info
1098 -->@coder:~/myninx$ sudo docker info
1099 [sudo] coder 的密码: 
1100 Client:
1101  Debug Mode: false
1102 
1103 Server:
1104  Containers: 2
1105   Running: 2
1106   Paused: 0
1107   Stopped: 0
1108  Images: 9
1109  Server Version: 19.03.5
1110  Storage Driver: overlay2
1111   Backing Filesystem: extfs
1112   Supports d_type: true
1113   Native Overlay Diff: true
1114  Logging Driver: json-file
1115  Cgroup Driver: cgroupfs
1116  Plugins:
1117   Volume: local
1118   Network: bridge host ipvlan macvlan null overlay
1119   Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
1120  Swarm: inactive
1121  Runtimes: runc
1122  Default Runtime: runc
1123  Init Binary: docker-init
1124  containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
1125  runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
1126  init version: fec3683
1127  Security Options:
1128   apparmor
1129   seccomp
1130    Profile: default
1131  Kernel Version: 4.15.0-70-generic
1132  Operating System: Ubuntu 16.04.6 LTS
1133  OSType: linux
1134  Architecture: x86_64
1135  CPUs: 4
1136  Total Memory: 2.909GiB
1137  Name: coder
1138  ID: W3LG:G7PJ:FMUT:XUJO:M5ZC:5LV2:SGLZ:PPPU:F3UB:4LZN:MPEB:ZGM5
1139  Docker Root Dir: /var/lib/docker
1140  Debug Mode: false
1141  Registry: https://index.docker.io/v1/
1142  Labels:
1143  Experimental: false
1144  Insecure Registries:
1145   127.0.0.0/8
1146  Registry Mirrors:
1147   https://uog9ef8i.mirror.aliyuncs.com/
1148  Live Restore Enabled: false
1149 
1150 WARNING: No swap limit support
1151 -->@coder:~/myninx$ sudo docker build -t myip .
1152 Sending build context to Docker daemon  2.048kB
1153 Step 1/3 : FROM ubuntu:16.04
1154  ---> 56bab49eef2e
1155 Step 2/3 : RUN apt-get update     && apt-get install -y curl     && rm -rf /var/lib/apt/lists/*
1156  ---> Using cache
1157  ---> 27a714eb7d09
1158 Step 3/3 : CMD [ "curl", "-s", "http://ip.cn" ]
1159  ---> Using cache
1160  ---> fec6dab28edf
1161 Successfully built fec6dab28edf
1162 Successfully tagged myip:latest
1163 -->@coder:~/myninx$ ls
1164 Dockerfile
1165 -->@coder:~/myninx$ docker image ls
1166 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json: dial unix /var/run/docker.sock: connect: permission denied
1167 -->@coder:~/myninx$ docker images
1168 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/images/json: dial unix /var/run/docker.sock: connect: permission denied
1169 -->@coder:~/myninx$ sudo dockcer images
1170 sudo: dockcer:找不到命令
1171 -->@coder:~/myninx$ sudo docker images
1172 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
1173 myip                          latest              fec6dab28edf        7 minutes ago       139MB
1174 ngingx                        v3                  4afd6b31fab7        2 hours ago         126MB
1175 nginx                         v2                  50776ea0e5a4        2 hours ago         126MB
1176 ubuntu                        16.04               56bab49eef2e        7 days ago          123MB
1177 nginx                         latest              231d40e811cd        11 days ago         126MB
1178 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
1179 centos                        latest              0f3e07c0138f        2 months ago        220MB
1180 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
1181 -->@coder:~/myninx$ docker run -it myip
1182 docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
1183 See 'docker run --help'.
1184 -->@coder:~/myninx$ sudo docker run myip
1185 -->@coder:~/myninx$ 
1186 -->@coder:~/myninx$ 
1187 -->@coder:~/myninx$ 
1188 -->@coder:~/myninx$ 
1189 -->@coder:~/myninx$ sudo docker run myip -i
1190 docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"-i\": executable file not found in $PATH": unknown.
1191 centos                        latest              0f3e07c0138f        2 months ago        220MB
1192 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
1193 -->@coder:~/myninx$ docker run -it myip
1194 docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
1195 See 'docker run --help'.
1196 -->@coder:~/myninx$ sudo docker run myip
1197 -->@coder:~/myninx$ 
1198 -->@coder:~/myninx$ 
1199 -->@coder:~/myninx$ 
1200 -->@coder:~/myninx$ 
1201 -->@coder:~/myninx$ sudo docker run myip -i
1202 docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"-i\": executable file not found in $PATH": unknown.
1203 -->@coder:~/myninx$ ls
1204 Dockerfile
1205 -->@coder:~/myninx$ vim Dockerfile 
1206   1 FROM ubuntu:16.04
1207   2 RUN apt-get update \
1208   3     && apt-get install -y curl \
1209   4     && rm -rf /var/lib/apt/lists/*
1210   5 CMD [ "curl", "-s", "http://ip.cn" ]
1211   6 
1212 ~                                                                                                                                                                        
1213 ~                                                                                                                                                                        
1214 ~                                                                                                                                                                        
1215 ~                                                                                                                                                                        
1216 ~                                                                                                                                                                        
1217 ~                                                                                                                                                                        
1218 ~                                                                                                                                                                        
1219 ~                                                                                                                                                                        
1220 ~                                                                                                                                                                        
1221 ~                                                                                                                                                                        
1222 ~                                                                                                                                                                        
1223 ~                                                                                                                                                                        
1224 ~                                                                                                                                                                        
1225 ~                                                                                                                                                                        
1226 ~                                                                                                                                                                        
1227 ~                                                                                                                                                                        
1228 ~                                                                                                                                                                        
1229 ~                                                                                                                                                                        
1230 "Dockerfile" 6L, 146C 已写入                                                                                                                           
1231 -->@coder:~/myninx$ 
1232 -->@coder:~/myninx$ more Dockerfile 
1233 FROM ubuntu:16.04
1234 RUN apt-get update \
1235     && apt-get install -y curl \
1236     && rm -rf /var/lib/apt/lists/*
1237 ENTRYPOINT [ "curl", "-s", "http://ip.cn" ]
1238 
1239 -->@coder:~/myninx$ sudo docker run myip -i
1240 docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"-i\": executable file not found in $PATH": unknown.
1241 ERRO[0001] error waiting for container: context canceled 
1242 -->@coder:~/myninx$ sudo docker container
1243 
1244 Usage:    docker container COMMAND
1245 
1246 Manage containers
1247 
1248 Commands:
1249   attach      Attach local standard input, output, and error streams to a running container
1250   commit      Create a new image from a container's changes
1251   cp          Copy files/folders between a container and the local filesystem
1252   create      Create a new container
1253   diff        Inspect changes to files or directories on a container's filesystem
1254   exec        Run a command in a running container
1255   export      Export a container's filesystem as a tar archive
1256   inspect     Display detailed information on one or more containers
1257   kill        Kill one or more running containers
1258   logs        Fetch the logs of a container
1259   ls          List containers
1260   pause       Pause all processes within one or more containers
1261   port        List port mappings or a specific mapping for the container
1262   prune       Remove all stopped containers
1263   rename      Rename a container
1264   restart     Restart one or more containers
1265   rm          Remove one or more containers
1266   run         Run a command in a new container
1267   start       Start one or more stopped containers
1268   stats       Display a live stream of container(s) resource usage statistics
1269   stop        Stop one or more running containers
1270   top         Display the running processes of a container
1271   unpause     Unpause all processes within one or more containers
1272   update      Update configuration of one or more containers
1273   wait        Block until one or more containers stop, then print their exit codes
1274 
1275 Run 'docker container COMMAND --help' for more information on a command.
1276 -->@coder:~/myninx$ sudo docker container
1277 -->@coder:~/myninx$ sudo docker container ls
1278 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
1279 a279c8cb0430        nginx:v2            "nginx -g 'daemon of…"   2 hours ago         Up 2 hours          0.0.0.0:81->80/tcp   web2
1280 e188b46041a5        nginx               "nginx -g 'daemon of…"   3 hours ago         Up 3 hours          0.0.0.0:80->80/tcp   webserver
1281 -->@coder:~/myninx$ sudo docker images
1282 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
1283 myip                          latest              fec6dab28edf        13 minutes ago      139MB
1284 ngingx                        v3                  4afd6b31fab7        2 hours ago         126MB
1285 nginx                         v2                  50776ea0e5a4        3 hours ago         126MB
1286 ubuntu                        16.04               56bab49eef2e        7 days ago          123MB
1287 nginx                         latest              231d40e811cd        11 days ago         126MB
1288 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
1289 centos                        latest              0f3e07c0138f        2 months ago        220MB
1290 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
1291 -->@coder:~/myninx$ sudo docker images
1292 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
1293 myip                          latest              fec6dab28edf        13 minutes ago      139MB
1294 ngingx                        v3                  4afd6b31fab7        2 hours ago         126MB
1295 nginx                         v2                  50776ea0e5a4        3 hours ago         126MB
1296 ubuntu                        16.04               56bab49eef2e        7 days ago          123MB
1297 nginx                         latest              231d40e811cd        11 days ago         126MB
1298 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
1299 centos                        latest              0f3e07c0138f        2 months ago        220MB
1300 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
1301 -->@coder:~/myninx$ ls
1302 Dockerfile
1303 -->@coder:~/myninx$ more Dockerfile 
1304 FROM ubuntu:16.04
1305 RUN apt-get update \
1306     && apt-get install -y curl \
1307     && rm -rf /var/lib/apt/lists/*
1308 ENTRYPOINT [ "curl", "-s", "http://ip.cn" ]
1309 
1310 -->@coder:~/myninx$ mv Dockerfile Dockerfile.ip
1311 -->@coder:~/myninx$ vim Dockerfile
1312   1 
1313   1 FROM nginx
1314   2 RUN apt-get && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
1315   3 HEALTHCHECK --interval=5s --timeout=3s \
1316   3 HEALTHCHECK --interval=5s --timeout=3s \
1317   4   CMD curl -fs http://localhost/ || exit 1
1318 ~                                                                                                                                                                        
1319 ~                                                                                                                                                                        
1320 ~                                                                                                                                                                        
1321 ~                                                                                                                                                                        
1322 ~                                                                                                                                                                        
1323 "Dockerfile" [新] 4L, 165C 已写入                                                                                                                      
1324 -->@coder:~/myninx$ sudo docker build -t myweb:v1 .
1325 Sending build context to Docker daemon  3.072kB
1326 Step 1/3 : FROM nginx
1327  ---> 231d40e811cd
1328 Step 2/3 : RUN apt-get && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
1329  ---> Running in 0e83d3c0c655
1330 apt 1.8.2 (amd64)
1331 Usage: apt-get [options] command
1332        apt-get [options] install|remove pkg1 [pkg2 ...]
1333        apt-get [options] source pkg1 [pkg2 ...]
1334 
1335 apt-get is a command line interface for retrieval of packages
1336 and information about them from authenticated sources and
1337 for installation, upgrade and removal of packages together
1338 with their dependencies.
1339 
1340 Most used commands:
1341   update - Retrieve new lists of packages
1342   upgrade - Perform an upgrade
1343   install - Install new packages (pkg is libc6 not libc6.deb)
1344   reinstall - Reinstall packages (pkg is libc6 not libc6.deb)
1345   remove - Remove packages
1346   purge - Remove packages and config files
1347   autoremove - Remove automatically all unused packages
1348   dist-upgrade - Distribution upgrade, see apt-get(8)
1349   dselect-upgrade - Follow dselect selections
1350   build-dep - Configure build-dependencies for source packages
1351   clean - Erase downloaded archive files
1352   autoclean - Erase old downloaded archive files
1353   check - Verify that there are no broken dependencies
1354   source - Download source archives
1355   download - Download the binary package into the current directory
1356   changelog - Download and display the changelog for the given package
1357 
1358 See apt-get(8) for more information about the available commands.
1359 Configuration options and syntax is detailed in apt.conf(5).
1360 Information about how to configure sources can be found in sources.list(5).
1361 Package and version choices can be expressed via apt_preferences(5).
1362 Security details are available in apt-secure(8).
1363                                         This APT has Super Cow Powers.
1364 The command '/bin/sh -c apt-get && apt-get install -y curl && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 1
1365 -->@coder:~/myninx$ 
1366 -->@coder:~/myninx$ vim Dockerfile
1367   
1368   1 FROM nginx
1369   2 RUN apt-get && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
1370   3 HEALTHCHECK --interval=5s --timeout=3s \
1371   4   CMD curl -fs http://localhost/ || exit 1
1372 ~                                                                                                                                                                        
1373 ~                                                                                                                                                                        
1374 ~                                                                                                                                                                        
1375 ~                                                                                                                                                                        
1376 ~                                                                                                                                                                        
1377 ~                                                                                                                                                                        
1378 ~                                                                                                                                                                        
1379 ~                                                                                                                                                                        
1380 ~                                                                                                                                                                        
1381 ~                                                                                                                                                                        
1382 ~                                                                                                                                                                        
1383 ~                                                                                                                                                                        
1384 ~                                                                                                                                                                        
1385 ~                                                                                                                                                                        
1386 ~                                                                                                                                                                        
1387 ~                                                                                                                                                                        
1388 ~                                                                                                                                                                        
1389 ~                                                                                                                                                                        
1390 ~                                                                                                                                                                        
1391 ~                                                                                                                                                                        
1392 ~                                                                                                                                                                        
1393 ~                                                                                                                                                                        
1394 ~                                                                                                                                                                        
1395 ~                                                                                                                                                                        
1396 ~                                                                                                                                                                        
1397 "Dockerfile" 4L, 172C 已写入                                                                                                                           
1398 -->@coder:~/myninx$ 
1399 -->@coder:~/myninx$ ls
1400 Dockerfile  Dockerfile.ip
1401 -->@coder:~/myninx$ sudo docker build -t myweb:v1 .
1402 Sending build context to Docker daemon  3.072kB
1403 Step 1/3 : FROM nginx
1404  ---> 231d40e811cd
1405 Step 2/3 : RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
1406  ---> Running in 0cd297b35d4c
1407 Get:2 http://cdn-fastly.deb.debian.org/debian buster InRelease [122 kB]
1408 Get:1 http://security-cdn.debian.org/debian-security buster/updates InRelease [65.4 kB]
1409 Get:3 http://cdn-fastly.deb.debian.org/debian buster-updates InRelease [49.3 kB]
1410 Get:4 http://security-cdn.debian.org/debian-security buster/updates/main amd64 Packages [159 kB]
1411 Get:5 http://cdn-fastly.deb.debian.org/debian buster/main amd64 Packages [7908 kB]
1412 Get:6 http://cdn-fastly.deb.debian.org/debian buster-updates/main amd64 Packages [5792 B]
1413 Fetched 8309 kB in 6s (1481 kB/s)
1414 Reading package lists...
1415 Reading package lists...
1416 Building dependency tree...
1417 Reading state information...
1418 The following additional packages will be installed:
1419   ca-certificates krb5-locales libcurl4 libgssapi-krb5-2 libk5crypto3
1420   libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common
1421   libnghttp2-14 libpsl5 librtmp1 libsasl2-2 libsasl2-modules
1422   libsasl2-modules-db libssh2-1 openssl publicsuffix
1423 Suggested packages:
1424   krb5-doc krb5-user libsasl2-modules-gssapi-mit
1425   | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp
1426   libsasl2-modules-sql
1427 The following NEW packages will be installed:
1428   ca-certificates curl krb5-locales libcurl4 libgssapi-krb5-2 libk5crypto3
1429   libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common
1430   libnghttp2-14 libpsl5 librtmp1 libsasl2-2 libsasl2-modules
1431   libsasl2-modules-db libssh2-1 openssl publicsuffix
1432 0 upgraded, 20 newly installed, 0 to remove and 0 not upgraded.
1433 Need to get 3471 kB of archives.
1434 After this operation, 7724 kB of additional disk space will be used.
1435 Get:1 http://cdn-fastly.deb.debian.org/debian buster/main amd64 krb5-locales all 1.17-3 [95.4 kB]
1436 Get:2 http://cdn-fastly.deb.debian.org/debian buster/main amd64 openssl amd64 1.1.1d-0+deb10u2 [843 kB]
1437 Get:3 http://cdn-fastly.deb.debian.org/debian buster/main amd64 ca-certificates all 20190110 [157 kB]
1438 Get:4 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libkeyutils1 amd64 1.6-6 [15.0 kB]
1439 Get:5 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libkrb5support0 amd64 1.17-3 [65.6 kB]
1440 Get:6 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libk5crypto3 amd64 1.17-3 [121 kB]
1441 Get:7 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libkrb5-3 amd64 1.17-3 [370 kB]
1442 Get:8 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libgssapi-krb5-2 amd64 1.17-3 [158 kB]
1443 Get:9 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libsasl2-modules-db amd64 2.1.27+dfsg-1 [69.0 kB]
1444 Get:10 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libsasl2-2 amd64 2.1.27+dfsg-1 [106 kB]
1445 Get:11 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libldap-common all 2.4.47+dfsg-3+deb10u1 [89.6 kB]
1446 Get:12 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libldap-2.4-2 amd64 2.4.47+dfsg-3+deb10u1 [225 kB]
1447 Get:13 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libnghttp2-14 amd64 1.36.0-2+deb10u1 [85.0 kB]
1448 Get:14 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libpsl5 amd64 0.20.2-2 [53.7 kB]
1449 Get:15 http://cdn-fastly.deb.debian.org/debian buster/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d.1-2 [60.5 kB]
1450 Get:16 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libssh2-1 amd64 1.8.0-2.1 [140 kB]
1451 Get:17 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libcurl4 amd64 7.64.0-4 [332 kB]
1452 Get:18 http://cdn-fastly.deb.debian.org/debian buster/main amd64 curl amd64 7.64.0-4 [264 kB]
1453 Get:19 http://cdn-fastly.deb.debian.org/debian buster/main amd64 libsasl2-modules amd64 2.1.27+dfsg-1 [104 kB]
1454 Get:20 http://cdn-fastly.deb.debian.org/debian buster/main amd64 publicsuffix all 20190415.1030-1 [116 kB]
1455 debconf: delaying package configuration, since apt-utils is not installed
1456 Fetched 3471 kB in 3s (1046 kB/s)
1457 Selecting previously unselected package krb5-locales.
1458 (Reading database ... 7203 files and directories currently installed.)
1459 Preparing to unpack .../00-krb5-locales_1.17-3_all.deb ...
1460 Unpacking krb5-locales (1.17-3) ...
1461 Selecting previously unselected package openssl.
1462 Preparing to unpack .../01-openssl_1.1.1d-0+deb10u2_amd64.deb ...
1463 Unpacking openssl (1.1.1d-0+deb10u2) ...
1464 Selecting previously unselected package ca-certificates.
1465 Preparing to unpack .../02-ca-certificates_20190110_all.deb ...
1466 Unpacking ca-certificates (20190110) ...
1467 Selecting previously unselected package libkeyutils1:amd64.
1468 Preparing to unpack .../03-libkeyutils1_1.6-6_amd64.deb ...
1469 Unpacking libkeyutils1:amd64 (1.6-6) ...
1470 Selecting previously unselected package libkrb5support0:amd64.
1471 Preparing to unpack .../04-libkrb5support0_1.17-3_amd64.deb ...
1472 Unpacking libkrb5support0:amd64 (1.17-3) ...
1473 Selecting previously unselected package libk5crypto3:amd64.
1474 Preparing to unpack .../05-libk5crypto3_1.17-3_amd64.deb ...
1475 Unpacking libk5crypto3:amd64 (1.17-3) ...
1476 Selecting previously unselected package libkrb5-3:amd64.
1477 Preparing to unpack .../06-libkrb5-3_1.17-3_amd64.deb ...
1478 Unpacking libkrb5-3:amd64 (1.17-3) ...
1479 Selecting previously unselected package libgssapi-krb5-2:amd64.
1480 Preparing to unpack .../07-libgssapi-krb5-2_1.17-3_amd64.deb ...
1481 Unpacking libgssapi-krb5-2:amd64 (1.17-3) ...
1482 Selecting previously unselected package libsasl2-modules-db:amd64.
1483 Preparing to unpack .../08-libsasl2-modules-db_2.1.27+dfsg-1_amd64.deb ...
1484 Unpacking libsasl2-modules-db:amd64 (2.1.27+dfsg-1) ...
1485 Selecting previously unselected package libsasl2-2:amd64.
1486 Preparing to unpack .../09-libsasl2-2_2.1.27+dfsg-1_amd64.deb ...
1487 Unpacking libsasl2-2:amd64 (2.1.27+dfsg-1) ...
1488 Selecting previously unselected package libldap-common.
1489 Preparing to unpack .../10-libldap-common_2.4.47+dfsg-3+deb10u1_all.deb ...
1490 Unpacking libldap-common (2.4.47+dfsg-3+deb10u1) ...
1491 Selecting previously unselected package libldap-2.4-2:amd64.
1492 Preparing to unpack .../11-libldap-2.4-2_2.4.47+dfsg-3+deb10u1_amd64.deb ...
1493 Unpacking libldap-2.4-2:amd64 (2.4.47+dfsg-3+deb10u1) ...
1494 Selecting previously unselected package libnghttp2-14:amd64.
1495 Preparing to unpack .../12-libnghttp2-14_1.36.0-2+deb10u1_amd64.deb ...
1496 Unpacking libnghttp2-14:amd64 (1.36.0-2+deb10u1) ...
1497 Selecting previously unselected package libpsl5:amd64.
1498 Preparing to unpack .../13-libpsl5_0.20.2-2_amd64.deb ...
1499 Unpacking libpsl5:amd64 (0.20.2-2) ...
1500 Selecting previously unselected package librtmp1:amd64.
1501 Preparing to unpack .../14-librtmp1_2.4+20151223.gitfa8646d.1-2_amd64.deb ...
1502 Unpacking librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2) ...
1503 Selecting previously unselected package libssh2-1:amd64.
1504 Preparing to unpack .../15-libssh2-1_1.8.0-2.1_amd64.deb ...
1505 Unpacking libssh2-1:amd64 (1.8.0-2.1) ...
1506 Selecting previously unselected package libcurl4:amd64.
1507 Preparing to unpack .../16-libcurl4_7.64.0-4_amd64.deb ...
1508 Unpacking libcurl4:amd64 (7.64.0-4) ...
1509 Selecting previously unselected package curl.
1510 Preparing to unpack .../17-curl_7.64.0-4_amd64.deb ...
1511 Unpacking curl (7.64.0-4) ...
1512 Selecting previously unselected package libsasl2-modules:amd64.
1513 Preparing to unpack .../18-libsasl2-modules_2.1.27+dfsg-1_amd64.deb ...
1514 Unpacking libsasl2-modules:amd64 (2.1.27+dfsg-1) ...
1515 Selecting previously unselected package publicsuffix.
1516 Preparing to unpack .../19-publicsuffix_20190415.1030-1_all.deb ...
1517 Unpacking publicsuffix (20190415.1030-1) ...
1518 Setting up libkeyutils1:amd64 (1.6-6) ...
1519 Setting up libpsl5:amd64 (0.20.2-2) ...
1520 Setting up libsasl2-modules:amd64 (2.1.27+dfsg-1) ...
1521 Setting up libnghttp2-14:amd64 (1.36.0-2+deb10u1) ...
1522 Setting up krb5-locales (1.17-3) ...
1523 Setting up libldap-common (2.4.47+dfsg-3+deb10u1) ...
1524 Setting up libkrb5support0:amd64 (1.17-3) ...
1525 Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg-1) ...
1526 Setting up librtmp1:amd64 (2.4+20151223.gitfa8646d.1-2) ...
1527 Setting up libk5crypto3:amd64 (1.17-3) ...
1528 Setting up libsasl2-2:amd64 (2.1.27+dfsg-1) ...
1529 Setting up libssh2-1:amd64 (1.8.0-2.1) ...
1530 Setting up libkrb5-3:amd64 (1.17-3) ...
1531 Setting up openssl (1.1.1d-0+deb10u2) ...
1532 Setting up publicsuffix (20190415.1030-1) ...
1533 Setting up libldap-2.4-2:amd64 (2.4.47+dfsg-3+deb10u1) ...
1534 Setting up ca-certificates (20190110) ...
1535 debconf: unable to initialize frontend: Dialog
1536 debconf: (TERM is not set, so the dialog frontend is not usable.)
1537 debconf: falling back to frontend: Readline
1538 debconf: unable to initialize frontend: Readline
1539 debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
1540 debconf: falling back to frontend: Teletype
1541 Updating certificates in /etc/ssl/certs...
1542 128 added, 0 removed; done.
1543 Setting up libgssapi-krb5-2:amd64 (1.17-3) ...
1544 Setting up libcurl4:amd64 (7.64.0-4) ...
1545 Setting up curl (7.64.0-4) ...
1546 Processing triggers for libc-bin (2.28-10) ...
1547 Processing triggers for ca-certificates (20190110) ...
1548 Updating certificates in /etc/ssl/certs...
1549 0 added, 0 removed; done.
1550 Running hooks in /etc/ca-certificates/update.d...
1551 done.
1552 Removing intermediate container 0cd297b35d4c
1553  ---> 43b25b2c55b6
1554 Step 3/3 : HEALTHCHECK --interval=5s --timeout=3s   CMD curl -fs http://localhost/ || exit 1
1555  ---> Running in 91dd264508e7
1556 Removing intermediate container 91dd264508e7
1557  ---> 22628d6caa61
1558 Successfully built 22628d6caa61
1559 Successfully tagged myweb:v1
1560 -->@coder:~/myninx$ sudo docker images
1561 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
1562 myweb                         v1                  22628d6caa61        20 seconds ago      134MB
1563 myip                          latest              fec6dab28edf        20 minutes ago      139MB
1564 ngingx                        v3                  4afd6b31fab7        2 hours ago         126MB
1565 nginx                         v2                  50776ea0e5a4        3 hours ago         126MB
1566 ubuntu                        16.04               56bab49eef2e        7 days ago          123MB
1567 nginx                         latest              231d40e811cd        11 days ago         126MB
1568 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
1569 centos                        latest              0f3e07c0138f        2 months ago        220MB
1570 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
1571 -->@coder:~/myninx$ docker run -d --name web -p 80:80 myweb:v1
1572 docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create?name=web: dial unix /var/run/docker.sock: connect: permission denied.
1573 See 'docker run --help'.
1574 -->@coder:~/myninx$ docker container ls
1575 Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
1576 -->@coder:~/myninx$ sudo docker container ls
1577 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
1578 a279c8cb0430        nginx:v2            "nginx -g 'daemon of…"   3 hours ago         Up 3 hours          0.0.0.0:81->80/tcp   web2
1579 e188b46041a5        nginx               "nginx -g 'daemon of…"   3 hours ago         Up 3 hours          0.0.0.0:80->80/tcp   webserver
1580 -->@coder:~/myninx$ sudo docker container stop web2
1581 web2
1582 -->@coder:~/myninx$ sudo docker container ls
1583 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                NAMES
1584 e188b46041a5        nginx               "nginx -g 'daemon of…"   3 hours ago         Up 3 hours          0.0.0.0:80->80/tcp   webserver
1585 -->@coder:~/myninx$ sudo docker container stop webserver
1586 webserver
1587 -->@coder:~/myninx$ sudo docker container ls
1588 CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
1589 -->@coder:~/myninx$ sudo docker run -d --name web -p 80:80 myweb:v1
1590 5a2a21ea4579603a94690ba31a50f09a6484042b91a71839c1a4eda0d89865c1
1591 -->@coder:~/myninx$ sudo docker container ls
1592 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                   PORTS                NAMES
1593 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   7 seconds ago       Up 6 seconds (healthy)   0.0.0.0:80->80/tcp   web
1594 -->@coder:~/myninx$ sudo docker ps
1595 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                    PORTS                NAMES
1596 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   20 seconds ago      Up 19 seconds (healthy)   0.0.0.0:80->80/tcp   web
1597 -->@coder:~/myninx$ sudo docker ps
1598 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                    PORTS                NAMES
1599 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   57 seconds ago      Up 56 seconds (healthy)   0.0.0.0:80->80/tcp   web
1600 -->@coder:~/myninx$ sudo docker ps
1601 CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS                    PORTS                NAMES
1602 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   About a minute ago   Up 59 seconds (healthy)   0.0.0.0:80->80/tcp   web
1603 -->@coder:~/myninx$ sudo docker container ls
1604 CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS                        PORTS                NAMES
1605 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   About a minute ago   Up About a minute (healthy)   0.0.0.0:80->80/tcp   web
1606 -->@coder:~/myninx$ sudo docker container ls
1607 CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS                        PORTS                NAMES
1608 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   About a minute ago   Up About a minute (healthy)   0.0.0.0:80->80/tcp   web
1609 -->@coder:~/myninx$ sudo docker container ls
1610 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                   PORTS                NAMES
1611 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   2 minutes ago       Up 2 minutes (healthy)   0.0.0.0:80->80/tcp   web
1612 -->@coder:~/myninx$ sudo docker container ps
1613 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                   PORTS                NAMES
1614 5a2a21ea4579        myweb:v1            "nginx -g 'daemon of…"   2 minutes ago       Up 2 minutes (healthy)   0.0.0.0:80->80/tcp   web
1615 -->@coder:~/myninx$ sudo docker inspect --format '{{json .State.Health}}' web | python -m json.tool
1616 {
1617     "FailingStreak": 0,
1618     "Log": [
1619         {
1620             "End": "2019-12-04T16:25:23.874609354+08:00",
1621             "ExitCode": 0,
1622             "Output": "<!DOCTYPE html>\n<html>\n<head>\n<title>Welcome to nginx!</title>\n<style>\n    body {\n        width: 35em;\n        margin: 0 auto;\n        font-family: Tahoma, Verdana, Arial, sans-serif;\n    }\n</style>\n</head>\n<body>\n<h1>Welcome to nginx!</h1>\n<p>If you see this page, the nginx web server is successfully installed and\nworking. Further configuration is required.</p>\n\n<p>For online documentation and support please refer to\n<a href=\"http://nginx.org/\">nginx.org</a>.<br/>\nCommercial support is available at\n<a href=\"http://nginx.com/\">nginx.com</a>.</p>\n\n<p><em>Thank you for using nginx.</em></p>\n</body>\n</html>\n",
1623             "Start": "2019-12-04T16:25:23.607987198+08:00"
1624         },
1625         {
1626             "End": "2019-12-04T16:25:29.148998934+08:00",
1627             "ExitCode": 0,
1628             "Output": "<!DOCTYPE html>\n<html>\n<head>\n<title>Welcome to nginx!</title>\n<style>\n    body {\n        width: 35em;\n        margin: 0 auto;\n        font-family: Tahoma, Verdana, Arial, sans-serif;\n    }\n</style>\n</head>\n<body>\n<h1>Welcome to nginx!</h1>\n<p>If you see this page, the nginx web server is successfully installed and\nworking. Further configuration is required.</p>\n\n<p>For online documentation and support please refer to\n<a href=\"http://nginx.org/\">nginx.org</a>.<br/>\nCommercial support is available at\n<a href=\"http://nginx.com/\">nginx.com</a>.</p>\n\n<p><em>Thank you for using nginx.</em></p>\n</body>\n</html>\n",
1629             "Start": "2019-12-04T16:25:28.887414062+08:00"
1630         },
1631         {
1632             "End": "2019-12-04T16:25:34.415802722+08:00",
1633             "ExitCode": 0,
1634             "Output": "<!DOCTYPE html>\n<html>\n<head>\n<title>Welcome to nginx!</title>\n<style>\n    body {\n        width: 35em;\n        margin: 0 auto;\n        font-family: Tahoma, Verdana, Arial, sans-serif;\n    }\n</style>\n</head>\n<body>\n<h1>Welcome to nginx!</h1>\n<p>If you see this page, the nginx web server is successfully installed and\nworking. Further configuration is required.</p>\n\n<p>For online documentation and support please refer to\n<a href=\"http://nginx.org/\">nginx.org</a>.<br/>\nCommercial support is available at\n<a href=\"http://nginx.com/\">nginx.com</a>.</p>\n\n<p><em>Thank you for using nginx.</em></p>\n</body>\n</html>\n",
1635             "Start": "2019-12-04T16:25:34.162626484+08:00"
1636         },
1637         {
1638             "End": "2019-12-04T16:25:39.692346087+08:00",
1639             "ExitCode": 0,
1640             "Output": "<!DOCTYPE html>\n<html>\n<head>\n<title>Welcome to nginx!</title>\n<style>\n    body {\n        width: 35em;\n        margin: 0 auto;\n        font-family: Tahoma, Verdana, Arial, sans-serif;\n    }\n</style>\n</head>\n<body>\n<h1>Welcome to nginx!</h1>\n<p>If you see this page, the nginx web server is successfully installed and\nworking. Further configuration is required.</p>\n\n<p>For online documentation and support please refer to\n<a href=\"http://nginx.org/\">nginx.org</a>.<br/>\nCommercial support is available at\n<a href=\"http://nginx.com/\">nginx.com</a>.</p>\n\n<p><em>Thank you for using nginx.</em></p>\n</body>\n</html>\n",
1641             "Start": "2019-12-04T16:25:39.430706631+08:00"
1642         },
1643         {
1644             "End": "2019-12-04T16:25:44.989734301+08:00",
1645             "ExitCode": 0,
1646             "Output": "<!DOCTYPE html>\n<html>\n<head>\n<title>Welcome to nginx!</title>\n<style>\n    body {\n        width: 35em;\n        margin: 0 auto;\n        font-family: Tahoma, Verdana, Arial, sans-serif;\n    }\n</style>\n</head>\n<body>\n<h1>Welcome to nginx!</h1>\n<p>If you see this page, the nginx web server is successfully installed and\nworking. Further configuration is required.</p>\n\n<p>For online documentation and support please refer to\n<a href=\"http://nginx.org/\">nginx.org</a>.<br/>\nCommercial support is available at\n<a href=\"http://nginx.com/\">nginx.com</a>.</p>\n\n<p><em>Thank you for using nginx.</em></p>\n</body>\n</html>\n",
1647             "Start": "2019-12-04T16:25:44.705825687+08:00"
1648         }
1649     ],
1650     "Status": "healthy"
1651 }
1652 -->@coder:~/myninx$ sudo docker search npm
1653 NAME                                DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
1654 mkenney/npm                         A simple Node container with various wrapper…   50                                      [OK]
1655 folha/npm-proxy-cache               HTTP/HTTPS caching proxy for work with npm u…   2                                       [OK]
1656 resinci/npm-x86_64-node4                                                            1                                       
1657 resinci/npm-x86_64-node8                                                            1                                       
1658 ymedlop/npm-cache-resource          a Concourse resource for caching dependencie…   1                                       [OK]
1659 tsumiki/npm_run_build               npm install -> npm run build                    1                                       
1660 resinci/npm-x86_64-ubuntu-node8                                                     1                                       
1661 theyorkshiredev/npm-container       Alpine image with NPM and Node installed        1                                       [OK]
1662 resinci/npm-x86_64-ubuntu-node10                                                    0                                       
1663 arwineap/npm-cache-resource         npm-cache-resource with added autoconf          0                                       [OK]
1664 resinci/npm-x86_64-alpine-node10                                                    0                                       
1665 resinci/npm-x86_64-ubuntu-node6                                                     0                                       
1666 npmjs/npm-auth-ws                   The plugin-based authentication and authoriz…   0                                       
1667 resinci/npm-x86_64-node9                                                            0                                       
1668 resinci/npm-x86_64-ubuntu-node4                                                     0                                       
1669 lloydg/npm-resource                                                                 0                                       
1670 resinci/npm-x86_64-node10                                                           0                                       
1671 resinci/npm-x86-ubuntu-node8                                                        0                                       
1672 resinci/npm-x86_64-ubuntu-node9                                                     0                                       
1673 idahobean/npm-resource              https://github.com/idahobean/npm-resource       0                                       
1674 resinci/npm-x86_64-node6                                                            0                                       
1675 cato1971/npm-cache-resource                                                         0                                       
1676 mvila/npm-addict                    npm addict automated build                      0                                       [OK]
1677 ripa1993/npm-cache-resource                                                         0                                       
1678 bobvanlooveren/npm-cache-resource   npm-cache-resource based on the standard nod…   0                                       
1679 -->@coder:~/myninx$ df -h
1680 文件系统                     容量  已用  可用 已用% 挂载点
1681 udev                         1.5G     0  1.5G    0% /dev
1682 tmpfs                        298M  8.6M  290M    3% /run
1683 /dev/mapper/ubuntu--vg-root   18G  6.7G   11G   40% /
1684 tmpfs                        1.5G     0  1.5G    0% /dev/shm
1685 tmpfs                        5.0M     0  5.0M    0% /run/lock
1686 tmpfs                        1.5G     0  1.5G    0% /sys/fs/cgroup
1687 /dev/sda1                    720M  208M  476M   31% /boot
1688 tmpfs                        298M     0  298M    0% /run/user/0
1689 -->@coder:~/myninx$ lsblk
1690 NAME                  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
1691 sda                     8:0    0   20G  0 disk 
1692 ├─sda2                  8:2    0    1K  0 part 
1693 ├─sda5                  8:5    0 19.3G  0 part 
1694 │ ├─ubuntu--vg-swap_1 253:1    0  976M  0 lvm  [SWAP]
1695 │ └─ubuntu--vg-root   253:0    0 18.3G  0 lvm  /
1696 └─sda1                  8:1    0  731M  0 part /boot
1697 -->@coder:~/myninx$ man docker history
1698 DOCKER(1)                                                                                                                                                  DOCKER(1)
1699 
1700 NAME
1701        docker-history - Show the history of an image
1702 
1703 SYNOPSIS
1704        docker history [OPTIONS] IMAGE
1705 
1706 DESCRIPTION
1707        Alias for docker image history.
1708 
1709 OPTIONS
1710        --format=""
1711            Pretty-print images using a Go template
1712 -->@coder:~/myninx$ sudo docker history nginx
1713 IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
1714 231d40e811cd        11 days ago         /bin/sh -c #(nop)  CMD ["nginx" "-g" "daemon…   0B                  
1715 <missing>           11 days ago         /bin/sh -c #(nop)  STOPSIGNAL SIGTERM           0B                  
1716 <missing>           11 days ago         /bin/sh -c #(nop)  EXPOSE 80                    0B                  
1717 <missing>           11 days ago         /bin/sh -c ln -sf /dev/stdout /var/log/nginx…   22B                 
1718 <missing>           11 days ago         /bin/sh -c set -x     && addgroup --system -…   57.1MB              
1719 <missing>           11 days ago         /bin/sh -c #(nop)  ENV PKG_RELEASE=1~buster     0B                  
1720 <missing>           11 days ago         /bin/sh -c #(nop)  ENV NJS_VERSION=0.3.7        0B                  
1721 <missing>           11 days ago         /bin/sh -c #(nop)  ENV NGINX_VERSION=1.17.6     0B                  
1722 <missing>           11 days ago         /bin/sh -c #(nop)  LABEL maintainer=NGINX Do…   0B                  
1723 <missing>           11 days ago         /bin/sh -c #(nop)  CMD ["bash"]                 0B                  
1724 <missing>           11 days ago         /bin/sh -c #(nop) ADD file:bc8179c87c8dbb3d9…   69.2MB              
1725 -->@coder:~/myninx$ free -m
1726               total        used        free      shared  buff/cache   available
1727 Mem:           2978         219         687           8        2071        2496
1728 Swap:           975           0         975
1729 -->@coder:~/myninx$ sudo docker images
1730 REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
1731 myweb                         v1                  22628d6caa61        15 minutes ago      134MB
1732 myip                          latest              fec6dab28edf        35 minutes ago      139MB
1733 ngingx                        v3                  4afd6b31fab7        2 hours ago         126MB
1734 nginx                         v2                  50776ea0e5a4        3 hours ago         126MB
1735 ubuntu                        16.04               56bab49eef2e        7 days ago          123MB
1736 nginx                         latest              231d40e811cd        11 days ago         126MB
1737 alpine                        latest              965ea09ff2eb        6 weeks ago         5.55MB
1738 centos                        latest              0f3e07c0138f        2 months ago        220MB
1739 ansible/ubuntu14.04-ansible   latest              4621d4fe2959        4 years ago         461MB
1740 -->@coder:~/myninx$ sudo docker images alpine
1741 REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
1742 alpine              latest              965ea09ff2eb        6 weeks ago         5.55MB
1743 -->@coder:~/myninx$ sudo docker save alpine | gzip > alpine-latest.tar.gz
1744 -->@coder:~/myninx$ ls
1745 alpine-latest.tar.gz  Dockerfile  Dockerfile.ip
1746 -->@coder:~/myninx$ sudo docker save alpine | bzip2 | pv | ssh root@192.168.114.133 'cat | docker load'
1747 
1748 [1]+  已停止               sudo docker save alpine | bzip2 | pv | ssh root@192.168.114.133 'cat | docker load'
1749 -->@coder:~/myninx$ 程序“pv”尚未安装。 您可以使用以下命令安装:
1750 sudo apt install pv
1751 ^C
1752 -->@coder:~/myninx$ sudo whereis pv
1753 pv:
1754 -->@coder:~/myninx$ sudo apt-get install pv
1755 正在读取软件包列表... 完成
1756 正在分析软件包的依赖关系树       
1757 正在读取状态信息... 完成       
1758 下列软件包是自动安装的并且现在不需要了:
1759   linux-headers-4.15.0-45 linux-headers-4.15.0-45-generic linux-image-4.15.0-45-generic linux-modules-4.15.0-45-generic linux-modules-extra-4.15.0-45-generic
1760   snapd-login-service
1761 使用'sudo apt autoremove'来卸载它(它们)。
1762 下列【新】软件包将被安装:
1763   pv
1764 升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 1 个软件包未被升级。
1765 需要下载 46.8 kB 的归档。
1766 解压缩后会消耗 170 kB 的额外空间。
1767 获取:1 http://mirrors.ustc.edu.cn/ubuntu xenial/universe amd64 pv amd64 1.6.0-1 [46.8 kB]
1768 已下载 46.8 kB,耗时 6秒 (7,196 B/s)
1769 正在选中未选择的软件包 pv。
1770 (正在读取数据库 ... 系统当前共安装有 256425 个文件和目录。)
1771 正准备解包 .../archives/pv_1.6.0-1_amd64.deb  ...
1772 正在解包 pv (1.6.0-1) ...
1773 正在处理用于 man-db (2.7.5-1) 的触发器 ...
1774 正在设置 pv (1.6.0-1) ...
1775 -->@coder:~/myninx$ sudo docker save alpine | bzip2 | pv | ssh root@192.168.114.133 'cat | docker load'
1776 The authenticity of host '192.168.114.133 (192.168.114.133)' can't be established.
1777 ECDSA key fingerprint is SHA256:MUD4Nv3v9qHNdhUL4bEoUXn46AXqGFD80C6WsCmal2Y.
1778 Are you sure you want to continue connecting (yes/no)? yes
1779 Warning: Permanently added '192.168.114.133' (ECDSA) to the list of known hosts.
1780 root@192.168.114.133's password: 
1781 2.63MiB 0:00:16 [ 166KiB/s] [             <=>                                                                                                                           ]
1782 Loaded image: alpine:latest
1783 
1784 [END] 2019/12/4 16:42:21
1785 
1786 
1787 #注意: 以下在114.133机器上验证docker 接收的镜像
1788 [root@cent76 ~]# docker images
1789 REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
1790 alpine              latest              965ea09ff2eb        6 weeks ago         5.55MB

 

posted on 2019-12-04 16:51  Z_m  阅读(606)  评论(0编辑  收藏  举报

导航