{"id":9115,"date":"2018-12-16T16:21:16","date_gmt":"2018-12-16T07:21:16","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=9115"},"modified":"2019-01-13T16:38:16","modified_gmt":"2019-01-13T07:38:16","slug":"2018%e5%b9%b4-docker-%e4%bd%bf%e3%81%84%e6%96%b9-%e3%81%be%e3%81%a8%e3%82%81-%e3%81%9d%e3%81%ae2","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=9115","title":{"rendered":"2018\u5e74 Docker \u4f7f\u3044\u65b9 \u307e\u3068\u3081 \u305d\u306e2"},"content":{"rendered":"<div>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8676\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/08\/20170131164247-300x268.png\" alt=\"\" width=\"300\" height=\"268\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/08\/20170131164247-300x268.png 300w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/08\/20170131164247-768x686.png 768w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2018\/08\/20170131164247.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/div>\n<p>\u3069\u3082\u3067\u3059\u3002<\/p>\n<p>\u524d\u56de\u306e\u300c<a href=\"https:\/\/www.webcyou.com\/?p=8670\">2018\u5e74 Docker \u4f7f\u3044\u65b9 \u307e\u3068\u3081 \u305d\u306e1<\/a>\u300d\u306e\u7d9a\u304d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>Docker\u516c\u5f0f\u30b5\u30a4\u30c8<\/strong><\/p>\n<p><a href=\"http:\/\/www.docker.com\" target=\"_blank\" rel=\"noopener\">www.docker.com<\/a><\/p>\n<h4>Docker \u30a4\u30e1\u30fc\u30b8<\/h4>\n<p>\u305d\u308c\u3067\u306f\u3001\u4eca\u56de\u306f\u300c<strong>Docker \u30a4\u30e1\u30fc\u30b8<\/strong>\u300d\u306b\u3064\u3044\u3066\u304b\u3089\u3002<\/p>\n<p>\u305d\u3082\u305d\u3082\u3001Docker \u30a4\u30e1\u30fc\u30b8\u3068\u306f\u306a\u3093\u305e\u3084\uff1f<\/p>\n<p>\u3063\u3066\u3068\u3053\u308d\u3067\u3059\u304c\u3001Docker \u30a4\u30e1\u30fc\u30b8\u306f OS\u3084\u5b9f\u884c\u74b0\u5883\u306a\u3069\u3001\u30b3\u30f3\u30c6\u30ca\u5b9f\u884c\u306b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u307e\u3068\u3081\u3089\u308c\u305f\u3001\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Docker\u30b3\u30f3\u30c6\u30ca\u306fDocker\u30a4\u30e1\u30fc\u30b8\u3092\u5143\u306b\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001nginx\u306f<a href=\"https:\/\/hub.docker.com\/_\/nginx\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u306eDockerHub\u30ec\u30dd\u30b8\u30c8\u30ea\u306b\u3042\u308a\u3001PHP\u306f<a href=\"https:\/\/hub.docker.com\/_\/php\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u3001Wordpress\u306f<a href=\"https:\/\/hub.docker.com\/_\/wordpress\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u3068\u3001\u6ca2\u5c71\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306f<strong>AUFS\u306a\u3069\u306e\u7279\u6b8a\u306a\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u8aad\u307f\u8fbc\u307f\u5c02\u7528<\/strong>\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u81ea\u5206\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9154\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image.png\" alt=\"\" width=\"345\" height=\"345\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image.png 535w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image-150x150.png 150w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image-300x300.png 300w\" sizes=\"auto, (max-width: 345px) 100vw, 345px\" \/><\/p>\n<p>\u2193 \u2193 \u2193 \u2193 \u2193 \u2193 \u2193\u00a0\u2193 \u2193 \u2193 \u2193 \u2193 \u2193 \u2193<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9156\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image2.png\" alt=\"\" width=\"380\" height=\"380\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image2.png 535w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image2-150x150.png 150w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image2-300x300.png 300w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/p>\n<div><\/div>\n<p>Docker\u30a4\u30e1\u30fc\u30b8\u3092\u5143\u306b\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u65b0\u305f\u306b\u30b3\u30f3\u30c6\u30ca\u30ec\u30a4\u30e4\u30fc\u304c\u751f\u6210\u3055\u308c\u3001<\/p>\n<p>\u3053\u306e\u30ec\u30a4\u30e4\u30fc\u306f\u300c<strong>\u8aad\u307f\u66f8\u304d\u53ef\u80fd<\/strong>\u300d\u306a\u30ec\u30a4\u30e4\u30fc\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6ce8\u610f\u70b9\u306f\u3001\u904e\u53bb\u306e\u30ec\u30a4\u30e4\u30fc\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3057\u3066\u30b3\u30f3\u30c6\u30ca\u30ec\u30a4\u30e4\u30fc\u3067\u524a\u9664\u3057\u65b0\u898f\u3067\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u305f\u3068\u3057\u3066\u3082\u3001<\/p>\n<p>\u904e\u53bb\u306e\u30ec\u30a4\u30e4\u30fc\u306f\u5c65\u6b74\u304c\u6b8b\u3063\u305f\u307e\u307e\u306b\u306a\u308b\u306e\u3067\u3001\u524a\u9664\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u3042\u308b\u30ec\u30a4\u30e4\u30fc\u3067\u8ffd\u52a0\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u6b8b\u308a\u7d9a\u3051\u308b\u306e\u3067\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u969b\u306f\u3001\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h5>Docker \u30a4\u30e1\u30fc\u30b8\u7d99\u627f<\/h5>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9161\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image3.png\" alt=\"\" width=\"448\" height=\"105\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image3.png 636w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image3-300x70.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/div>\n<p>Ubuntu\u306e\u30d9\u30fc\u30b9\u30a4\u30e1\u30fc\u30b8\u306bRuby\u306e\u5b9f\u884c\u74b0\u5883\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u4f8b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u66f4\u306b Ruby on Rails\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u305f\u5834\u5408\u3002<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9164\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image4.png\" alt=\"\" width=\"446\" height=\"153\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image4.png 600w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/docker-image4-300x103.png 300w\" sizes=\"auto, (max-width: 446px) 100vw, 446px\" \/><\/div>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u30a4\u30e1\u30fc\u30b8\u3092\u7d99\u627f\u3057\u3066\u3044\u304f\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30ec\u30a4\u30e4\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304f\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u5168\u304f\u540c\u3058Docker\u30a4\u30e1\u30fc\u30b8\u3092\u7d99\u627f\u3059\u308b\u5834\u5408\u3001\u65b0\u3057\u304f\u751f\u6210\u3055\u308c\u308b\u306e\u3067\u306f\u306a\u304f\u3001<\/p>\n<p>\u5143 \u304b\u3089\u3042\u308b\u30a4\u30e1\u30fc\u30b8\u3092\u53c2\u7167\u3059\u308b\u5f62\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u5bb9\u91cf\u3082\u6291\u3048\u3089\u308c\u308b\u4f5c\u308a\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>Docker \u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30a4\u30e1\u30fc\u30b8\u300cwhalesay\u300d<\/h4>\n<p>Docker\u793e\u304c\u7528\u610f\u3057\u3066\u3044\u308b\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30a4\u30e1\u30fc\u30b8\u300cwhalesay\u300d\u3092\u5229\u7528\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u30af\u30b8\u30e9\u306e\u30a2\u30b9\u30ad\u30fc\u30a2\u30fc\u30c8\u306b\u597d\u304d\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u558b\u3089\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u306a\u30a4\u30e1\u30fc\u30b8\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker run docker\/whalesay cowsay HelloWorld!<\/pre>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-9172\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/13c82b16f05b6a8e5d749a8a9d8e68fc.png\" alt=\"\" width=\"276\" height=\"193\" \/><\/p>\n<p>docker\/whalesay\u306e\u5f8c\u306e\u3001\u300c<strong>cowsay HelloWorld!<\/strong> \u300d\u304c\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u547c\u3073\u51fa\u3055\u308c\u308b\u30b3\u30de\u30f3\u30c9\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>cowsay\u306e\u5f8c\u306b\u4efb\u610f\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>docker\/whalesay\u30a4\u30e1\u30fc\u30b8\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u3001Dockerhub\u3088\u308aPull\u3055\u308c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>Docker\u30a4\u30e1\u30fc\u30b8\u306e\u7ba1\u7406<\/h4>\n<p>Docker\u30a4\u30e1\u30fc\u30b8\u306e\u5404\u30b3\u30de\u30f3\u30c9\u4e00\u89a7\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u6e08\u307f\u306e\u30a4\u30e1\u30fc\u30b8\u4e00\u89a7\u3092\u8868\u793a<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker images<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">REPOSITORY TAG IMAGE ID CREATED SIZE\r\nhello-world latest 4ab4c602aa5e 4 months ago 1.84kB\r\nmysql 5.7.22 6bb891430fb6 5 months ago 372MB\r\nnginx 1.13.5-alpine ea7bef82810a 14 months ago 15.5MB\r\nmysql 5.7.19 3e3878acd190 15 months ago 412MB\r\nphp 7.1.9-fpm-alpine 5ec2c0136450 15 months ago 68.3MB<\/pre>\n<p><strong>\u30a4\u30e1\u30fc\u30b8\u306b\u30bf\u30b0\u4ed8\u3051\u3059\u308b\u30b3\u30de\u30f3\u30c9<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker tag\u00a0 docker\/whalesay my_whalesay<\/pre>\n<p>\u30bf\u30b0\u4ed8\u3051\u30b5\u30d6\u30b3\u30de\u30f3\u30c9: \u30a4\u30e1\u30fc\u30b8\u540d\uff1a\u65b0\u3057\u3044\u30a4\u30e1\u30fc\u30b8\u540d<\/p>\n<p>\u4efb\u610f\u306e\u30a4\u30e1\u30fc\u30b8\u540d\uff08\u30a8\u30a4\u30ea\u30a2\u30b9\u540d\uff09\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker tag\u00a0 docker\/whalesay my_whalesay:1.0.0<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">docker\/whalesay latest 6b362a9f73eb 3 years ago 247MB\r\nmy_whalesay 1.0.0 6b362a9f73eb 3 years ago 247MB\r\nmy_whalesay latest 6b362a9f73eb 3 years ago 247MB<\/pre>\n<p><strong>\u8a73\u7d30\u60c5\u5831\u78ba\u8a8d<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker inspect\u00a0my_whalesay<\/pre>\n<p><strong>\u30ed\u30fc\u30ab\u30eb\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u524a\u9664\u3059\u308b\u30b3\u30de\u30f3\u30c9<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker rmi docker\/whalesay<\/pre>\n<p><strong>\u5f37\u5236\u7684\u306b\u524a\u9664\u5b9f\u884c<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker rmi -f docker\/whalesay<\/pre>\n<p><strong>\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker pull\u00a0docker\/whalesay<\/pre>\n<p><strong>\u30a4\u30e1\u30fc\u30b8\u30d3\u30eb\u30c9<\/strong><\/p>\n<p>Dockefile\u304b\u3089\u751f\u6210\uff08\u30d3\u30eb\u30c9\uff09\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u4efb\u610f\u306e\u30a8\u30c7\u30a3\u30bf\u3067\u300cDockefile\u300d\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ vim Dockerfile<\/pre>\n<p>FROM\uff1a \u5143\u306b\u306a\u308b\u30a4\u30e1\u30fc\u30b8\u306e\u6307\u5b9a<br \/>\nRUN\uff1a\u30a4\u30e1\u30fc\u30b8\u30d3\u30eb\u30c9\u306e\u969b\u306b\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9<br \/>\nCMD \uff1a\u30b3\u30f3\u30c6\u30ca\u751f\u6210\u5f8c\u306b\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9<\/p>\n<p><strong>Dockerfile<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">From docker\/whalesay:latest\r\n\r\nRUN apt-get -y update &&\u00a0apt-get install -y fortunes\r\n\r\nCMD \/usr\/games\/fortune | cowsay<\/pre>\n<p>\u4e0a\u8a18\u306f\u3001fortunes\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u30e9\u30f3\u30c0\u30e0\u540d\u8a00\u751f\u6210\u30d1\u30c3\u30b1\u30fc\u30b8\uff09\u3057\u3001<\/p>\n<p>docker\/whalesay\u30a4\u30e1\u30fc\u30b8\u3092\u5229\u7528\u3057\u3066\u3001\u30af\u30b8\u30e9\u306b\u558b\u3089\u305b\u308bDockerfile\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h5>\u30d3\u30eb\u30c9\u30b3\u30de\u30f3\u30c9<\/h5>\n<p>\u4e0a\u8a18\u306eDockerfile\u306e\u8a18\u8ff0\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u65e9\u901f\u30a4\u30e1\u30fc\u30b8\u751f\u6210\u306ebuild\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker build -t docker-whale .<\/pre>\n<p>\u30a4\u30e1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3059\u308b\u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u3001 \u300c-t\u300d\u306f\u30bf\u30b0\u540d\u306e\u6307\u5b9a\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u300cdocker-whale\u300d\u306f\u30d3\u30eb\u30c9\u5f8c\u306e\u30a4\u30e1\u30fc\u30b8\u540d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306e\u300c.\u300d\u306f\u3001\u30d3\u30eb\u30c9\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306e\u6307\u5b9a\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d3\u30eb\u30c9\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306e\u6307\u5b9a\u304c\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u306a\u306e\u3067\u3001\u30ab\u30ec\u30f3\u30c8\u306eDockerfile\u3092\u53c2\u7167\u3059\u308b\u5f62\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d3\u30eb\u30c9\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u5ea6docker\u30c7\u30fc\u30e2\u30f3\u306b\u9001\u4fe1\u3055\u308c\u308b\u306e\u3067\u3001<\/p>\n<p>\u4e0d\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u304c\u591a\u3005\u3042\u3063\u305f\u308a\u3001\u91cd\u3044\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u3068\u5b9f\u884c\uff08\u9001\u4fe1\uff09\u304c\u9045\u304f\u306a\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u30a4\u30e1\u30fc\u30b8\u30d3\u30eb\u30c9\u306e\u5b9f\u884c<\/h4>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker build -t docker-whale .<\/pre>\n<p>\u4e0a\u8a18\u306e\u30d3\u30eb\u30c9\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30d3\u30eb\u30c9\u304c\u958b\u59cb\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Sending build context to Docker daemon 2.048kB\r\nStep 1\/3 : From docker\/whalesay:latest\r\n...<\/pre>\n<p>Docker\u30c7\u30fc\u30e2\u30f3\u306b\u9001\u4fe1\u3055\u308c\u308b\u5bb9\u91cf\u3084\u3001step\u6570\u306a\u3069\u304c\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u8868\u793a\u3055\u308c\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Docker\u30d3\u30eb\u30c9\u304c\u7121\u4e8b\u7d42\u4e86\u3059\u308b\u3068\u3001\u30a4\u30e1\u30fc\u30b8\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u306e\u3067 \u300cdocker images\u300d\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker images<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker-whale latest 1f66ccaba0ef 8 minutes ago 278MB<\/pre>\n<p>\u7121\u4e8b\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u3001\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker run docker-whale<\/pre>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9186\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/a324df80fc4624c5d693d6a889347ace.png\" alt=\"\" width=\"306\" height=\"284\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/a324df80fc4624c5d693d6a889347ace.png 306w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/01\/a324df80fc4624c5d693d6a889347ace-300x278.png 300w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/div>\n<p>\u304f\u3058\u3089\u3055\u3093\u304c\u540d\u8a00\u3092\u558b\u3063\u3066\u304f\u308c\u305f\u3089\u6210\u529f\u3067\u3059\u3002<\/p>\n<p><strong>\u30d3\u30eb\u30c9\u30ad\u30e3\u30c3\u30b7\u30e5<\/strong><\/p>\n<p>DockerFile\u3067\u3001apt-get\u306a\u3069\u6307\u5b9a\u3057\u3066\u3044\u308b\u3068\u3001\u30d3\u30eb\u30c9\u3055\u308c\u306a\u3044\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u6700\u65b0\u3092\u53d6\u5f97\u3067\u304d\u306a\u3044\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u3001\u518d\u5ea6Docker\u30d3\u30eb\u30c9\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Step 2\/3 : RUN apt-get -y update &amp;&amp; apt-get install -y fortunes\r\n---&gt; Using cache\r\n---&gt; c9aff62f2bf4\r\nStep 3\/3 : CMD \/usr\/games\/fortune | cowsay\r\n---&gt; Using cache\r\n---&gt; da232ab708a4<\/pre>\n<p>\u300c<strong>Using cache<\/strong>\u300d\u3068\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5229\u7528\u305b\u305a\u3001docker build\u3092\u884c\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u300c<strong>\u2014no-cache<\/strong>\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u518d\u5ea6 docker pull \u3092\u884c\u3044\u3001DockerFile\u5185\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u5f62\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>\u30ce\u30f3\u30ad\u30e3\u30c3\u30b7\u30e5<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ docker build \u2014no-cache -t\u00a0docker-whale .<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3068\u3001\u8a00\u3063\u305f \u611f\u3058\u3067\u30af\u30b8\u30e9\u306b\u540d\u8a00\u3092\u558b\u3089\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u7d9a\u304d\u306f\u6b21\u56de\u306b\u3067\u3082\u3002<\/p>\n<p>\u307e\u305f\u307e\u305f\u3041\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u3069\u3082\u3067\u3059\u3002 \u524d\u56de\u306e\u300c2018\u5e74 Docker \u4f7f\u3044\u65b9 \u307e\u3068\u3081 \u305d\u306e1\u300d\u306e\u7d9a\u304d\u306b\u306a\u308a\u307e\u3059\u3002 Docker\u516c\u5f0f\u30b5\u30a4\u30c8 www.docker.com Docker \u30a4\u30e1\u30fc\u30b8 \u305d\u308c\u3067\u306f\u3001\u4eca\u56de\u306f\u300cDocker \u30a4\u30e1\u30fc\u30b8\u300d\u306b\u3064\u3044 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[229],"tags":[73,172,171,59,177,181,176,37,47,46,169,107,180,173,150,44,45,111,95],"class_list":{"0":"post-9115","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-docker","7":"tag-actiinscript2-0","8":"tag-actionscript","9":"tag-android","10":"tag-android-sdk","11":"tag-css3","12":"tag-facebook","13":"tag-html5","14":"tag-iphone-","15":"tag-javascript-2","16":"tag-js","17":"tag-mac","18":"tag-mamp","19":"tag-mysql","20":"tag-php","21":"tag-vagrant","22":"tag-web","24":"tag-wordpress-2","25":"tag-95"},"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9115"}],"version-history":[{"count":30,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9115\/revisions"}],"predecessor-version":[{"id":9188,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9115\/revisions\/9188"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}