{"id":4262,"date":"2014-08-05T09:12:49","date_gmt":"2014-08-05T00:12:49","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=4262"},"modified":"2018-11-14T16:33:51","modified_gmt":"2018-11-14T07:33:51","slug":"introduction-to-docker","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2014\/08\/05\/introduction-to-docker\/","title":{"rendered":"\u9694\u96e2\u306e\u6280\u8853Docker\u306e\u8003\u3048\u65b9\u3068\u4f7f\u3044\u65b9\u306e\u57fa\u672c"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>\u300c<a title=\"AWS\u3067Docker\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\uff01\" href=\"http:\/\/www.techscore.com\/blog\/2014\/07\/08\/try-docker-on-aws\/\">AWS\u3067Docker\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\uff01<\/a>\u300d\u3067\u306f Docker \u3092\u53d6\u308a\u3042\u3048\u305a\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u300cDocker \u3068\u306f\uff1f\u300d\u3068\u3044\u3046\u3068\u3053\u308d\u304b\u3089\u3001Docker \u306e\u57fa\u672c\u7684\u306a\u64cd\u4f5c\u3092\u884c\u3046\u3068\u3053\u308d\u307e\u3067\u898b\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>Docker \u3068\u306f<\/h2>\n<p>Docker \u3068\u306f\u30b3\u30f3\u30c6\u30ca\u578b\u306e\u4eee\u60f3\u5316\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3059\u3002<\/p>\n<p>Xen \u3084 VMware \u306e\u3088\u3046\u306a\u30b5\u30fc\u30d0\u4eee\u60f3\u5316\u3068\u306e\u9055\u3044\u306f\u3001\u6271\u3046\u5358\u4f4d\u304c\u30de\u30b7\u30f3\u3067\u306f\u306a\u304f\u30d7\u30ed\u30bb\u30b9\u3067\u3042\u308b\u70b9\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u9055\u3044\u306f\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u4eee\u60f3\u5316\u3067\u306f\u30db\u30b9\u30c8\u30de\u30b7\u30f3\u4e0a\u3067\u30b2\u30b9\u30c8\u30de\u30b7\u30f3\u304c\u52d5\u304d\u3001\u30b2\u30b9\u30c8\u30de\u30b7\u30f3\u5185\u3067\u69d8\u3005\u306a\u30d7\u30ed\u30bb\u30b9\u304c\u52d5\u304d\u307e\u3059\u3002\u4e00\u65b9\u306e\u30b3\u30f3\u30c6\u30ca\u578b\u306e\u4eee\u60f3\u5316\u3067\u306f\u3001\u30db\u30b9\u30c8 OS \u4e0a\u306b\u30b3\u30f3\u30c6\u30ca\u3068\u3044\u3046\u9694\u96e2\u3055\u308c\u305f\u7a7a\u9593\u304c\u4f5c\u6210\u3055\u308c\u3001\u305d\u306e\u4e2d\u3067\u30d7\u30ed\u30bb\u30b9\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30b3\u30f3\u30c6\u30ca\u306f\u9694\u96e2\u306e\u6280\u8853<\/h2>\n<p>Docker \u3092\u4f7f\u3044\u59cb\u3081\u305f\u3070\u304b\u308a\u3060\u3068\u300c\u30b3\u30f3\u30c6\u30ca\u5185\u306b bash \u3067\u63a5\u7d9a\u3057\u3066\u307f\u305f\u3051\u308c\u3069 cron \u3084 syslog \u7b49\u306e\u30c7\u30fc\u30e2\u30f3\u304c\u52d5\u3044\u3066\u3044\u306a\u3044\u2026\u300d\u3068\u56f0\u60d1\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3057\u304b\u3057\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u52d5\u3044\u3066\u3044\u308b\u306e\u306f\u30de\u30b7\u30f3\u3067\u306f\u306a\u304f\u5358\u306a\u308b\u30d7\u30ed\u30bb\u30b9\uff08\u3053\u306e\u5834\u5408\u306f bash \u306e\u30d7\u30ed\u30bb\u30b9\uff09\u3067\u3042\u308b\u305f\u3081\u3001\u5f53\u7136\u306a\u304c\u3089 cron \u3084 syslog \u7b49\u306e\u4ed6\u306e\u30d7\u30ed\u30bb\u30b9\u306f\u52d5\u3044\u3066\u3044\u307e\u305b\u3093\u3002\u300c\u30b3\u30f3\u30c6\u30ca\u3068\u3044\u3046\u9694\u96e2\u3055\u308c\u305f\u7a7a\u9593\u3067\u4e00\u3064\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u52d5\u304f\u300d\u3068\u3044\u3046\u610f\u8b58\u3092\u6301\u3064\u3053\u3068\u304c\u5927\u5207\u3067\u3059\u3002<\/p>\n<p>\u300c\u4eee\u60f3\u5316\u300d\u3068\u8a00\u308f\u308c\u308b\u3068\u300c\u30db\u30b9\u30c8\u30de\u30b7\u30f3\u306e\u4e0a\u3067\u30b2\u30b9\u30c8\u30de\u30b7\u30f3\u304c\u52d5\u304f\u300d\u3068\u3044\u3046\u30ec\u30a4\u30e4\u30fc\u69cb\u9020\u3092\u30a4\u30e1\u30fc\u30b8\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u304c\u3001\u30b3\u30f3\u30c6\u30ca\u578b\u306e\u4eee\u60f3\u5316\u3067\u306f\u5168\u3066\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u30db\u30b9\u30c8\u30de\u30b7\u30f3\u4e0a\u3067\u52d5\u304d\u307e\u3059\u3002\u30b3\u30f3\u30c6\u30ca\u578b\u306e\u4eee\u60f3\u5316\u306f\u3001\u30db\u30b9\u30c8\u306e\u7a7a\u9593\u3092\u7e26\u306b\u5207\u308b\u3001\u9694\u96e2\u306e\u6280\u8853\u3068\u8a00\u3048\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u4eee\u60f3\u5316\u3068\u30b3\u30f3\u30c6\u30ca\u578b\u306e\u4eee\u60f3\u5316\u306e\u9055\u3044\u3092\u56f3\u3067\u8868\u3059\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/9b8bb9e394bd9d36da9ca9ca0e7d87eb.png\" rel=\"facebox\" rel=\"attachment wp-att-4279\"><img loading=\"lazy\" class=\"alignnone  wp-image-4279\" alt=\"Docker-\u30b5\u30fc\u30d0\u4eee\u60f3\u5316\" src=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/9b8bb9e394bd9d36da9ca9ca0e7d87eb.png\" width=\"307\" height=\"192\" srcset=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/9b8bb9e394bd9d36da9ca9ca0e7d87eb.png 640w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/9b8bb9e394bd9d36da9ca9ca0e7d87eb-300x187.png 300w\" sizes=\"(max-width: 307px) 100vw, 307px\" \/><\/a><a href=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/4c9bf960873dfaac78d33092291ca6ea.png\" rel=\"facebox\" rel=\"attachment wp-att-4276\"><img loading=\"lazy\" class=\"alignnone  wp-image-4276\" alt=\"Docker-\u30b3\u30f3\u30c6\u30ca\u578b\u4eee\u60f3\u5316\" src=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/4c9bf960873dfaac78d33092291ca6ea.png\" width=\"307\" height=\"192\" srcset=\"https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/4c9bf960873dfaac78d33092291ca6ea.png 640w, https:\/\/www.techscore.com\/blog\/wp\/wp-content\/uploads\/2014\/08\/4c9bf960873dfaac78d33092291ca6ea-300x187.png 300w\" sizes=\"(max-width: 307px) 100vw, 307px\" \/><\/a><\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u578b\u4eee\u60f3\u5316\u306e\u56f3\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u52d5\u3044\u3066\u3044\u306a\u3044\u30d7\u30ed\u30bb\u30b9\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u666e\u901a\u306e\u30d7\u30ed\u30bb\u30b9\u3068\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u5b9f\u884c\u3059\u308b\u30d7\u30ed\u30bb\u30b9\u304c\u540c\u3058\u30db\u30b9\u30c8\u30de\u30b7\u30f3\u4e0a\u306b\u540c\u5c45\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>Docker \u7528\u8a9e\u96c6<\/h2>\n<p>Docker \u3092\u4f7f\u3046\u4e0a\u3067\u826f\u304f\u51fa\u3066\u304f\u308b\u7528\u8a9e\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n<h3>\u30b3\u30f3\u30c6\u30ca<\/h3>\n<p>\u5916\u90e8\u304b\u3089\u30d7\u30ed\u30bb\u30b9\u7a7a\u9593\u3084\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7b49\u304c\u9694\u96e2\u3055\u308c\u305f\u7a7a\u9593\u306e\u3053\u3068\u3067\u3059\u3002\u30b3\u30f3\u30c6\u30ca\u306e\u4e2d\u3067\u30d7\u30ed\u30bb\u30b9\u304c\u52d5\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30a4\u30e1\u30fc\u30b8<\/h3>\n<p>\u30b3\u30f3\u30c6\u30ca\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u3059\u3002\u30a4\u30e1\u30fc\u30b8\u3092\u5143\u306b\u3057\u3066\u65b0\u3057\u3044\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30ec\u30b8\u30b9\u30c8\u30ea<\/h3>\n<p>\u30a4\u30e1\u30fc\u30b8\u304c\u4fdd\u5b58\u3055\u308c\u308b\u5834\u6240\u306e\u3053\u3068\u3067\u3059\u3002<a href=\"https:\/\/registry.hub.docker.com\/\">Docker Hub<\/a> \u306e\u3088\u3046\u306a\u30d1\u30d6\u30ea\u30c3\u30af\u306a\u30b5\u30fc\u30d3\u30b9\u3082\u3042\u308a\u3001\u30a4\u30e1\u30fc\u30b8\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u5404\u7a2e\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u3084\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u7528\u306e\u30aa\u30d5\u30a3\u30b7\u30e3\u30eb\u306a\u30a4\u30e1\u30fc\u30b8\u3082\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u81ea\u5206\u7528\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u3068\u304d\u306e\u30d9\u30fc\u30b9\u306b\u5229\u7528\u3059\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<h2>Docker \u306e\u57fa\u672c\u7684\u306a\u64cd\u4f5c<\/h2>\n<h3>\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n<p>\u307e\u305a\u306f\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304b\u3089\u59cb\u3081\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u3069\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u304c\u3042\u308b\u306e\u304b <a href=\"https:\/\/registry.hub.docker.com\/\">Docker Hub Registry<\/a> \u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Ubuntu \u3084 CentOS\u3001PostgreSQL \u3084 WordPress \u7b49\u306e\u30aa\u30d5\u30a3\u30b7\u30e3\u30eb\u30a4\u30e1\u30fc\u30b8\u3082\u3042\u308b\u306e\u3067\u3001\u7528\u9014\u306b\u5408\u3063\u305f\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>docker search \u30b3\u30de\u30f3\u30c9\u3067\u691c\u7d22\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker search ubuntu<\/pre>\n<p>\u3053\u3053\u3067\u306f Ubuntu \u306e\u6700\u65b0\uff08latest\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker pull ubuntu:latest<\/pre>\n<h3>\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3059\u308b\uff08\u30b3\u30de\u30f3\u30c9\u3092\u65b0\u3057\u3044\u30b3\u30f3\u30c6\u30ca\u3067\u5b9f\u884c\u3059\u308b\uff09<\/h3>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\uff08\u30b3\u30f3\u30c6\u30ca\u3067\u30d7\u30ed\u30bb\u30b9\u3092\u5b9f\u884c\uff09\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker run -it ubuntu:latest bash<\/pre>\n<p>\u9069\u5f53\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">echo hello &gt; \/tmp\/hello.txt<\/pre>\n<h3>\u30c7\u30bf\u30c3\u30c1\u3001\u30a2\u30bf\u30c3\u30c1\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u7d42\u4e86<\/h3>\n<p>\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u30c7\u30bf\u30c3\u30c1\u3059\u308b\u306b\u306f Ctrl+p \u3092\u62bc\u3057\u3001\u6b21\u306b Ctrl+q \u3092\u62bc\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">Ctrl+p Ctrl+q<\/pre>\n<p>\u3053\u308c\u3067\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u30c7\u30bf\u30c3\u30c1\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d7\u30ed\u30bb\u30b9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u30c7\u30bf\u30c3\u30c1\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u304c\u52d5\u304d\u7d9a\u3051\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ docker ps\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES\r\n2067f43896a2        ubuntu:latest       bash                3 minutes ago       Up 3 minutes                            naughty_kirch<\/pre>\n<p>\u300cSTATUS\u300d\u306e\u90e8\u5206\u304c\u300cUp 3 minutes\u300d\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f 3 \u5206\u524d\u306b\u8d77\u52d5\u3057\u305f\uff08\u307e\u3060\u5b9f\u884c\u4e2d\uff09\u3068\u3044\u3046\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<p>\u300cCONTAINER ID\u300d\u306f\u300c2067f43896a2\u300d\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e ID \u306f\u30b3\u30f3\u30c6\u30ca\u3092\u64cd\u4f5c\u3059\u308b\u3068\u304d\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u30b3\u30f3\u30c6\u30ca\u306b\u30a2\u30bf\u30c3\u30c1\u3059\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker attach 2067f43896a2<\/pre>\n<p>\u5148\u307b\u3069\u4f5c\u6210\u3057\u305f \/tmp\/hello.txt \u304c\u6b8b\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\"># cat \/tmp\/hello.txt\r\nhello<\/pre>\n<p>\u305d\u308c\u3067\u306f exit \u3067 bash \u3092\u7d42\u4e86\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\">exit<\/pre>\n<p>docker ps \u3067\u78ba\u8a8d\u3059\u308b\u3068\u30b3\u30f3\u30c6\u30ca\u4e00\u89a7\u304b\u3089\u6d88\u3048\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker ps<\/pre>\n<p>-a \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u7d42\u4e86\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3082\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES\r\n2067f43896a2        ubuntu:latest       bash                9 minutes ago       Exited (0) 13 seconds ago                       naughty_kirch<\/pre>\n<p>\u300cSTATUS\u300d\u304c\u300cExited (0) 13 seconds ago\u300d\u3068\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u3001\u300c13 \u79d2\u524d\u306b\u7d42\u4e86\u30b9\u30c6\u30fc\u30bf\u30b9 0 \u3067\u7d42\u4e86\u3057\u305f\u300d\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30b3\u30f3\u30c6\u30ca\u306e\u958b\u59cb\u3068\u505c\u6b62<\/h3>\n<p>docker start \u3067\u30b3\u30f3\u30c6\u30ca\u3092\u518d\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff08\u518d\u5ea6\u30a2\u30bf\u30c3\u30c1\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff09\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker start 2067f43896a2<\/pre>\n<p>\u5f15\u6570\u306f\u30b3\u30f3\u30c6\u30ca\u306e ID \u3067\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u505c\u6b62\u3059\u308b\u306b\u306f docker stop \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker stop 2067f43896a2<\/pre>\n<p>\u5f15\u6570\u306f\u30b3\u30f3\u30c6\u30ca\u306e ID \u3067\u3059\u3002<\/p>\n<h3>\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b<\/h3>\n<p>\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker commit 2067f43896a2 my-example<\/pre>\n<p>\u5f15\u6570\u306f\u30b3\u30f3\u30c6\u30ca ID \u3068\u4f5c\u6210\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u306e\u540d\u524d\u3067\u3059\u3002<\/p>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30d9\u30fc\u30b9\u3068\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u3057\u3001\u305d\u308c\u306b\u5fc5\u8981\u306a\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u884c\u3044\u3001\u81ea\u5206\u7528\u306e\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3066\u304a\u3051\u3070\u3001\u6b21\u56de\u304b\u3089\u540c\u3058\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u4f5c\u696d\u3092\u884c\u308f\u306a\u304f\u3066\u6e08\u307f\u307e\u3059\u3002<\/p>\n<h3>\u30b3\u30f3\u30c6\u30ca\u3092\u524a\u9664\u3059\u308b<\/h3>\n<p>Docker \u3092\u4f7f\u3046\u3068\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210 \/ \u7834\u68c4\u3092\u6c17\u8efd\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u60c5\u5831\u306f\u5168\u3066\u6b8b\u3055\u308c\u308b\u305f\u3081\u3001\u3044\u3064\u306e\u9593\u306b\u304b\u30c7\u30a3\u30b9\u30af\u3092\u5927\u91cf\u306b\u6d88\u8cbb\u3057\u3066\u3044\u305f\u3001\u3068\u3044\u3046\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>docker ps \u306b\u30aa\u30d7\u30b7\u30e7\u30f3 a \u3068 s \u3092\u4ed8\u3051\u3066\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ docker ps -as\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES               SIZE\r\n2067f43896a2        ubuntu:latest       bash                24 minutes ago      Exited (0) 2 minutes ago                       naughty_kirch       95 B<\/pre>\n<p>-a \u306f\u524d\u8ff0\u306e\u3068\u304a\u308a\u7d42\u4e86\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3082\u8868\u793a\u3055\u305b\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002-s \u3092\u4ed8\u3051\u308b\u3068\u30b3\u30f3\u30c6\u30ca\u306e\u30b5\u30a4\u30ba\u3082\u51fa\u529b\u3055\u308c\u307e\u3059\u3002\u4e00\u756a\u53f3\u306e\u300cSIZE\u300d\u3068\u3044\u3046\u9805\u76ee\u304c\u300c95 B\u300d\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u300c\u305f\u3063\u305f\u306e 95 \u30d0\u30a4\u30c8\uff1f\u300d\u3068\u601d\u308f\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u300chello.txt\u300d\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u305f\u3060\u3051\u3060\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u3092\u884c\u3046\u3068\u3001\u3059\u3050\u306b\u6570\u5341MB\u3001\u6570\u767eMB\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u4e0d\u8981\u306a\u30b3\u30f3\u30c6\u30ca\u306f\u30c7\u30a3\u30b9\u30af\u306e\u7a7a\u304d\u5bb9\u91cf\u3068\u76f8\u8ac7\u3057\u306a\u304c\u3089\u524a\u9664\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u524a\u9664\u3059\u308b\u306b\u306f docker rm \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker rm 2067f43896a2<\/pre>\n<p>\u5f15\u6570\u306b\u306f\u30b3\u30f3\u30c6\u30ca\u306e ID \u3084\u540d\u524d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30a4\u30e1\u30fc\u30b8\u3092\u524a\u9664\u3059\u308b<\/h3>\n<p>\u30a4\u30e1\u30fc\u30b8\u3082\u307e\u305a\u307e\u305a\u306e\u30c7\u30a3\u30b9\u30af\u3092\u6d88\u8cbb\u3059\u308b\u306e\u3067\u3001\u4e0d\u8981\u3068\u306a\u3063\u305f\u30a4\u30e1\u30fc\u30b8\u306f\u524a\u9664\u3057\u305f\u65b9\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30a4\u30e1\u30fc\u30b8\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f docker images \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ docker images\r\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\r\nubuntu              latest              ba5877dc9bec        13 days ago         192.7 MB<\/pre>\n<p>-a \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u308b\u3068\u300c\u4e2d\u9593\u30a4\u30e1\u30fc\u30b8\u300d\u3082\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ docker images -a\r\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\r\nubuntu              latest              ba5877dc9bec        13 days ago         192.7 MB\r\n&lt;none&gt;              &lt;none&gt;              2318d26665ef        13 days ago         192.7 MB\r\n&lt;none&gt;              &lt;none&gt;              ebc34468f71d        13 days ago         192.7 MB\r\n&lt;none&gt;              &lt;none&gt;              25f11f5fb0cb        13 days ago         192.7 MB\r\n&lt;none&gt;              &lt;none&gt;              9bad880da3d2        13 days ago         192.5 MB\r\n&lt;none&gt;              &lt;none&gt;              511136ea3c5a        13 months ago       0 B<\/pre>\n<p>Docker \u306e\u30a4\u30e1\u30fc\u30b8\u306f\u3001\u30d9\u30fc\u30b9\u3068\u3059\u308b\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u306e\u5dee\u5206\u304c\u7a4d\u307f\u4e0a\u3052\u3089\u308c\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>-t \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u30a4\u30e1\u30fc\u30b8\u304c\u3069\u306e\u3088\u3046\u306b\u7a4d\u307f\u4e0a\u3052\u3089\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff08\u203b\u51fa\u529b\u3092\u898b\u308b\u3068 -t \u306f\u975e\u63a8\u5968\u3067\u3042\u308a\u3001\u5c06\u6765\u524a\u9664\u3055\u308c\u308b\u3088\u3046\u3067\u3059\uff09\u3002<\/p>\n<pre class=\"lang:sh decode:true\">$ docker images -t\r\nWarning: '-t' is deprecated, it will be removed soon. See usage.\r\n\u2514\u2500511136ea3c5a Virtual Size: 0 B\r\n  \u2514\u25009bad880da3d2 Virtual Size: 192.5 MB\r\n    \u2514\u250025f11f5fb0cb Virtual Size: 192.7 MB\r\n      \u2514\u2500ebc34468f71d Virtual Size: 192.7 MB\r\n        \u2514\u25002318d26665ef Virtual Size: 192.7 MB\r\n          \u2514\u2500ba5877dc9bec Virtual Size: 192.7 MB Tags: ubuntu:latest<\/pre>\n<p>\u30a4\u30e1\u30fc\u30b8\u3092\u524a\u9664\u3059\u308b\u306b\u306f docker rmi \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">docker rmi ba5877dc9bec<\/pre>\n<p>\u5f15\u6570\u306b\u306f\u30a4\u30e1\u30fc\u30b8\u306e ID \u3084\u540d\u524d\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u306f Docker \u3092\u4f7f\u3044\u59cb\u3081\u305f\u3068\u304d\u306b\u300c\u6700\u521d\u306b\u77e5\u3063\u3066\u304a\u304d\u305f\u304b\u3063\u305f\u3053\u3068\u300d\u3092\u4e2d\u5fc3\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>Dockerfile \u3084\u30b3\u30f3\u30c6\u30ca\u9593\u306e\u901a\u4fe1\u65b9\u6cd5\u306a\u3069\u3001Docker \u3092\u904b\u7528\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u77e5\u8b58\u306f\u307e\u3060\u307e\u3060\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u3089\u306b\u3064\u3044\u3066\u306f\u4eca\u5f8c\u53d6\u308a\u4e0a\u3052\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>\u300cAWS\u3067Docker\u3092\u4f7f\u3063\u3066\u307f\u3088\u3046\uff01\u300d\u3067\u306f Docker \u3092\u53d6\u308a\u3042\u3048\u305a\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u300cDocker \u3068\u306f\uff1f\u300d\u3068\u3044\u3046\u3068\u3053\u308d\u304b\u3089\u3001Docker \u306e\u57fa\u672c\u7684\u306a\u64cd\u4f5c\u3092\u884c\u3046\u3068\u3053\u308d\u307e\u3067\u898b\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2014\/08\/05\/introduction-to-docker\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[137],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4262"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=4262"}],"version-history":[{"count":30,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4262\/revisions"}],"predecessor-version":[{"id":4294,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/4262\/revisions\/4294"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=4262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=4262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=4262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}