{"id":10636,"date":"2015-08-04T11:30:33","date_gmt":"2015-08-04T02:30:33","guid":{"rendered":"http:\/\/www.creationline.com\/?p=10636"},"modified":"2023-08-29T14:19:08","modified_gmt":"2023-08-29T05:19:08","slug":"vagrant-chef-zero-provisioner-%e3%81%a7%e7%92%b0%e5%a2%83%e3%82%92%e4%bd%9c%e3%82%8a%e3%80%81docker-%e5%85%a5%e9%96%80%e3%83%8f%e3%83%b3%e3%82%ba%e3%82%aa%e3%83%b3%e3%82%92%e5%ae%9f%e6%96%bd","status":"publish","type":"post","link":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636","title":{"rendered":"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker"},"content":{"rendered":"<p>\u300c<a href=\"http:\/\/qiita.com\/zembutsu\/items\/891c7ffd2c36097400b1\">Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599<\/a>\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f <a href=\"http:\/\/aws.amazon.com\/jp\/ecs\/\">Amazon EC2 Container Service<\/a> (ECS) \u3067\u306f\u306a\u304f\u3001Vagrant + VirtualBox \u3067\u74b0\u5883\u3092\u4f5c\u6210\u3057\u3001\u8cc7\u6599\u306b\u5f93\u3063\u3066\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3057\u305f\u7d50\u679c\u3067\u3059\u3002\u307e\u305f\u3001\u72ec\u81ea\u306b\u8cc7\u6599\u306e\u88dc\u8db3\u3082\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>Debian GNU\/Linux 8.1<\/li>\n<li>VirtualBox 4.3.28<\/li>\n<li>Vagrant 1.7.2<\/li>\n<\/ul>\n<p>\u3067\u74b0\u5883\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u305d\u306e\u969b\u306e Vagrantfile \u3084 Cookbook \u306f <a href=\"https:\/\/github.com\/cl-lab-k\/docker-test-vagrant\">https:\/\/github.com\/cl-lab-k\/docker-test-vagrant<\/a> \u306b\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092 <strong>git clone<\/strong> \u3057\u3001<strong>rake<\/strong> \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u81ea\u52d5\u7684\u306b Vagrant \u3067 VirtualBox \u4eee\u60f3\u30de\u30b7\u30f3\u3092\u4f5c\u6210\u3057\u3001docker \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% rake<br \/>\nberks vendor cookbooks<br \/>\nResolving cookbook dependencies...<br \/>\nFetching 'docker-test-vagrant' from source at .<br \/>\nFetching cookbook index from https:\/\/supermarket.chef.io...<br \/>\nUsing build-essential (2.2.3)<br \/>\nUsing dmg (2.2.2)<br \/>\nUsing docker (0.40.3)<br \/>\nUsing docker-test-vagrant (0.1.0) from source at .<br \/>\nUsing git (4.2.2)<br \/>\nUsing windows (1.37.0)<br \/>\nUsing chef_handler (1.2.0)<br \/>\nUsing yum (3.6.3)<br \/>\nUsing yum-epel (0.6.2)<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\nvagrant up<br \/>\n==&gt; default: Importing base box 'chef\/ubuntu-14.04'...<br \/>\n==&gt; default: Matching MAC address for NAT networking...<br \/>\n==&gt; default: Checking if box 'chef\/ubuntu-14.04' is up to date...<br \/>\n==&gt; default: Setting the name of the VM: docker-test-vagrant_default_1436938954313_78895<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\n==&gt; default: Installing Ohai plugin<br \/>\n==&gt; default: Running provisioner: chef_zero...<br \/>\ndefault: Installing Chef (latest)...<br \/>\nGenerating chef JSON and uploading...<br \/>\n==&gt; default: Running chef-zero...<br \/>\n==&gt; default: stdin: is not a tty<br \/>\n==&gt; default: [2015-07-15T05:43:49+00:00] INFO: Started chef-zero at chefzero:\/\/localhost:8889 with repository at \/tmp\/vagrant-chef\/d5bd62bdfc377f8351aa10d1e78ba278<br \/>\n==&gt; default:   One version per cookbook<br \/>\n==&gt; default: [2015-07-15T05:43:49+00:00] INFO: Forking chef instance to converge...<br \/>\n==&gt; default: [2015-07-15T05:43:49+00:00] INFO: *** Chef 12.4.1 ***<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\n==&gt; default: [2015-07-15T05:44:07+00:00] INFO: Chef Run complete in 16.835821862 seconds<br \/>\n==&gt; default: [2015-07-15T05:44:07+00:00] INFO: Skipping removal of unused files from the cache<br \/>\n==&gt; default: [2015-07-15T05:44:07+00:00] INFO: Running report handlers<br \/>\n==&gt; default: [2015-07-15T05:44:07+00:00] INFO: Report handlers complete<br \/>\n%<br \/>\n<\/code><\/p>\n<p><strong>vagrant ssh<\/strong> \u30b3\u30de\u30f3\u30c9\u3067 VM \u306b\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\n% vagrant ssh<br \/>\nWelcome to Ubuntu 14.04.1 LTS (GNU\/Linux 3.13.0-24-generic x86_64)<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\"> * Documentation:  https:\/\/help.ubuntu.com\/<br \/>\nLast login: Tue Oct 21 14:52:42 2014 from 10.0.2.2<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b docker \u306f 1.6.2 \u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker version<br \/>\nClient version: 1.6.2<br \/>\nClient API version: 1.18<br \/>\nGo version (client): go1.4.2<br \/>\nGit commit (client): 7c8fca2<br \/>\nOS\/Arch (client): linux\/amd64<br \/>\nServer version: 1.6.2<br \/>\nServer API version: 1.18<br \/>\nGo version (server): go1.4.2<br \/>\nGit commit (server): 7c8fca2<br \/>\nOS\/Arch (server): linux\/amd64<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u3053\u3053\u304b\u3089\u8cc7\u6599\u306b\u5f93\u3063\u3066\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u884c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>A-1. \u30b3\u30f3\u30c6\u30ca\u30fb\u30a4\u30e1\u30fc\u30b8\u306e\u78ba\u8a8d\u3068\u53d6\u5f97<\/h2>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/commandline\/images\/\">docker images<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u3001\u30ed\u30fc\u30ab\u30eb\u306b\u3042\u308b Docker \u30a4\u30e1\u30fc\u30b8\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u307e\u3063\u305f\u304f\u65b0\u898f\u306e VM \u5185\u3067\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u884c\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u30ed\u30fc\u30ab\u30eb\u306b Docker \u30a4\u30e1\u30fc\u30b8\u304c\u306a\u3044\u306e\u3067\u3001\u4f55\u3082\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker images<br \/>\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/commandline\/pull\/\">docker pull<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u3001\u516c\u958b\u30ec\u30dd\u30b8\u30c8\u30ea(<a href=\"https:\/\/registry.hub.docker.com\/\">Docker Hub Registry<\/a>)\u304b\u3089 <a href=\"https:\/\/registry.hub.docker.com\/_\/centos\/\">CentOS \u306e\u30a4\u30e1\u30fc\u30b8<\/a>\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker pull centos<br \/>\nlatest: Pulling from centos<br \/>\nf1b10cd84249: Pull complete<br \/>\nc852f6d61e65: Pull complete<br \/>\n7322fbe74aa5: Already exists<br \/>\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.<br \/>\nDigest: sha256:57554136c655abb33ecb7bb790b1db0279668d3763c3b81f31bc6c4e60e4a1f3<br \/>\nStatus: Downloaded newer image for centos:latest<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30ed\u30fc\u30ab\u30eb\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30a4\u30e1\u30fc\u30b8\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b\u969b\u306f\u300c<strong>\u30a4\u30e1\u30fc\u30b8\u540d<\/strong>\/<strong>\u30bf\u30b0<\/strong>\u300d\u3068\u3044\u3046\u5f62\u3067\u6307\u5b9a\u3057\u3001\u30bf\u30b0\u3092\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u300c<strong>latest<\/strong>\u300d(\u6700\u65b0)\u3092\u6307\u5b9a\u3057\u305f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f CentOS \u306e\u6700\u65b0\u3001\u3059\u306a\u308f\u3061 CentOS 7 \u306e\u30a4\u30e1\u30fc\u30b8\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE<br \/>\ncentos              latest              7322fbe74aa5        3 weeks ago         172.2 MB<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30bf\u30b0\u3067\u300c<strong>6<\/strong>\u300d\u3092\u6307\u5b9a\u3057\u3066\u3001CentOS 6 \u306e\u30a4\u30e1\u30fc\u30b8\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker pull centos:6<br \/>\n6: Pulling from centos<br \/>\nfb9cc58bde0c: Pull complete<br \/>\na005304e4e74: Already exists<br \/>\na005304e4e74: Pulling fs layer<br \/>\ncentos:6: 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.<br \/>\nDigest: sha256:c20d775e1d35de76d59cec13335f3bd07b0b6e73c6b1901f14f1f008d4776aeb<br \/>\nStatus: Downloaded newer image for centos:6<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30ed\u30fc\u30ab\u30eb\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u540d\u524d\u306f\u300c<strong>centos<\/strong>\u300d\u3068\u540c\u3058\u3067\u3001\u30bf\u30b0\u304c\u7570\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker images<br \/>\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE<br \/>\ncentos              6                   a005304e4e74        3 weeks ago         203.1 MB<br \/>\ncentos              latest              7322fbe74aa5        3 weeks ago         172.2 MB<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/commandline\/history\/\">docker history<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30e1\u30fc\u30b8 ID \u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u305d\u306e\u30a4\u30e1\u30fc\u30b8\u304c\u3069\u306e\u3088\u3046\u306b\u30d3\u30eb\u30c9\u3055\u308c\u305f\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u300c<a href=\"http:\/\/docs.docker.com\/reference\/builder\/#maintainer\">MAINTAINER<\/a> The CentOS Proje\u300d\u304b\u3089\u3001\u9014\u4e2d\u3067\u5207\u308c\u3066\u3044\u308b\u3082\u306e\u306e <a href=\"https:\/\/www.centos.org\/\">CentOS Project<\/a> \u304c\u4f5c\u6210\u3057\u305f\u30a4\u30e1\u30fc\u30b8\u306b\u3001\u5909\u66f4\u3092\u52a0\u3048\u3066\u3067\u304d\u305f\u30a4\u30e1\u30fc\u30b8\u3060\u3068\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker history a005304e4e74<br \/>\nIMAGE               CREATED             CREATED BY                                      SIZE<br \/>\na005304e4e74        3 weeks ago         \/bin\/sh -c #(nop) CMD [\"\/bin\/bash\"]             0 B<br \/>\nfb9cc58bde0c        3 weeks ago         \/bin\/sh -c #(nop) ADD file:36d5dedfe60e45e7be   203.1 MB<br \/>\nf1b10cd84249        11 weeks ago        \/bin\/sh -c #(nop) MAINTAINER The CentOS Proje   0 B<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<h2>A-2. \u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5\u3068\u505c\u6b62<\/h2>\n<p><a href=\"http:\/\/linuxjm.osdn.jp\/html\/GNU_sh-utils\/man1\/echo.1.html\">echo<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u300cHello World\u300d\u3068\u6a19\u6e96\u51fa\u529b\u306b\u8868\u793a\u3059\u308b\u3060\u3051\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u300c<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/run\/\">docker run<\/a> <strong>\u30a4\u30e1\u30fc\u30b8\u540d:\u30bf\u30b0<\/strong> <strong>\u30b3\u30de\u30f3\u30c9<\/strong> <strong>\u5f15\u6570<\/strong>\u300d\u3068\u3044\u3046\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker run centos echo \"Hello World\"<br \/>\nHello World<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u300c<strong>echo \"Hello World\"<\/strong>\u300d\u3068\u5b9f\u884c\u3057\u305f\u3082\u306e\u3068\u898b\u5206\u3051\u304c\u3064\u304b\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3053\u308c\u306f <strong>centos<\/strong>:latest \u30a4\u30e1\u30fc\u30b8\u304b\u3089\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u6210\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u300c<strong>echo \"Hello World\"<\/strong>\u300d\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3067\u3059\u3002\u30b3\u30de\u30f3\u30c9\u304c\u7d42\u4e86\u3057\u305f\u3089\u3001\u540c\u6642\u306b\u30b3\u30f3\u30c6\u30ca\u3082\u7d42\u4e86\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306f\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u300c<strong>ps ax<\/strong>\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u52d5\u4f5c\u3057\u3066\u3044\u308b\u30d7\u30ed\u30bb\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker run centos ps ax<br \/>\nPID TTY      STAT   TIME COMMAND<br \/>\n1 ?        Rs     0:00 ps ax<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u306f PID <strong>1<\/strong> \u3067 ps ax \u30b3\u30de\u30f3\u30c9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u30db\u30b9\u30c8\u4e0a\u3067\u52d5\u4f5c\u3057\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u300c<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/ps\/\">docker ps<\/a>\u300d\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002\u4eca\u306f\u30b3\u30f3\u30c6\u30ca\u3092\u4e00\u3064\u3082\u5b9f\u884c\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u4f55\u3082\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker ps<br \/>\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u300c<strong>-a<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u7d42\u4e86\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3082\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker ps -a<br \/>\nCONTAINER ID        IMAGE               COMMAND                CREATED             STATUS                      PORTS               NAMES<br \/>\nd02d860e8ea9        centos:latest       \"ps ax\"                38 seconds ago      Exited (0) 38 seconds ago                       berserk_meitner<br \/>\n7bfe4305f8c3        centos:latest       \"echo 'Hello World'\"   54 seconds ago      Exited (0) 53 seconds ago                       distracted_swartz<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u3053\u308c\u307e\u3067\u306f\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u5373\u6642\u30b3\u30f3\u30c6\u30ca\u3054\u3068\u7d42\u4e86\u3055\u305b\u3066\u3044\u307e\u3057\u305f\u3002\u6b21\u306f\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u30b7\u30a7\u30eb (<a href=\"http:\/\/linuxjm.osdn.jp\/html\/GNU_bash\/man1\/bash.1.html\">bash<\/a>) \u3092\u5b9f\u884c\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u4efb\u610f\u306e\u64cd\u4f5c\u3092\u884c\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002\u300c<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/run\/\">docker run<\/a> <strong>-i<\/strong> <strong>-t<\/strong> <strong>\u30a4\u30e1\u30fc\u30b8\u540d:\u30bf\u30b0<\/strong> <strong>\u30b3\u30de\u30f3\u30c9<\/strong> <strong>\u5f15\u6570<\/strong>\u300d\u3068\u3057\u307e\u3059\u3002\u300c<strong>-i<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u6a19\u6e96\u5165\u529b\u3092\u53d7\u3051\u4ed8\u3051\u308b\u3001\u300c<strong>-t<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4eee\u60f3\u7aef\u672b\u3092\u5272\u308a\u5f53\u3066\u308b\u3001\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker run -i -t ubuntu bash<br \/>\nUnable to find image 'ubuntu:latest' locally<br \/>\nlatest: Pulling from ubuntu<br \/>\n83e4dde6b9cf: Pull complete<br \/>\nb670fb0c7ecd: Pull complete<br \/>\n29460ac93442: Pull complete<br \/>\nd2a0ecffe6fa: Already exists<br \/>\nubuntu: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.<br \/>\nDigest: sha256:cb90b1a107073ab3e17271e45a6177b23f548b44157d88d955b7e8bcdbcfd14a<br \/>\nStatus: Downloaded newer image for ubuntu:latest<br \/>\nroot@51d127ffa61b:\/#<br \/>\n<\/code><\/p>\n<p><a href=\"https:\/\/registry.hub.docker.com\/_\/ubuntu\/\">Ubuntu \u306e\u30a4\u30e1\u30fc\u30b8<\/a> \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3001bash \u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002\u6b21\u306e\u3088\u3046\u306b\u3001\u4efb\u610f\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nroot@51d127ffa61b:\/# cat \/etc\/issue<br \/>\nUbuntu 14.04.2 LTS \\n \\l<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">root@51d127ffa61b:\/#<br \/>\n<\/code><\/p>\n<p><strong>exit<\/strong> \u3068\u5165\u529b\u3059\u308b\u3068\u3001bash \u304c\u7d42\u4e86\u3059\u308b\u3068\u540c\u6642\u306b\u30b3\u30f3\u30c6\u30ca\u3082\u7d42\u4e86\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nroot@51d127ffa61b:\/# exit<br \/>\nexit<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker ps<br \/>\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u7d42\u4e86\u305b\u305a\u306b\u5143\u306e\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u623b\u308b\u306b\u306f\u3001<a href=\"https:\/\/docs.docker.com\/articles\/basics\/#running-an-interactive-shell\">Ctrl-p + Ctrl-q<\/a> \u3068\u5165\u529b\u3057\u307e\u3059\u3002\u3053\u306e\u64cd\u4f5c\u3092\u30c7\u30bf\u30c3\u30c1\u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nroot@51d127ffa61b:\/# vagrant@vagrant:~$<br \/>\nvagrant@vagrant:~$ docker ps<br \/>\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES<br \/>\n51d127ffa61b        ubuntu:latest       \"\/bin\/bash\"         3 minutes ago       Up 3 minutes                            trusting_elion<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u8cc7\u6599\u306b\u306f\u8a18\u8ff0\u304c\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30c7\u30bf\u30c3\u30c1\u304c\u3042\u308b\u306a\u3089\u30a2\u30bf\u30c3\u30c1\u3082\u3042\u308a\u307e\u3059\u3002\u300c<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/attach\/\">docker attach<\/a> <strong>\u30b3\u30f3\u30c6\u30caID<\/strong>\u300d\u3068\u5b9f\u884c\u3059\u308b\u3068\u3001\u30c7\u30bf\u30c3\u30c1\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u306b\u63a5\u7d9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker attach 51d127ffa61b<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">root@51d127ffa61b:\/#<br \/>\n<\/code><\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u30c7\u30fc\u30e2\u30f3\u3068\u3057\u3066\u52d5\u4f5c\u3055\u305b\u308b\u306b\u306f\u300c<a href=\"http:\/\/docs.docker.com\/reference\/run\/#detached-d\">-d<\/a>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u3066\u6700\u521d\u304b\u3089\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u304a\u304d\u307e\u3059\u3002120\u56de\u30d1\u30b1\u30c3\u30c8\u3092\u9001\u308b ping \u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker run -d ubuntu ping 127.0.0.1 -c 120<br \/>\n1c9647ddc5e1a0836a729ae60b06dd9276b80a67b63a057f9975a09dfa3e413b<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u3053\u308c\u307e\u3067\u306e\u3088\u3046\u306b\u30b3\u30de\u30f3\u30c9\u306e\u7d50\u679c\u3067\u306f\u306a\u304f\u3001\u5358\u306b\u30b3\u30f3\u30c6\u30ca ID \u306e\u307f\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u300c<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/ps\/\">docker ps<\/a>\u300d\u3067\u3082\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker ps<br \/>\nCONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS               NAMES<br \/>\n1c9647ddc5e1        ubuntu:latest       \"ping 127.0.0.1 -c 1   3 seconds ago       Up 2 seconds                            kickass_franklin<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u30b3\u30f3\u30c6\u30ca ID \u306f\u7e70\u308a\u8fd4\u3057\u5229\u7528\u3059\u308b\u306e\u3067\u3001\u74b0\u5883\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u4f7f\u3044\u56de\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ export CONTAINER=1c9647ddc5e1<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/commandline\/logs\/\">docker logs<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u6307\u5b9a\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u306e\u51fa\u529b\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker logs $CONTAINER<br \/>\nPING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.<br \/>\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.027 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.114 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.038 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.038 ms<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\n<\/code><\/p>\n<p>\u300c<strong>-f<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3068\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u30b3\u30f3\u30c6\u30ca\u306e\u51fa\u529b\u304c\u6d41\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker logs -f $CONTAINER<br \/>\nPING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.<br \/>\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.027 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.114 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.038 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.038 ms<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\n<\/code><\/p>\n<p>\u300c<strong>--tail N<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001\u672b\u5c3e\u304b\u3089 N \u884c\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker logs --tail 5 $CONTAINER<br \/>\n64 bytes from 127.0.0.1: icmp_seq=90 ttl=64 time=0.036 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=91 ttl=64 time=0.032 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=92 ttl=64 time=0.033 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=93 ttl=64 time=0.041 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=94 ttl=64 time=0.039 ms<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u300c<strong>--tail N -f<\/strong>\u300d\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u672b\u5c3e\u304b\u3089 N \u884c\u3092\u8868\u793a\u3057\u3066\u3001\u305d\u3053\u304b\u3089\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u30b3\u30f3\u30c6\u30ca\u306e\u51fa\u529b\u304c\u6d41\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker logs --tail 5 -f $CONTAINER<br \/>\n64 bytes from 127.0.0.1: icmp_seq=98 ttl=64 time=0.046 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=99 ttl=64 time=0.047 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=100 ttl=64 time=0.041 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=101 ttl=64 time=0.037 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=102 ttl=64 time=0.031 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=103 ttl=64 time=0.050 ms<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\n<\/code><\/p>\n<p>\u52d5\u4f5c\u3057\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u505c\u6b62\u3059\u308b\u306b\u306f\u3001<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/stop\/\">docker stop<\/a> \u30b3\u30de\u30f3\u30c9\u3067 SIGTERM \u30b7\u30b0\u30ca\u30eb\u3067\u505c\u6b62\u3059\u308b\u304b\u3001<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/kill\/\">docker kill<\/a> \u30b3\u30de\u30f3\u30c9\u3067 SIGKILL \u30b7\u30b0\u30ca\u30eb\u3067\u5f37\u5236\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker stop $CONTAINER<br \/>\n1c9647ddc5e1<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<h2>A-3. \u30b3\u30f3\u30c6\u30ca\u306e\u8a73\u7d30\u60c5\u5831\u3092\u78ba\u8a8d<\/h2>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/commandline\/inspect\/\">docker inspect<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u8a73\u7d30\u306a\u60c5\u5831\u3092 JSON \u5f62\u5f0f\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"javascript\"><br \/>\nvagrant@vagrant:~$ docker inspect $CONTAINER<br \/>\n[{<br \/>\n\"AppArmorProfile\": \"\",<br \/>\n\"Args\": [<br \/>\n\"127.0.0.1\",<br \/>\n\"-c\",<br \/>\n\"120\"<br \/>\n],<br \/>\n\"Config\": {<br \/>\n\"AttachStderr\": false,<br \/>\n\"AttachStdin\": false,<br \/>\n\"AttachStdout\": false,<br \/>\n\"Cmd\": [<br \/>\n\"ping\",<br \/>\n\"127.0.0.1\",<br \/>\n\"-c\",<br \/>\n\"120\"<br \/>\n],<br \/>\n\"CpuShares\": 0,<br \/>\n\"Cpuset\": \"\",<br \/>\n\"Domainname\": \"\",<br \/>\n\"Entrypoint\": null,<br \/>\n\"Env\": null,<br \/>\n\"ExposedPorts\": null,<br \/>\n\"Hostname\": \"1c9647ddc5e1\",<br \/>\n\"Image\": \"ubuntu\",<br \/>\n\"Labels\": {},<br \/>\n\"MacAddress\": \"\",<br \/>\n\"Memory\": 0,<br \/>\n\"MemorySwap\": 0,<br \/>\n\"NetworkDisabled\": false,<br \/>\n\"OnBuild\": null,<br \/>\n\"OpenStdin\": false,<br \/>\n\"PortSpecs\": null,<br \/>\n\"StdinOnce\": false,<br \/>\n\"Tty\": false,<br \/>\n\"User\": \"\",<br \/>\n\"Volumes\": null,<br \/>\n\"WorkingDir\": \"\"<br \/>\n},<br \/>\n\"Created\": \"2015-07-15T02:29:15.562242259Z\",<br \/>\n\"Driver\": \"aufs\",<br \/>\n\"ExecDriver\": \"native-0.2\",<br \/>\n\"ExecIDs\": null,<br \/>\n\"HostConfig\": {<br \/>\n\"Binds\": null,<br \/>\n\"CapAdd\": null,<br \/>\n\"CapDrop\": null,<br \/>\n\"CgroupParent\": \"\",<br \/>\n\"ContainerIDFile\": \"\",<br \/>\n\"CpuShares\": 0,<br \/>\n\"CpusetCpus\": \"\",<br \/>\n\"Devices\": [],<br \/>\n\"Dns\": null,<br \/>\n\"DnsSearch\": null,<br \/>\n\"ExtraHosts\": null,<br \/>\n\"IpcMode\": \"\",<br \/>\n\"Links\": null,<br \/>\n\"LogConfig\": {<br \/>\n\"Config\": null,<br \/>\n\"Type\": \"json-file\"<br \/>\n},<br \/>\n\"LxcConf\": [],<br \/>\n\"Memory\": 0,<br \/>\n\"MemorySwap\": 0,<br \/>\n\"NetworkMode\": \"bridge\",<br \/>\n\"PidMode\": \"\",<br \/>\n\"PortBindings\": {},<br \/>\n\"Privileged\": false,<br \/>\n\"PublishAllPorts\": false,<br \/>\n\"ReadonlyRootfs\": false,<br \/>\n\"RestartPolicy\": {<br \/>\n\"MaximumRetryCount\": 0,<br \/>\n\"Name\": \"no\"<br \/>\n},<br \/>\n\"SecurityOpt\": null,<br \/>\n\"Ulimits\": null,<br \/>\n\"VolumesFrom\": null<br \/>\n},<br \/>\n\"HostnamePath\": \"\/var\/lib\/docker\/containers\/1c9647ddc5e1a0836a729ae60b06dd9276b80a67b63a057f9975a09dfa3e413b\/hostname\",<br \/>\n\"HostsPath\": \"\/var\/lib\/docker\/containers\/1c9647ddc5e1a0836a729ae60b06dd9276b80a67b63a057f9975a09dfa3e413b\/hosts\",<br \/>\n\"Id\": \"1c9647ddc5e1a0836a729ae60b06dd9276b80a67b63a057f9975a09dfa3e413b\",<br \/>\n\"Image\": \"d2a0ecffe6fa4ef3de9646a75cc629bbd9da7eead7f767cb810f9808d6b3ecb6\",<br \/>\n\"LogPath\": \"\/var\/lib\/docker\/containers\/1c9647ddc5e1a0836a729ae60b06dd9276b80a67b63a057f9975a09dfa3e413b\/1c9647ddc5e1a0836a729ae60b06dd9276b80a67b63a057f9975a09dfa3e413b-json.log\",<br \/>\n\"MountLabel\": \"\",<br \/>\n\"Name\": \"\/kickass_franklin\",<br \/>\n\"NetworkSettings\": {<br \/>\n\"Bridge\": \"\",<br \/>\n\"Gateway\": \"\",<br \/>\n\"GlobalIPv6Address\": \"\",<br \/>\n\"GlobalIPv6PrefixLen\": 0,<br \/>\n\"IPAddress\": \"\",<br \/>\n\"IPPrefixLen\": 0,<br \/>\n\"IPv6Gateway\": \"\",<br \/>\n\"LinkLocalIPv6Address\": \"\",<br \/>\n\"LinkLocalIPv6PrefixLen\": 0,<br \/>\n\"MacAddress\": \"\",<br \/>\n\"PortMapping\": null,<br \/>\n\"Ports\": null<br \/>\n},<br \/>\n\"Path\": \"ping\",<br \/>\n\"ProcessLabel\": \"\",<br \/>\n\"ResolvConfPath\": \"\/var\/lib\/docker\/containers\/1c9647ddc5e1a0836a729ae60b06dd9276b80a67b63a057f9975a09dfa3e413b\/resolv.conf\",<br \/>\n\"RestartCount\": 0,<br \/>\n\"State\": {<br \/>\n\"Dead\": false,<br \/>\n\"Error\": \"\",<br \/>\n\"ExitCode\": 0,<br \/>\n\"FinishedAt\": \"2015-07-15T02:31:14.675859632Z\",<br \/>\n\"OOMKilled\": false,<br \/>\n\"Paused\": false,<br \/>\n\"Pid\": 0,<br \/>\n\"Restarting\": false,<br \/>\n\"Running\": false,<br \/>\n\"StartedAt\": \"2015-07-15T02:29:15.653140071Z\"<br \/>\n},<br \/>\n\"Volumes\": {},<br \/>\n\"VolumesRW\": {}<br \/>\n}<br \/>\n]<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u5fc5\u8981\u306a\u60c5\u5831\u306e\u307f\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f <strong>--format<\/strong> \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\u66f8\u5f0f\u306f Go \u8a00\u8a9e\u306e <a href=\"http:\/\/golang.org\/pkg\/text\/template\/\">Package template<\/a> \u306b\u5f93\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker inspect --format='{{.Config.Cmd}}' $CONTAINER<br \/>\n[ping 127.0.0.1 -c 120]<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u6b21\u306f JSON \u5f62\u5f0f\u3067\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u6307\u5b9a\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p><code lang=\"javascript\"><br \/>\nvagrant@vagrant:~$ docker inspect --format='{{json .Config.Cmd}}' $CONTAINER<br \/>\n[\"ping\",\"127.0.0.1\",\"-c\",\"120\"]<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<h2>A-5. \u4e0d\u8981\u306a\u30b3\u30f3\u30c6\u30ca\u306e\u524a\u9664<\/h2>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u505c\u6b62\u3057\u3066\u3082\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u30c7\u30fc\u30bf\u81ea\u4f53\u306f\u6b8b\u308a\u7d9a\u3051\u307e\u3059\u3002\u307e\u305a\u3001\u505c\u6b62\u3057\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u3092 <a href=\"http:\/\/docs.docker.com\/reference\/commandline\/ps\/\">docker ps<\/a> \u3067\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker ps -aq --filter='status=exited'<br \/>\n1c9647ddc5e1<br \/>\n51d127ffa61b<br \/>\nd02d860e8ea9<br \/>\n7bfe4305f8c3<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u505c\u6b62\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u524a\u9664\u3059\u308b\u306b\u306f <a href=\"http:\/\/docs.docker.com\/reference\/commandline\/rm\/\">docker rm<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002\u505c\u6b62\u3057\u3066\u3044\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u307e\u3068\u3081\u3066\u524a\u9664\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u30b7\u30a7\u30eb\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u5b9f\u884c\u3057\u307e\u3059\u3002\u3082\u3061\u308d\u3093\u3001\u30b3\u30f3\u30c6\u30ca ID \u3092 1\u3064 1\u3064\u6307\u5b9a\u3057\u3066\u3082\u304b\u307e\u3044\u307e\u305b\u3093\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker rm $(docker ps -aq --filter='status=exited')<br \/>\n1c9647ddc5e1<br \/>\n51d127ffa61b<br \/>\nd02d860e8ea9<br \/>\n7bfe4305f8c3<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u505c\u6b62\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u304c\u3059\u3079\u3066\u524a\u9664\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker ps -a<br \/>\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<h2>A-6. \u30a4\u30e1\u30fc\u30b8\u306e\u5185\u5bb9\u78ba\u5b9a(\u30b3\u30df\u30c3\u30c8)\u3084\u5909\u66f4\u5dee\u5206<\/h2>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3001\u5185\u5bb9\u306b\u5909\u66f4\u3092\u52a0\u3048\u305f\u5f8c\u306b\u505c\u6b62\u3057\u3001\u3082\u3046\u4e00\u5ea6\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001\u5909\u66f4\u3057\u305f\u5185\u5bb9\u306f\u53cd\u6620\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u308c\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001<strong>ubuntu<\/strong> \u30a4\u30e1\u30fc\u30b8\u304b\u3089\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3001<strong>\/hello.txt<\/strong> \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001<strong>exit<\/strong> \u3067\u30b3\u30f3\u30c6\u30ca\u3092\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker run -i -t ubuntu bash<br \/>\nroot@19a2efc75949:\/# echo \"hello world\" &gt; \/hello.txt<br \/>\nroot@19a2efc75949:\/# ls -la \/hello.txt<br \/>\n-rw-r--r-- 1 root root 12 Jul 15 03:06 \/hello.txt<br \/>\nroot@19a2efc75949:\/# exit<br \/>\nexit<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u518d\u5ea6 <strong>ubuntu<\/strong> \u30a4\u30e1\u30fc\u30b8\u304b\u3089\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3059\u308b\u3068\u3001<strong>\/hello.txt<\/strong> \u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker run -i -t ubuntu bash<br \/>\nroot@14f3c0bda510:\/# ls -la \/hello.txt<br \/>\nls: cannot access \/hello.txt: No such file or directory<br \/>\nroot@14f3c0bda510:\/#<br \/>\n<\/code><\/p>\n<p>\u3082\u3046\u4e00\u5ea6 <strong>\/hello.txt<\/strong> \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30b3\u30f3\u30c6\u30ca\u3092\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nroot@14f3c0bda510:\/# echo \"hello world\" &gt; \/hello.txt<br \/>\nroot@14f3c0bda510:\/# ls -la \/hello.txt<br \/>\n-rw-r--r-- 1 root root 12 Jul 15 03:07 \/hello.txt<br \/>\nroot@14f3c0bda510:\/# exit<br \/>\nexit<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u3082\u3063\u3068\u3082\u65b0\u3057\u304f\u4f5c\u6210\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3092 <a href=\"http:\/\/docs.docker.com\/reference\/commandline\/ps\/\">docker ps -l<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker ps -l<br \/>\nCONTAINER ID        IMAGE               COMMAND             CREATED              STATUS                      PORTS               NAMES<br \/>\n14f3c0bda510        ubuntu:latest       \"bash\"              About a minute ago   Exited (0) 24 seconds ago                       furious_wright<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/commandline\/diff\/\">docker diff<\/a> \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u30a4\u30e1\u30fc\u30b8\u306b\u52a0\u3048\u3089\u308c\u305f\u5909\u66f4\u70b9\u304c\u308f\u304b\u308a\u307e\u3059\u3002<strong>A<\/strong> \u306f\u8ffd\u52a0\u3001<strong>C<\/strong> \u306f\u5909\u66f4\u3001\u3053\u3053\u3067\u306f\u5bfe\u8c61\u304c\u3042\u308a\u307e\u305b\u3093\u304c <strong>D<\/strong> \u304c\u524a\u9664\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker diff 14f3c0bda510<br \/>\nA \/hello.txt<br \/>\nC \/root<br \/>\nA \/root\/.bash_history<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u30b3\u30f3\u30c6\u30ca ID \u306f\u7e70\u308a\u8fd4\u3057\u5229\u7528\u3059\u308b\u306e\u3067\u3001\u74b0\u5883\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u4f7f\u3044\u56de\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ export CONTAINER=14f3c0bda510<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u5909\u66f4\u70b9\u3092\u4fdd\u5b58\u3057\u3066\u65b0\u305f\u306a\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u308b(\u30b3\u30df\u30c3\u30c8\u3059\u308b)\u306b\u306f\u3001\u300c<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/commit\/\">docker commit<\/a> <strong>\u30b3\u30f3\u30c6\u30ca ID<\/strong> <strong>\u30ec\u30dd\u30b8\u30c8\u30ea\u540d:\u30bf\u30b0<\/strong>\u300d\u3068\u3057\u3066\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u30ec\u30dd\u30b8\u30c8\u30ea\u540d:\u30bf\u30b0\u306f\u4efb\u610f\u306e\u6587\u5b57\u5217\u304c\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker commit $CONTAINER vagdocker\/myapp:1.0<br \/>\nd674643f50918a5c977ebb046c4b135307fc811e236bf31f6782eb7ff4c77fbf<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u30b3\u30df\u30c3\u30c8\u3057\u305f\u30a4\u30e1\u30fc\u30b8\u306f <a href=\"http:\/\/docs.docker.com\/reference\/commandline\/images\/\">docker images<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker images<br \/>\nREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE<br \/>\nvagdocker\/myapp     1.0                 d674643f5091        12 seconds ago      188.4 MB<br \/>\nubuntu              latest              d2a0ecffe6fa        5 days ago          188.4 MB<br \/>\ncentos              6                   a005304e4e74        3 weeks ago         203.1 MB<br \/>\ncentos              latest              7322fbe74aa5        3 weeks ago         172.2 MB<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u4f5c\u6210\u3057\u305f\u30a4\u30e1\u30fc\u30b8\u306e ID \u306f\u7e70\u308a\u8fd4\u3057\u5229\u7528\u3059\u308b\u306e\u3067\u3001\u74b0\u5883\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u4f7f\u3044\u56de\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ export IMAGEID=d674643f5091<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u30a4\u30e1\u30fc\u30b8\u304b\u3089\u4f5c\u6210\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u306a\u3089\u3070\u3001\u5148\u7a0b\u4f5c\u6210\u3057\u305f <strong>\/hello.txt<\/strong> \u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u6301\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker run vagdocker\/myapp:1.0 cat \/hello.txt<br \/>\nhello world<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/commandline\/history\/\">docker history<\/a> \u30b3\u30de\u30f3\u30c9\u3067\u3001\u3053\u306e\u30a4\u30e1\u30fc\u30b8\u306e\u5909\u66f4\u5c65\u6b74\u3092\u305f\u3069\u3063\u3066\u3044\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ docker history $IMAGEID<br \/>\nIMAGE               CREATED              CREATED BY                                      SIZE<br \/>\nd674643f5091        About a minute ago   bash                                            85 B<br \/>\nd2a0ecffe6fa        5 days ago           \/bin\/sh -c #(nop) CMD [\"\/bin\/bash\"]             0 B<br \/>\n29460ac93442        5 days ago           \/bin\/sh -c sed -i 's\/^#\\s*\\(deb.*universe\\)$\/   1.895 kB<br \/>\nb670fb0c7ecd        5 days ago           \/bin\/sh -c echo '#!\/bin\/sh' &gt; \/usr\/sbin\/polic   194.5 kB<br \/>\n83e4dde6b9cf        5 days ago           \/bin\/sh -c #(nop) ADD file:c8f078961a543cdefa   188.2 MB<br \/>\nvagrant@vagrant:~$<br \/>\n<\/code><\/p>\n<h2>Dockerfile \u3067 wget\u30fbping \u306e\u30b3\u30f3\u30c6\u30ca\u3092\u69cb\u7bc9<\/h2>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/builder\/\">Dockerfile<\/a> \u3068\u306f\u3001Docker \u30a4\u30e1\u30fc\u30b8\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u524d\u9805\u3067\u884c\u3063\u305f\u3088\u3046\u306b\u3001\u3044\u3061\u3044\u3061 bash \u3092\u8d77\u52d5\u3057\u3066\u5185\u5bb9\u3092\u5909\u66f4\u3057\u3066\u30b3\u30df\u30c3\u30c8\u3068\u3044\u3046\u624b\u9806\u3092\u8e0f\u307e\u305a\u306b\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f5c\u696d\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u4ee5\u964d\u306f\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u3067\u4f5c\u696d\u3092\u884c\u3044\u307e\u3059\u30021\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b1 Dockerfile \u3068\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~$ mkdir dev<br \/>\nvagrant@vagrant:~$ cd dev<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>Ubuntu \u306e <a href=\"http:\/\/www.gnu.org\/software\/wget\/\">wget<\/a> \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u5b9f\u884c\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ vi Dockerfile<br \/>\nFROM ubuntu:14.04<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">RUN apt-get install -y wget<br \/>\nCMD \/usr\/bin\/wget<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/builder\/#from\">FROM<\/a> \u306f\u5143\u3068\u306a\u308b\u30a4\u30e1\u30fc\u30b8\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30b3\u30e1\u30f3\u30c8\u884c\u3092\u9664\u3044\u3066\u3001Dockerfile \u306e\u5148\u982d\u306b\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/builder\/#run\">RUN<\/a> \u306f\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u6307\u5b9a\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u30b3\u30df\u30c3\u30c8\u3057\u307e\u3059\u3002\u305d\u306e\u6027\u8cea\u4e0a\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u8d77\u52d5\u3059\u308b\u30c7\u30fc\u30e2\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3088\u3046\u306a\u4f7f\u3044\u65b9\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p><a href=\"http:\/\/docs.docker.com\/reference\/builder\/#cmd\">CMD<\/a> \u306f\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u6700\u7d42\u7684\u306b\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u304c\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u306e PID 1 \u3068\u306a\u308a\u307e\u3059\u3002\u307e\u305f\u8907\u6570\u306e CMD \u3092\u6307\u5b9a\u3057\u3066\u3082\u6700\u5f8c\u306e\u6307\u5b9a\u3057\u304b\u52b9\u679c\u3092\u6301\u3061\u307e\u305b\u3093\u3002<\/p>\n<p>Dockerfile \u304c\u5b8c\u6210\u3057\u305f\u3089\u3001<a href=\"http:\/\/docs.docker.com\/reference\/commandline\/build\/\">docker build<\/a> \u30b3\u30de\u30f3\u30c9\u306b\u300c<strong>-t<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30a4\u30e1\u30fc\u30b8\u306e\u540d\u524d\u3092\u6307\u5b9a\u3057\u3001\u30a4\u30e1\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker build -t vagdocker\/wget .<br \/>\nSending build context to Docker daemon 2.048 kB<br \/>\nSending build context to Docker daemon<br \/>\nStep 0 : FROM ubuntu:14.04<br \/>\n14.04: Pulling from ubuntu<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">83e4dde6b9cf: Already exists<br \/>\nb670fb0c7ecd: Already exists<br \/>\nd2a0ecffe6fa: Already exists<br \/>\nubuntu:14.04: 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.<br \/>\nDigest: sha256:36de65e14e47b2a9a3d91c9a832899d4c432a00295bd77ced8d5bb6dc2764318<br \/>\nStatus: Downloaded newer image for ubuntu:14.04<br \/>\n---&gt; d2a0ecffe6fa<br \/>\nStep 1 : RUN apt-get install -y wget<br \/>\n---&gt; Running in 374ebeb8150b<br \/>\nReading package lists...<br \/>\nBuilding dependency tree...<br \/>\nReading state information...<br \/>\nThe following extra packages will be installed:<br \/>\nca-certificates libidn11 openssl<br \/>\nThe following NEW packages will be installed:<br \/>\nca-certificates libidn11 openssl wget<br \/>\n0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.<br \/>\nNeed to get 1026 kB of archives.<br \/>\nAfter this operation, 2397 kB of additional disk space will be used.<br \/>\nGet:1 http:\/\/archive.ubuntu.com\/ubuntu\/ trusty\/main libidn11 amd64 1.28-1ubuntu2 [93.0 kB]<br \/>\nGet:2 http:\/\/archive.ubuntu.com\/ubuntu\/ trusty\/main openssl amd64 1.0.1f-1ubuntu2 [489 kB]<br \/>\nGet:3 http:\/\/archive.ubuntu.com\/ubuntu\/ trusty\/main ca-certificates all 20130906ubuntu2 [175 kB]<br \/>\nGet:4 http:\/\/archive.ubuntu.com\/ubuntu\/ trusty\/main wget amd64 1.15-1ubuntu1 [270 kB]<br \/>\ndebconf: unable to initialize frontend: Dialog<br \/>\ndebconf: (TERM is not set, so the dialog frontend is not usable.)<br \/>\ndebconf: falling back to frontend: Readline<br \/>\ndebconf: unable to initialize frontend: Readline<br \/>\ndebconf: (This frontend requires a controlling tty.)<br \/>\ndebconf: falling back to frontend: Teletype<br \/>\ndpkg-preconfigure: unable to re-open stdin:<br \/>\nFetched 1026 kB in 1s (597 kB\/s)<br \/>\nSelecting previously unselected package libidn11:amd64.<br \/>\n(Reading database ... 11541 files and directories currently installed.)<br \/>\nPreparing to unpack ...\/libidn11_1.28-1ubuntu2_amd64.deb ...<br \/>\nUnpacking libidn11:amd64 (1.28-1ubuntu2) ...<br \/>\nSelecting previously unselected package openssl.<br \/>\nPreparing to unpack ...\/openssl_1.0.1f-1ubuntu2_amd64.deb ...<br \/>\nUnpacking openssl (1.0.1f-1ubuntu2) ...<br \/>\nSelecting previously unselected package ca-certificates.<br \/>\nPreparing to unpack ...\/ca-certificates_20130906ubuntu2_all.deb ...<br \/>\nUnpacking ca-certificates (20130906ubuntu2) ...<br \/>\nSelecting previously unselected package wget.<br \/>\nPreparing to unpack ...\/wget_1.15-1ubuntu1_amd64.deb ...<br \/>\nUnpacking wget (1.15-1ubuntu1) ...<br \/>\nSetting up libidn11:amd64 (1.28-1ubuntu2) ...<br \/>\nSetting up openssl (1.0.1f-1ubuntu2) ...<br \/>\nSetting up ca-certificates (20130906ubuntu2) ...<br \/>\ndebconf: unable to initialize frontend: Dialog<br \/>\ndebconf: (TERM is not set, so the dialog frontend is not usable.)<br \/>\ndebconf: falling back to frontend: Readline<br \/>\ndebconf: unable to initialize frontend: Readline<br \/>\ndebconf: (This frontend requires a controlling tty.)<br \/>\ndebconf: falling back to frontend: Teletype<br \/>\nSetting up wget (1.15-1ubuntu1) ...<br \/>\nProcessing triggers for libc-bin (2.19-0ubuntu6.6) ...<br \/>\nProcessing triggers for ca-certificates (20130906ubuntu2) ...<br \/>\nUpdating certificates in \/etc\/ssl\/certs... 164 added, 0 removed; done.<br \/>\nRunning hooks in \/etc\/ca-certificates\/update.d....done.<br \/>\n---&gt; 9bdd7cd26ea3<br \/>\nRemoving intermediate container 374ebeb8150b<br \/>\nStep 2 : CMD \/usr\/bin\/wget<br \/>\n---&gt; Running in ad80d7a4df9b<br \/>\n---&gt; 3fc626799b4d<br \/>\nRemoving intermediate container ad80d7a4df9b<br \/>\nSuccessfully built 3fc626799b4d<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u7121\u4e8b\u30a4\u30e1\u30fc\u30b8\u304c\u5b8c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u65e9\u901f\u3053\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker run -ti vagdocker\/wget<br \/>\nwget: missing URL<br \/>\nUsage: wget [OPTION]... [URL]...<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">Try `wget --help' for more options.<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>Dockerfile \u306e CMD \u3067\u306f\u7279\u306b\u5f15\u6570\u3092\u4e0e\u3048\u305a\u306b wget \u3092\u6307\u5b9a\u3057\u3066\u3044\u305f\u306e\u3067\u3001\u4f7f\u3044\u65b9\u3092\u8868\u793a\u3057\u3066\u30b3\u30f3\u30c6\u30ca\u306f\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>CMD \u306b\u4f3c\u305f\u6587\u3068\u3057\u3066 <a href=\"http:\/\/docs.docker.com\/reference\/builder\/#entrypoint\">ENTRYPOINT<\/a> \u304c\u3042\u308a\u307e\u3059\u3002ENTRYPOINT \u3067\u3082\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u6b21\u306e\u3088\u3046\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002CMD \u3068 ENTRYPOINT \u306e\u4f7f\u3044\u5206\u3051\u306f <a href=\"https:\/\/docs.docker.com\/articles\/dockerfile_best-practices\/\">Best practices for writing Dockerfiles<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ vi Dockerfile<br \/>\nFROM ubuntu:14.04<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">ENTRYPOINT [\"ping\", \"-c\", \"60\"]<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u30a4\u30e1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker build -t vagdocker\/ping .<br \/>\nSending build context to Docker daemon 2.048 kB<br \/>\nSending build context to Docker daemon<br \/>\nStep 0 : FROM ubuntu:14.04<br \/>\n---&gt; d2a0ecffe6fa<br \/>\nStep 1 : ENTRYPOINT ping -c 60<br \/>\n---&gt; Running in 669a9e848da1<br \/>\n---&gt; f35a0f7fdcd0<br \/>\nRemoving intermediate container 669a9e848da1<br \/>\nSuccessfully built f35a0f7fdcd0<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u5f15\u6570\u306b\u300c<strong>127.0.0.1<\/strong>\u300d\u3092\u4e0e\u3048\u3066\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002\u3053\u308c\u306f ENTRYPOINT \u3067\u6307\u5b9a\u3057\u3066\u3044\u305f\u300c<strong>-c 60<\/strong>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3057\u3066\u3001\u300cping -c 60 127.0.0.1\u300d\u3068\u3057\u3066\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker run vagdocker\/ping 127.0.0.1<br \/>\nPING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.<br \/>\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.034 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.035 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.035 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.040 ms<br \/>\n64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.034 ms<br \/>\n:<br \/>\n:<br \/>\n:<br \/>\n<\/code><\/p>\n<p>ENTRYPOINT \u3068\u540c\u3058\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5024\u3092\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker run vagdocker\/ping -c 1 127.0.0.1<br \/>\nPING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.<br \/>\n64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.031 ms<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">--- 127.0.0.1 ping statistics ---<br \/>\n1 packets transmitted, 1 received, 0% packet loss, time 0ms<br \/>\nrtt min\/avg\/max\/mdev = 0.031\/0.031\/0.031\/0.000 ms<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u300c<a href=\"http:\/\/docs.docker.com\/reference\/run\/#entrypoint-default-command-to-execute-at-runtime\">--entrypoint<\/a>\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u3068\u3001ENTRYPOINT \u3067\u6307\u5b9a\u3057\u305f\u30b3\u30de\u30f3\u30c9\u305d\u306e\u3082\u306e\u3092\u4e0a\u66f8\u304d\u3067\u304d\u307e\u3059\u3002\u6b21\u306f ping \u30b3\u30de\u30f3\u30c9\u3092\u4e0a\u66f8\u304d\u3057\u3066 bash \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u4f8b\u3067\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker run -t -i --entrypoint bash vagdocker\/ping<br \/>\nroot@555c08683983:\/#<br \/>\n<\/code><\/p>\n<h2>A-8. Dockerfile \u3067 Nginx \u306e\u30b3\u30f3\u30c6\u30ca\u3092\u69cb\u7bc9<\/h2>\n<p>\u30ed\u30fc\u30ab\u30eb\u306b\u7528\u610f\u3057\u3066\u3042\u308b\u9759\u7684\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30f3\u30c6\u30ca\u5185\u306b\u8ffd\u52a0\u3059\u308b\u306b\u306f Dockerfile \u3067 <a href=\"http:\/\/docs.docker.com\/reference\/builder\/#add\">ADD<\/a> \u3092\u4f7f\u3044\u307e\u3059\u3002\u4f3c\u305f\u3088\u3046\u306a\u6587\u3068\u3057\u3066 <a href=\"http:\/\/docs.docker.com\/reference\/builder\/#copy\">COPY<\/a> \u304c\u3042\u308a\u307e\u3059\u3002ADD \u3068 COPY \u306e\u4f7f\u3044\u5206\u3051\u306f <a href=\"https:\/\/docs.docker.com\/articles\/dockerfile_best-practices\/\">Best practices for writing Dockerfiles<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305a\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u306b\u30b3\u30d4\u30fc\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30eb <strong>index.html<\/strong> \u3092 <strong>contents<\/strong> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u6e96\u5099\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ mkdir contents<br \/>\nvagrant@vagrant:~\/dev$ echo \"hello world\" &gt; contents\/index.html<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>Dockerfile \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<a href=\"https:\/\/registry.hub.docker.com\/_\/nginx\/\">nginx<\/a> \u30a4\u30e1\u30fc\u30b8\u3092\u30d9\u30fc\u30b9\u306b\u3001<strong>contents<\/strong> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5185\u5bb9\u3092\u30b3\u30f3\u30c6\u30ca\u5185\u306e <strong>\/usr\/share\/nginx\/html<\/strong> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f <a href=\"http:\/\/nginx.org\/\">Nginx<\/a> \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ vi Dockerfile<br \/>\nFROM nginx<\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">ADD .\/contents \/usr\/share\/nginx\/html<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u30a4\u30e1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker build -t vagdocker\/web .<br \/>\nSending build context to Docker daemon 3.584 kB<br \/>\nSending build context to Docker daemon<br \/>\nStep 0 : FROM nginx<br \/>\nlatest: Pulling from nginx<br \/>\n902b87aaaec9: Pull complete<br \/>\n9a61b6b1315e: Pull complete<br \/>\naface2a79f55: Pull complete<br \/>\n5dd2638d10a1: Pull complete<br \/>\n97df1ddba09e: Pull complete<br \/>\n438d75921414: Pull complete<br \/>\n7340fb61bdef: Pull complete<br \/>\n51ed40dd3671: Pull complete<br \/>\n2b12d66de277: Pull complete<br \/>\n4b1798a9cafa: Pull complete<br \/>\n61f2d0dc0350: Pull complete<br \/>\nce293cb4a3c9: Already exists<br \/>\nnginx: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.<br \/>\nDigest: sha256:90c72cfd3fabbc56971ea1cf04575b11dce4b3eb35a7363202c31052b5652a76<br \/>\nStatus: Downloaded newer image for nginx:latest<br \/>\n---&gt; ce293cb4a3c9<br \/>\nStep 1 : ADD .\/contents \/usr\/share\/nginx\/html<br \/>\n---&gt; d911784cd5e5<br \/>\nRemoving intermediate container 2f7bb5376697<br \/>\nSuccessfully built d911784cd5e5<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002\u300c<a href=\"http:\/\/docs.docker.com\/reference\/run\/#expose-incoming-ports\">-p<\/a> <strong>\u30db\u30b9\u30c8\u5074\u306e\u30dd\u30fc\u30c8<\/strong>:<strong>\u30b3\u30f3\u30c6\u30ca\u5185\u306e\u30dd\u30fc\u30c8<\/strong>\u300d\u3068\u3059\u308b\u3068\u3001\u30db\u30b9\u30c8\u5074\u306e\u30dd\u30fc\u30c8\u306b\u6765\u305f\u30a2\u30af\u30bb\u30b9\u3092\u30b3\u30f3\u30c6\u30ca\u5185\u306e\u30dd\u30fc\u30c8\u3078\u3068\u7d50\u3073\u3064\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker run -d -p 80:80 vagdocker\/web<br \/>\nf2b16d21e8f826d38014bac97bedfe6aba4cf5c508b4b1c96dbc25db46fd00b9<br \/>\nvagrant@vagrant:~\/dev$ <\/code><\/p>\n<p><code lang=\"bash\"><br \/>\n<\/code><\/p>\n<p><code lang=\"bash\">vagrant@vagrant:~\/dev$ docker ps<br \/>\nCONTAINER ID        IMAGE                  COMMAND                CREATED             STATUS              PORTS                         NAMES<br \/>\nf2b16d21e8f8        vagdocker\/web:latest   \"nginx -g 'daemon of   9 seconds ago       Up 9 seconds        0.0.0.0:80-&gt;80\/tcp, 443\/tcp   pensive_pike<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u30db\u30b9\u30c8\u5074\u306e 80 \u756a\u30dd\u30fc\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u306b\u914d\u7f6e\u3057\u305f <strong>index.html<\/strong> \u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ curl http:\/\/127.0.0.1\/<br \/>\nhello world<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u4e00\u65e6\u30b3\u30f3\u30c6\u30ca\u3092\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker stop f2b16d21e8f8<br \/>\nf2b16d21e8f8<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>Dockerfile \u3067\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u30b3\u30d4\u30fc\u3092\u884c\u308f\u305a\u306b\u3001\u300c<a href=\"http:\/\/docs.docker.com\/reference\/run\/#volume-shared-filesystems\">-v<\/a> <strong>\u30db\u30b9\u30c8\u5074\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30d1\u30b9<\/strong>:<strong>\u30b3\u30f3\u30c6\u30ca\u5185\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30d1\u30b9<\/strong>\u300d\u3068\u3059\u308b\u3053\u3068\u3067\u3001\u30db\u30b9\u30c8\u3068\u30b3\u30f3\u30c6\u30ca\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30b3\u30f3\u30c6\u30ca\u5185\u3067\u52d5\u7684\u306b\u751f\u6210\u3055\u308c\u308b\u30ed\u30b0\u306a\u3069\u3092\u30db\u30b9\u30c8\u5074\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4fdd\u7ba1\u3059\u308b\u3068\u3044\u3063\u305f\u4f7f\u3044\u65b9\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ docker run -d -p 80:80 -v \/home\/vagrant\/dev\/contents:\/usr\/share\/nginx\/html vagdocker\/web<br \/>\ne16181233c319caddbf836249723a8c377a234bfea170ccce7e5c9dd27d9a819<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u5171\u6709\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3066\u3001\u30db\u30b9\u30c8\u5074\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ date &gt; contents\/date.txt<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>curl \u30b3\u30de\u30f3\u30c9\u3067\u30b3\u30f3\u30c6\u30ca\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u30db\u30b9\u30c8\u5074\u3067\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ curl http:\/\/127.0.0.1\/date.txt<br \/>\nWed Jul 15 03:41:59 UTC 2015<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>\u30db\u30b9\u30c8\u5074\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<p><code lang=\"bash\"><br \/>\nvagrant@vagrant:~\/dev$ rm contents\/date.txt<br \/>\nvagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<p>curl \u30b3\u30de\u30f3\u30c9\u3067\u30b3\u30f3\u30c6\u30ca\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u304f\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p><code lang=\"html\"><br \/>\nvagrant@vagrant:~\/dev$ curl http:\/\/127.0.0.1\/date.txt<\/p>\n<p><\/code><\/p>\n<p><center><\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<h1>404 Not Found<\/h1>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p><\/center><\/p>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<hr \/>\n<p><code lang=\"html\"><code lang=\"html\"><\/code><\/code><\/p>\n<p><center>nginx\/1.9.2<\/center><code lang=\"html\"><\/p>\n<p>vagrant@vagrant:~\/dev$<br \/>\n<\/code><\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u8cc7\u6599\u306b\u5f93\u3044\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3057\u3066\u307f\u307e\u3057\u305f\u3002Docker \u306e\u4f7f\u3044\u65b9\u3084\u52d5\u4f5c\u306b\u3064\u3044\u3066\u3001\u3055\u308f\u308a\u306e\u90e8\u5206\u304c\u304a\u304a\u3088\u305d\u4f53\u9a13\u3067\u304d\u305f\u3068\u601d\u3044\u307e\u3059\u3002\u307e\u305f\u3001<a href=\"http:\/\/docs.docker.com\/\">Docker Docs<\/a> \u306f\u975e\u5e38\u306b\u5145\u5b9f\u3057\u305f\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306a\u306e\u3067\u3001\u4e00\u901a\u308a\u76ee\u3092\u901a\u3057\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u3055\u3089\u306b\u7406\u89e3\u304c\u6df1\u307e\u308b\u3053\u3068\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300cDocker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f Amazon EC2 Container Service (ECS) \u3067\u306f\u306a\u304f\u3001Vagrant + VirtualBox \u3067\u74b0\u5883\u3092\u4f5c\u6210\u3057\u3001\u8cc7\u6599\u306b\u5f93\u3063\u3066\u30cf\u30f3\u30ba [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[36,31,43,42],"tags":[],"class_list":["post-10636","post","type-post","status-publish","format-standard","hentry","category-chef","category-higuchi","category-docker","category-hashicorp"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3<\/title>\n<meta name=\"description\" content=\"Chef, d-higuchi, Docker, HashiCorp |\u300cDocker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f Amazon EC2 Container Service (ECS)\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"og:description\" content=\"Chef, d-higuchi, Docker, HashiCorp |\u300cDocker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f Amazon EC2 Container Service (ECS)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636\" \/>\n<meta property=\"og:site_name\" content=\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/creationline\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-04T02:30:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-29T05:19:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/01\/screenshot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"470\" \/>\n\t<meta property=\"og:image:height\" content=\"394\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daisuke Higuchi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@creationline\" \/>\n<meta name=\"twitter:site\" content=\"@creationline\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daisuke Higuchi\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"16\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636\"},\"author\":{\"name\":\"Daisuke Higuchi\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"headline\":\"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker\",\"datePublished\":\"2015-08-04T02:30:33+00:00\",\"dateModified\":\"2023-08-29T05:19:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636\"},\"wordCount\":246,\"articleSection\":[\"Chef\",\"d-higuchi\",\"Docker\",\"HashiCorp\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636\",\"name\":\"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\"},\"datePublished\":\"2015-08-04T02:30:33+00:00\",\"dateModified\":\"2023-08-29T05:19:08+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\"},\"description\":\"Chef, d-higuchi, Docker, HashiCorp |\u300cDocker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f Amazon EC2 Container Service (ECS)\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\\\/10636#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"HOME\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Chef\",\"item\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cloudnative\\\/chef\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#website\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/\",\"name\":\"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3\",\"description\":\"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/#\\\/schema\\\/person\\\/16f1373831fb6fd17387f16ae1195206\",\"name\":\"Daisuke Higuchi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"contentUrl\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/cms_x3GWkuX\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/d-higuchi-wp-icon-230x230.png\",\"caption\":\"Daisuke Higuchi\"},\"description\":\"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.creationline.com\\\/tech-blog\\\/author\\\/higuchi\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"Chef, d-higuchi, Docker, HashiCorp |\u300cDocker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f Amazon EC2 Container Service (ECS)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636","og_locale":"ja_JP","og_type":"article","og_title":"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","og_description":"Chef, d-higuchi, Docker, HashiCorp |\u300cDocker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f Amazon EC2 Container Service (ECS)","og_url":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636","og_site_name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","article_publisher":"https:\/\/www.facebook.com\/creationline","article_published_time":"2015-08-04T02:30:33+00:00","article_modified_time":"2023-08-29T05:19:08+00:00","og_image":[{"width":470,"height":394,"url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2026\/01\/screenshot.png","type":"image\/png"}],"author":"Daisuke Higuchi","twitter_card":"summary_large_image","twitter_creator":"@creationline","twitter_site":"@creationline","twitter_misc":{"\u57f7\u7b46\u8005":"Daisuke Higuchi","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"16\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636#article","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636"},"author":{"name":"Daisuke Higuchi","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"headline":"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker","datePublished":"2015-08-04T02:30:33+00:00","dateModified":"2023-08-29T05:19:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636"},"wordCount":246,"articleSection":["Chef","d-higuchi","Docker","HashiCorp"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636","url":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636","name":"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker - Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","isPartOf":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#website"},"datePublished":"2015-08-04T02:30:33+00:00","dateModified":"2023-08-29T05:19:08+00:00","author":{"@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206"},"description":"Chef, d-higuchi, Docker, HashiCorp |\u300cDocker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u8cc7\u6599\u300d\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f Amazon EC2 Container Service (ECS)","breadcrumb":{"@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef\/10636#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"HOME","item":"https:\/\/www.creationline.com\/tech-blog"},{"@type":"ListItem","position":2,"name":"\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative"},{"@type":"ListItem","position":3,"name":"Chef","item":"https:\/\/www.creationline.com\/tech-blog\/cloudnative\/chef"},{"@type":"ListItem","position":4,"name":"Vagrant + Chef-Zero Provisioner \u3067\u74b0\u5883\u3092\u4f5c\u308a\u3001Docker \u5165\u9580\u30cf\u30f3\u30ba\u30aa\u30f3\u3092\u5b9f\u65bd\u3059\u308b #getchef #vagrant #docker"}]},{"@type":"WebSite","@id":"https:\/\/www.creationline.com\/tech-blog\/#website","url":"https:\/\/www.creationline.com\/tech-blog\/","name":"Tech Blog\uff5c\u30af\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30f3","description":"\u30a2\u30b8\u30e3\u30a4\u30eb\uff06DevOps\u3001\u30af\u30e9\u30a6\u30c9\u30cd\u30a4\u30c6\u30a3\u30d6\u3001AI\uff06LLM\u306e\u5148\u7aef\u6280\u8853","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.creationline.com\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.creationline.com\/tech-blog\/#\/schema\/person\/16f1373831fb6fd17387f16ae1195206","name":"Daisuke Higuchi","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","url":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","contentUrl":"https:\/\/www.creationline.com\/tech-blog\/cms_x3GWkuX\/wp-content\/uploads\/2023\/08\/d-higuchi-wp-icon-230x230.png","caption":"Daisuke Higuchi"},"description":"Chef\u30fbDocker\u30fbMirantis\u88fd\u54c1\u306a\u3069\u306e\u6280\u8853\u8981\u7d20\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8b70\u306e\u9032\u3081\u65b9\u30fb\u6587\u7ae0\u306e\u66f8\u304d\u65b9\u306a\u3069\u306e\u696d\u52d9\u6539\u5584\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u3044\u307e\u3059\u3002\u300cChef\u6d3b\u7528\u30ac\u30a4\u30c9\u300d\u5171\u8457\u306e\u307b\u304b\u3001Debian Official Developer\u3082\u3084\u3063\u3066\u3044\u307e\u3059\u3002","url":"https:\/\/www.creationline.com\/tech-blog\/author\/higuchi"}]}},"_links":{"self":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/10636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=10636"}],"version-history":[{"count":1,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/10636\/revisions"}],"predecessor-version":[{"id":65795,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/posts\/10636\/revisions\/65795"}],"wp:attachment":[{"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=10636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=10636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creationline.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=10636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}