{"id":1912,"date":"2015-07-02T23:10:26","date_gmt":"2015-07-02T14:10:26","guid":{"rendered":"http:\/\/tech.akat.info\/?p=1912"},"modified":"2015-07-02T23:15:17","modified_gmt":"2015-07-02T14:15:17","slug":"docker","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=1912","title":{"rendered":"Docker"},"content":{"rendered":"<p><a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_214621.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_214621-300x90.png\" alt=\"2015-07-02_214621\" width=\"300\" height=\"90\" class=\"alignnone size-medium wp-image-1917\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_214621-300x90.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_214621.png 654w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h1>\u6982\u8981<\/h1>\n<p>http:\/\/dotinstall.com\/lessons\/basic_docker<br \/>\n\u306e\u307e\u3068\u3081\u3002\u3053\u306e\u30e1\u30e2\u898b\u308b\u306a\u3089\u672c\u5bb6\u898b\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3059<\/p>\n<h1>Docker\u3068\u306f<\/h1>\n<p>\u30fb\u8efd\u91cf\u306a\u4eee\u60f3\u5316\u74b0\u5883\u3092\u4f5c\u308b\u30c4\u30fc\u30eb<br \/>\n\u30fbUbuntu\u306b\u3066\u958b\u767a\u3055\u308c\u3066\u3044\u308b<\/p>\n<pre class=\"brush: plain; title: \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5; notranslate\" title=\"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\">\r\nroot@ubuntu:\/home\/shimizu# wget -qO- https:\/\/get.docker.com\/ | sh\r\n...\r\nThe following NEW packages will be installed:\r\n  crda iw libnl-3-200 libnl-genl-3-200 linux-image-3.13.0-55-generic\r\n  linux-image-extra-3.13.0-55-generic linux-image-extra-3.16.0-40-generic\r\n  linux-image-extra-virtual linux-image-generic wireless-regdb\r\n0 upgraded, 10 newly installed, 0 to remove and 32 not upgraded.\r\nNeed to get 89.5 MB of archives.\r\n...\r\n\r\nroot@ubuntu:\/home\/shimizu# docker -v\r\nDocker version 1.7.0, build 0baf609\r\n<\/pre>\n<h1>\u30a4\u30e1\u30fc\u30b8<\/h1>\n<p><a href=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_223317.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_223317-300x241.png\" alt=\"2015-07-02_223317\" width=\"300\" height=\"241\" class=\"alignnone size-medium wp-image-1919\" srcset=\"https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_223317-300x241.png 300w, https:\/\/tech.akat.info\/wp-content\/uploads\/2015\/07\/2015-07-02_223317.png 651w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nDocker Index:Image\u306e\u5171\u6709\u30b5\u30a4\u30c8<br \/>\nImage\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9(docker pull)\u3057\u3066\u3001Container\u3068\u3057\u3066\u5b9f\u884c\u3059\u308b(docker run)<br \/>\nContainer\u3092\u5225\u306eDocker\u30b5\u30fc\u30d0\u306b\u79fb\u52d5\u3055\u305b\u308b\u306b\u306f\u3001Container\u3092Image\u306b\u5909\u63db(docker commit)\u3057\u3066<br \/>\nDocker Index\u306b\u767b\u9332\u3059\u308b(docker push)<\/p>\n<h1>\u64cd\u4f5c\u65b9\u6cd5<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n### Image\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9 ###\r\nroot@ubuntu:\/home\/shimizu# docker search centos\r\nNAME                          DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED\r\ncentos                        The official build of CentOS.                   1092      &#x5B;OK]\r\ntutum\/centos                  Centos image with SSH access. For the root...   13                   &#x5B;OK]\r\nblalor\/centos                 Bare-bones base CentOS 6.5 image                9                    &#x5B;OK]\r\ntorusware\/speedus-centos      Always updated official CentOS docker imag...   6                    &#x5B;OK]\r\nmillion12\/centos-supervisor   Base CentOS-7 with supervisord launcher, h...   5                    &#x5B;OK]\r\njdeathe\/centos-ssh            CentOS-6 6.6 x86_64 \/ EPEL Repo. \/ OpenSSH...   3                    &#x5B;OK]\r\nlayerworx\/centos              A general CentOS 6 image with the EPEL6 an...   2                    &#x5B;OK]\r\njdeathe\/centos-ssh-mysql      CentOS-6 6.6 x86_64 \/ MySQL.                    2                    &#x5B;OK]\r\npdericson\/centos              Docker image for CentOS                         0                    &#x5B;OK]\r\nnathonfowlie\/centos-jre       Latest CentOS image with the JRE pre-insta...   0                    &#x5B;OK]\r\n\r\nroot@ubuntu:\/home\/shimizu# docker pull centos\r\nlatest: Pulling from centos\r\nf1b10cd84249: Pull complete\r\nc852f6d61e65: Pull complete\r\n7322fbe74aa5: Already exists\r\ncentos:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.\r\nDigest: sha256:a4627c43bafc86705af2e8a5ea1f0ed34fbf27b6e7a392e5ee45dbd4736627cc\r\nStatus: Downloaded newer image for centos:latest\r\n\r\nroot@ubuntu:\/home\/shimizu# docker images\r\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\r\ncentos              latest              7322fbe74aa5        13 days ago         172.2 MB\r\n\r\n# \u8a73\u7d30\u3092\u8868\u793a\u3059\u308b\u3002ID\u306b\u3064\u3044\u3066\u306f\u4e00\u610f\u3067\u3042\u308c\u3070\u4f55\u6587\u5b57\u3067\u3082OK\r\nroot@ubuntu:\/home\/shimizu# docker inspect 73 \r\n...\r\n\r\n### Container\u3092\u4f5c\u6210\u3059\u308b ###\r\nroot@ubuntu:\/home\/shimizu# docker run 73 echo &quot;hello world&quot;\r\nhello world\r\n\r\n# \u5b9f\u884c\u304c\u5b8c\u4e86\u3057\u305f\u30d7\u30ed\u30bb\u30b9\u3092\u8868\u793a\u3059\u308b\r\nroot@ubuntu:\/home\/shimizu# docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND                CREATED              STATUS                          PORTS               NAMES\r\n6d654c9581e3        73                  &quot;echo 'hello world'&quot;   About a minute ago   Exited (0) About a minute ago                       sharp_kirch\r\n\r\nroot@ubuntu:\/home\/shimizu# docker run -d centos free -s 3\r\n29c3e9f265781ab94817e1c8ca2f54bf26d243ad702db0acd1f2631c4332a283\r\n\r\n# \u5b9f\u884c\u4e2d\u306e\u30d7\u30ed\u30bb\u30b9\u3092\u8868\u793a\u3059\u308b\r\nroot@ubuntu:\/home\/shimizu# docker ps\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES\r\n29c3e9f26578        centos              &quot;free -s 3&quot;         2 seconds ago       Up 1 seconds                            hungry_jones\r\n\r\nroot@ubuntu:\/home\/shimizu# docker logs 29c3e9f26578\r\n              total        used        free      shared  buff\/cache   available\r\nMem:         686628       84136      107884         452      494608      474308\r\nSwap:             0           0           0\r\n\r\n              total        used        free      shared  buff\/cache   available\r\nMem:         686628       81572      110440         460      494616      476900\r\nSwap:             0           0           0\r\n\r\n              total        used        free      shared  buff\/cache   available\r\nMem:         686628       81572      110440         460      494616      476900\r\nSwap:             0           0           0\r\n\r\n              total        used        free      shared  buff\/cache   available\r\nMem:         686628       81560      110440         460      494628      476900\r\nSwap:             0           0           0\r\n\r\n              total        used        free      shared  buff\/cache   available\r\nMem:         686628       81560      110440         460      494628      476912\r\nSwap:             0           0           0\r\n\r\nroot@ubuntu:\/home\/shimizu# docker kill 29c3e9f26578\r\n29c3e9f26578\r\n\r\nroot@ubuntu:\/home\/shimizu# docker ps\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES\r\n\r\n### Container\u304b\u3089Image\u3092\u4f5c\u6210\u3057\u3066\u3001\u6b63\u3057\u304f\u52d5\u4f5c\u3059\u308b\u304b\u78ba\u8a8d\u3059\u308b ###\r\nroot@ubuntu:\/home\/shimizu# docker run -i -t centos \/bin\/bash\r\n&#x5B;root@ff4b98c69eb6 \/]# touch hello.txt\r\n&#x5B;root@ff4b98c69eb6 \/]# ls\r\nbin  dev  etc  hello.txt  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var\r\n&#x5B;root@ff4b98c69eb6 \/]# exit\r\n\r\nroot@ubuntu:\/home\/shimizu# docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND                CREATED             STATUS                       PORTS               NAMES\r\nff4b98c69eb6        centos              &quot;\/bin\/bash&quot;            25 seconds ago      Exited (0) 9 seconds ago                         hopeful_pike                    \r\n\r\nroot@ubuntu:\/home\/shimizu# docker commit ff4 test\/hello\r\n8fac9b012f2d1983a9bd10ad5f1e48ab270b9603963dff46dd22be777ccdb04f\r\n\r\nroot@ubuntu:\/home\/shimizu# docker images\r\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\r\ntest\/hello          latest              8fac9b012f2d        9 seconds ago       172.2 MB\r\ncentos              latest              7322fbe74aa5        13 days ago         172.2 MB\r\n\r\nroot@ubuntu:\/home\/shimizu# docker run -i -t test\/hello \/bin\/bash\r\n&#x5B;root@33f4291501ed \/]# ls\r\nbin  dev  etc  hello.txt  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 http:\/\/dotinstall.com\/lessons\/basic_docker \u306e\u307e\u3068\u3081\u3002\u3053\u306e\u30e1\u30e2\u898b\u308b\u306a\u3089\u672c\u5bb6\u898b\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3059 Docker\u3068\u306f \u30fb\u8efd\u91cf\u306a\u4eee\u60f3\u5316\u74b0\u5883\u3092\u4f5c\u308b\u30c4\u30fc\u30eb \u30fbUbuntu\u306b\u3066\u958b\u767a\u3055\u308c\u3066 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[72],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1912"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1912"}],"version-history":[{"count":9,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1912\/revisions"}],"predecessor-version":[{"id":1927,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/1912\/revisions\/1927"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}