{"id":4844,"date":"2014-12-12T09:00:40","date_gmt":"2014-12-12T00:00:40","guid":{"rendered":"http:\/\/www.vincentina.net\/?p=4844"},"modified":"2020-02-23T16:26:14","modified_gmt":"2020-02-23T07:26:14","slug":"dockerchef%e3%81%a7%e7%92%b0%e5%a2%83%e4%bd%9c%e3%82%8a-2-ruby","status":"publish","type":"post","link":"https:\/\/www.vincentina.net\/?p=4844","title":{"rendered":"Docker+Chef\u3067\u74b0\u5883\u4f5c\u308a 2 ruby"},"content":{"rendered":"<p>\u524d\u56de\u304b\u3089\u306e\u7d9a\u304d\u3067\u3059\u3002<\/p>\n<p><a title=\"Docker + Chef \u3067\u697d\u3005\u74b0\u5883\u4f5c\u308a\" href=\"http:\/\/www.vincentina.net\/?p=4820\" target=\"_blank\" rel=\"noopener noreferrer\">Docker + Chef \u3067\u697d\u3005\u74b0\u5883\u4f5c\u308a<\/a><\/p>\n<p class=\"entry-title\"><a href=\"http:\/\/www.vincentina.net\/?p=4829\" rel=\"bookmark\">Docker+Chef\u3067\u74b0\u5883\u4f5c\u308a\u3000\uff11 PHP\/Nginx<\/a><\/p>\n<h1>Ruby\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b<\/h1>\n<p>Base\u3001PHP\u3001Nginx\u3068\u6765\u307e\u3057\u3066\u3001Ruby\u306e\u30ec\u30b7\u30d4\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u30af\u30c3\u30af\u30d6\u30c3\u30af\u4f5c\u6210\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ knife cookbook create ruby-env -o site-cookbooks<\/pre>\n<\/p>\n<p>&nbsp;<\/p>\n<p>Berkfile\u306b\u8ffd\u8a18\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ vi Berksfile\r\ncookbook 'ruby-env', path: &quot;.\/site-cookbooks\/ruby-env&quot;<\/pre>\n<\/p>\n<p>&nbsp;<\/p>\n<p>Docker.json\u306erun_list\u306b\u8ffd\u8a18\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ vi .\/nodes\/docker.json\r\n&quot;recipe&#x5B;ruby-env]&quot;<\/pre>\n<\/p>\n<p>&nbsp;<\/p>\n<p>\u30d9\u30fc\u30b9\u306b\u3057\u305f\u3044\u74b0\u5883\u306f<br \/>\n<a title=\"Sinatra + ActiveRecord + MySQL \u3067\u7c21\u6613\u30a2\u30d7\u30ea\u3064\u304f\u3063\u3066\u307f\u308b\" href=\"http:\/\/www.vincentina.net\/?p=4782\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Sinatra + ActiveRecord + MySQL \u3067\u7c21\u6613\u30a2\u30d7\u30ea\u3064\u304f\u3063\u3066\u307f\u308b<\/strong><\/a>\u3053\u306e\u4f5c\u696d\u306e\u6642\u306b\u4f5c\u3063\u305f\u3082\u306e\u306a\u306e\u3067rbenv\u304b\u3089\u5165\u308c\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u53c2\u8003\u66f8\u7c4d\u3068\u540c\u3058\u3067\u3059\u306d\u3002\u3053\u308c\u306f\u5076\u7136\u306a\u306e\u3067\u826f\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n<p>\u30ec\u30b7\u30d4\u3092\u66f8\u304d\u307e\u3059\u3002Base\u30ec\u30b7\u30d4\u3067\u3082\u57fa\u672c\u7684\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5e7e\u3064\u304b\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u5fc5\u8981\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u6b8b\u308a\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git tar\u00a0 sqlite-devel<\/pre>\n<\/p>\n<p>\u66f8\u7c4d\u306e\u9806\u3067\u9032\u3081\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u3089\u304b\u3089Attribute\u304c\u30d0\u30b7\u30d0\u30b7\u51fa\u3066\u304d\u307e\u3059\u306d\u3002<br \/>\n\u5185\u5bb9\u306fRuby\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u304b\u3061\u3087\u3063\u3068\u5909\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>.bash_profile\u306f1\u56de\u524d\u306b\u4f5c\u3063\u305f\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u62fe\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ vi site-cookbooks\/ruby-env\/attributes\/default.rb\r\ndefault&#x5B;'ruby-env']&#x5B;'user'] = &quot;takeken&quot;\r\ndefault&#x5B;'ruby-env']&#x5B;'group'] = &quot;takeken&quot;\r\ndefault&#x5B;'ruby-env']&#x5B;'version'] = &quot;2.1.5&quot;\r\ndefault&#x5B;'ruby-env']&#x5B;'rbenv_url'] = &quot;https:\/\/github.com\/sstephenson\/rbenv&quot;\r\ndefault&#x5B;'ruby-env']&#x5B;'ruby-build_url'] = &quot;https:\/\/github.com\/sstephenson\/ruby-build&quot;<\/pre>\n<\/p>\n<p>&nbsp;<\/p>\n<p>\u3067\u306fberks vendor\u3057\u3066\u30d3\u30eb\u30c9\u3059\u306a\u3002<br \/>\n\u66f8\u7c4d\u3067\u8a00\u3046\u3068\u3053\u308d\u306e\u30d7\u30ed\u30d3\u30b8\u30e7\u30cb\u30f3\u30b0\u3002\u610f\u5473\u306f\u4e00\u7dd2\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ berks vendor cookbooks\r\nResolving cookbook dependencies...\r\nFetching 'nginx' from source at site-cookbooks\/nginx\r\nFetching 'php-env' from source at site-cookbooks\/php-env\r\nFetching 'ruby-env' from source at site-cookbooks\/ruby-env\r\nFetching cookbook index from https:\/\/supermarket.getchef.com...\r\nUsing nginx (0.1.0) from source at site-cookbooks\/nginx\r\nUsing ruby-env (0.1.0) from source at site-cookbooks\/ruby-env\r\nUsing php-env (0.1.0) from source at site-cookbooks\/php-env\r\nUsing selinux (0.8.0)\r\nUsing yum (3.5.1)\r\nUsing yum-epel (0.5.3)\r\nVendoring nginx (0.1.0) to cookbooks\/nginx\r\nVendoring php-env (0.1.0) to cookbooks\/php-env\r\nVendoring ruby-env (0.1.0) to cookbooks\/ruby-env\r\nVendoring selinux (0.8.0) to cookbooks\/selinux\r\nVendoring yum (3.5.1) to cookbooks\/yum\r\nVendoring yum-epel (0.5.3) to cookbooks\/yum-epel\r\n\r\n&#x5B;takeken@ubuntu]$ sudo docker build -t base .\/<\/pre>\n<\/p>\n<p>&nbsp;<\/p>\n<p>\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f(*\u00b4\u03c9\uff40)<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@6b2190d709c9 ~]$ rbenv -v\r\nrbenv 0.4.0-129-g7e0e85b<\/pre>\n<\/p>\n<p>&nbsp;<\/p>\n<p>\u7bc0\u76ee\u3067Git Push\u3057\u3068\u304d\u307e\u3059\u3002\u307e\u3060\u30af\u30bb\u3065\u3044\u3066\u306a\u3044\u306e\u3067\u6c17\u3092\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ git add .\r\n&#x5B;takeken@ubuntu]$ git commit -m &quot;20141211:rbenv\u8ffd\u52a0&quot;\r\n&#x5B;master d57a3ec] 20141211:rbenv\u8ffd\u52a0\r\n\u00a08 files changed, 139 insertions(+), 1 deletion(-)\r\n&#x5B;takeken@ubuntu]$ git push<\/pre>\n<\/p>\n<p>&nbsp;<\/p>\n<p>Git\u3082\u305d\u308c\u3060\u3051\u3067\u672c\u304c1\u518a\u3067\u304d\u3042\u304c\u308a\u307e\u3059\u304c\u3001\u3061\u3087\u3044\u3068\u623b\u3057\u305f\u304f\u3066Git pull\u3057\u305f\u3068\u304d\u306b\u601d\u3063\u305f\u72b6\u614b\u3067\u306a\u304b\u3063\u305f\u308a\u3057\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u3082\u305d\u3082\u4f7f\u3044\u65b9\u304c\u9593\u9055\u3063\u3066\u3044\u305f\u3088\u3046\u3067\u3059\u3057\u3001\u521d\u5fc3\u8005\u306fPull\u3092\u4f7f\u3044\u306a\u3055\u3093\u306a\u3068\u3044\u3046\u4e8b\u3082\u3042\u308b\u307f\u305f\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8<br \/>\n<a href=\"http:\/\/dqn.sakusakutto.jp\/2012\/11\/git_pull.html\" target=\"_blank\" rel=\"noopener noreferrer\">Git pull\u3092\u4f7f\u3046\u3079\u304d\u3067\u306a\u3044\uff13\u3064\u306e\u7406\u7531<\/a> &#8211; DQNEO\u8d77\u696d\u65e5\u8a18:<\/p>\n<p>\u3067\u306f\u3001\u7d9a\u304d\u306b\u3044\u304d\u307e\u3059\u3002<br \/>\n\u3055\u304d\u307b\u3069rbenv\u3092\u5165\u308c\u3066\u78ba\u8a8d\u3057\u305f\u3068\u3053\u307e\u3067\u9032\u3093\u3060\u306e\u3067rbenv\u3092\u4f7f\u3063\u3066ruby\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3061\u3087\u3063\u3068\u30ea\u30bd\u30fc\u30b9\u306b\u3064\u3044\u3066\u632f\u308a\u8fd4\u308a\u3068\u8a00\u3046\u304b\u7c21\u5358\u306b\u307e\u3068\u3081\u3066\u307f\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>package<\/td>\n<td>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u7ba1\u7406\u3002\u30c7\u30a3\u30b9\u30c8\u30ea\u306f\u81ea\u52d5\u3067\u5224\u5225\u3057\u3066\u304f\u308c\u308b\u307f\u305f\u3044\u3002<\/td>\n<\/tr>\n<tr>\n<td>service<\/td>\n<td>\u30b5\u30fc\u30d3\u30b9\u306estart\u3001stop\u3001restart\u3068\u304b\u3002<\/td>\n<\/tr>\n<tr>\n<td>template<\/td>\n<td>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3068\u304b\u3001\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3046\u3002<\/td>\n<\/tr>\n<tr>\n<td>directory<\/td>\n<td>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5b9a\u7fa9\u3002<\/td>\n<\/tr>\n<tr>\n<td>cookbook_file<\/td>\n<td>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3046\u3002\u9759\u7684\u306b\u4f7f\u3046\u7528\u9014\u3067\u5206\u3051\u308b\u306e\u304c\u5b9a\u77f3\u3002<\/td>\n<\/tr>\n<tr>\n<td>ipconfig<\/td>\n<td>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td>git<\/td>\n<td>github\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u5229\u7528\u3057\u305f\u308a\u3002<\/td>\n<\/tr>\n<tr>\n<td>gem_package<\/td>\n<td>RubyGems\u306egem\u3092\u6271\u3046\u3002\u4f7f\u3044\u65b9\u306fpackage\u3068\u540c\u69d8\u3002<\/td>\n<\/tr>\n<tr>\n<td>execute<\/td>\n<td>\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u3002not_if only_if \u3068\u5408\u308f\u305b\u308b\u4e8b\u304c\u591a\u3044\uff08\u3089\u3057\u3044\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td>script<\/td>\n<td>\u6307\u5b9a\u3057\u305f\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3002execute\u306eaction\u3082\u5229\u7528\u3067\u304d\u308b\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4eca\u307e\u3067\u51fa\u3066\u304d\u305f\u30ea\u30bd\u30fc\u30b9\u306f\u3053\u3093\u306a\u3068\u3053\u308d\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3058\u3083\u3001\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>ruby-build\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068ruby\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3055\u3063\u304d\u4f5c\u3063\u305f\u30ec\u30b7\u30d4\u3092\u4fee\u6b63\u3059\u308b\u3060\u3051\u306b\u306a\u308a\u307e\u3059\u3002\u4e0b\u306b\u3042\u3052\u305f\u5185\u5bb9\u3092\u8ffd\u52a0\u3059\u308b\u308f\u3051\u3067\u3059\u306a\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\u7d9a\u3044\u3066ruby-build\r\n# git clone https:\/\/github.com\/sstephenson\/ruby-build.git ~\/.rbenv\/plugins\/ruby-build\r\n\u30d0\u30fc\u30b8\u30e7\u30f3\u78ba\u8a8d\u3002\r\n# rbenv install --list\r\n\u6700\u65b0\u306e\u5b89\u5b9a\u7248\u3092\u3002\r\n# rbenv install -v 2.1.5\r\n\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u3057\u3066\u6709\u52b9\u306b\u3002\r\n# rbenv global 2.1.5\r\n\u78ba\u8a8d\u3002\r\n# ruby -v<\/pre>\n<\/p>\n<p>\u66f8\u7c4d\u306e\u5185\u5bb9\u306b\u52a0\u3048\u3066\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u3063\u305f\u3089\u6709\u52b9\u306b\u3059\u308b\u30ea\u30bd\u30fc\u30b9\u3092\u52a0\u3048\u307e\u3057\u305f\u3002<\/p>\n<p>ruby-2.1.5\u3092\u4f7f\u3046\u524d\u63d0\u306b\u3057\u3066\u3044\u308b\u306e\u3067\uff01\u3082\u30572\u500b\u4ee5\u4e0a\u3042\u3063\u305f\u3089\u307b\u3057\u3044\u7d50\u679c\u306b\u306a\u3089\u306a\u3044\u53ef\u80fd\u6027\u306f\u3042\u308b\u3068\u601d\u3046\u3088\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">execute &quot;rbenv global #{node&#x5B;'ruby-env']&#x5B;'version']}&quot; do\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 command &quot;\/home\/#{node&#x5B;'ruby-env']&#x5B;'user']}\/.rbenv\/bin\/rbenv global #{node&#x5B;'ruby-env']&#x5B;'version']}&quot;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 user node&#x5B;'ruby-env']&#x5B;'user']\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 group node&#x5B;'ruby-env']&#x5B;'group']\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 environment 'HOME' =&gt; &quot;\/home\/#{node&#x5B;'ruby-env']&#x5B;'user']}&quot;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 only_if { File.exists?(&quot;\/home\/#{node&#x5B;'ruby-env']&#x5B;'user']}\/.rbenv\/versions\/#{node&#x5B;'ruby-env']&#x5B;'version']}&quot;)}\r\nend<\/pre>\n<\/p>\n<p>\u7de8\u96c6\u3057\u3066\u30d3\u30eb\u30c9\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ vim chef-repo\/site-cookbooks\/ruby-env\/recipes\/default.rb\r\n&#x5B;takeken@ubuntu]$ berks vendor cookbooks\r\n&#x5B;takeken@ubuntu]$ sudo docker build -t base .\/<\/pre>\n<\/p>\n<p>\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f(*\u00b4\u03c9\uff40)<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ sudo docker run -it base:latest \/bin\/bash\r\nbash-4.1# su - takeken\r\n&#x5B;takeken@8d5881fdf533 ~]$ ruby -v\r\nruby 2.1.5p273 (2014-11-13 revision 48405) &#x5B;x86_64-linux]\r\n&#x5B;takeken@8d5881fdf533 ~]$<\/pre>\n<\/p>\n<p>\u3042\u3068\u306fgem\u3067\u306e\u74b0\u5883\u4f5c\u308a\u306a\u306e\u3067\u3001\u3082\u3046\u5c11\u3057\u3067\u3059\u306d\uff5e\u3002<br \/>\n\u3067\u306fgit push\u3057\u3068\u304d\u307e\u305b\u3046\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@ubuntu]$ ls\r\nDockerfile\u00a0 README.md\u00a0 chef-repo\r\n&#x5B;takeken@ubuntu]$ git add .\r\n&#x5B;takeken@ubuntu]$ git commit -m &quot;20141211:ruby2.1.5-rbenv \u8ffd\u52a0&quot;\r\n&#x5B;master aef43e5] 20141211:ruby2.1.5-rbenv \u8ffd\u52a0\r\n\u00a01 file changed, 30 insertions(+)\r\n&#x5B;takeken@ubuntu]$ git push<\/pre>\n<\/p>\n<p>\u3053\u3053\u3067\u601d\u3063\u305f\u306e\u304c\u3001sinatra\u306a\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u308d\u3046\u3068\u3057\u3066\u3044\u305f\u3051\u308c\u3069\u3001bundle exec\u306a\u74b0\u5883\u3067\u4f5c\u696d\u3092\u3059\u308b\u8a33\u3060\u304b\u3089\u3001\u5168\u90e8\u30d7\u30ed\u30d3\u30b8\u30e7\u30cb\u30f3\u30b0\u3059\u308b\u8a33\u306b\u306f\u30a2\u30ab\u30f3\u306e\u3067\u3057\u305f\u3002<br \/>\n\u7f6e\u63db\u3001\u30a2\u30ab\u30f3\u3068\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u3053\u3053\u3067\u7d42\u308f\u3063\u3066\u3082\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u305b\u306a\u306e\u3067bundler\u3092\u5165\u308c\u308b\u307e\u3067\u3084\u308a\u307e\u3059\u3002<br \/>\nrbenv rehash\u3082\u3057\u3066\u306a\u3044\u3057\u3002<\/p>\n<p>\u305d\u308c\u3068\u3001\u524d\u56de\u306fThin\u3092\u4f7f\u3063\u305f\u306e\u3067\u3059\u304c\u3001Unicorn\u304cNginx\u3068\u9023\u643a\u3067\u304d\u308b\u3088\u3046\u3067\u3001\u66f8\u7c4d\u3067\u306fUnicorn\u3092Bundle exec\u306a\u74b0\u5883\u306b\u5165\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u305b\u3063\u304b\u304fNginx\u3092\u5165\u308c\u3066\u3044\u308b\u306e\u3067Unicorn\u3067\u9032\u3081\u308b\u65b9\u5411\u3067\u3044\u304d\u305f\u3044\u3068\u601d\u3046\u306e\u3067\u3001Nginx\u306econf\u30d5\u30a1\u30a4\u30eb\u4fee\u6b63\u307e\u3067\u3084\u3063\u3066\u5b8c\u4e86\u3068\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u3064\u3044\u3067\u3064\u3044\u3067\u3068\u8a00\u3044\u306a\u304c\u3089\u3001\u305f\u3093\u306b\u66f8\u7c4d\u306b\u6cbf\u3063\u3066\u9032\u3081\u3066\u3044\u308b\u3060\u3051\u3068\u3044\u3046\u306e\u306f\u79d8\u5bc6\u3060\u3002<\/p>\n<p>Nginx\u306eenv\u306b\u8ffd\u52a0\u3059\u308bruby\u306f\u3001chef-repo\/nodes\/docker.json\u306b\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u30d3\u30eb\u30c9\u3044\u3063\u3066\u307f\u307e\u3059\u3002<br \/>\n\u30d3\u30eb\u30c9\u306e\u5b8c\u8d70\u3082\u6700\u521d\u306f2\u5206\u304f\u3089\u3044\u3060\u3063\u305f\u3082\u306e\u306e\u3001\u30ab\u30fc\u30cd\u30eb\u306e\u30d3\u30eb\u30c9\u3068\u307e\u3067\u306f\u3044\u304b\u306a\u3044\u3051\u308c\u3069\u3001\u3060\u3044\u3076\u6642\u9593\u3092\u98df\u3063\u3066\u3057\u307e\u3046\u304b\u3089\u5b9f\u9a13\u3082\u5927\u5909\u306a\u3093\u3060\u306a\u3002<\/p>\n<p>\u30fb\u30fb\u30fb7\u5206\u304b\u304b\u308a\u307e\u3057\u305f\u3002\u601d\u3063\u3066\u305f\u3088\u308a\u77ed\u304b\u3063\u305f\u3002<\/p>\n<p>\u3067\u306f\u30b3\u30f3\u30c6\u30ca\u3092\u8d77\u52d5\u3057\u3066\u3001rails\u3092\u52d5\u304b\u3057\u3066nginx\u3068Unicorn\u306e\u9023\u643a\u3092\u78ba\u8a8d\u3059\u308b\u4f5c\u696d\u3092\u3084\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\u307e\u305a\u306f\u8272\u3005\u306a\u3082\u306e\u304c\u3061\u3083\u3093\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3002\r\n\r\n&#x5B;takeken@ubuntu]$ sudo docker run -d -p 22 -p 80 base:latest \/usr\/sbin\/sshd -D\r\n431710a0a464689575c3e109d261ce2717f53f345828d68986144beebbc1af7b\r\n&#x5B;takeken@ubuntu]$ ssh -p 49153 localhost\r\nThe authenticity of host '&#x5B;localhost]:49153 (&#x5B;::1]:49153)' can't be established.\r\nRSA key fingerprint is 9d:b2:49:c4:69:90:3e:7f:f8:6e:cb:8c:c8:a5:67:cd.\r\nAre you sure you want to continue connecting (yes\/no)? yes\r\nWarning: Permanently added '&#x5B;localhost]:49153' (RSA) to the list of known hosts.\r\ntakeken@localhost's password:\r\n&#x5B;takeken@431710a0a464 ~]$\r\n&#x5B;takeken@431710a0a464 ~]$ gem -v\r\n2.2.2\r\n&#x5B;takeken@431710a0a464 ~]$ bundle -v\r\nBundler version 1.7.9\r\n\r\n\u554f\u984c\u306a\u3055\u3052\u306a\u306e\u3067\u3001\u9032\u3093\u3067\u3044\u304d\u307e\u3059\u3002\r\n\r\n&#x5B;takeken@431710a0a464 ~]$ gem install rails -V\r\nGET https:\/\/api.rubygems.org\/latest_specs.4.8.gz\r\n302 Moved Temporarily\r\nGET https:\/\/s3.amazonaws.com\/production.s3.rubygems.org\/latest_specs.4.8.gz\r\n200 OK\r\nGET https:\/\/api.rubygems.org\/quick\/Marshal.4.8\/rails-4.1.8.gemspec.rz\r\n302 Moved Temporarily\r\nGET https:\/\/au-m.rubygems.org\/quick\/Marshal.4.8\/rails-4.1.8.gemspec.rz\r\n200 OK\r\nHEAD https:\/\/api.rubygems.org\/api\/v1\/dependencies\r\n200 OK\r\nGET https:\/\/api.rubygems.org\/api\/v1\/dependencies?gems=rails\r\n200 OK\r\nGET https:\/\/api.rubygems.org\/api\/v1\/dependencies?gems=railties\r\n200 OK\r\nGET https:\/\/api.rubygems.org\/api\/v1\/dependencies?gems=actionmailer\r\n200 OK\r\nGET https:\/\/api.rubygems.org\/api\/v1\/dependencies?gems=activerecord\r\n\r\n\uff5e\uff5e\u3000\u7565\u3000\uff5e\uff5e\r\n\r\nsafe, tzinfo after 372 seconds\r\n22 gems installed\r\n&#x5B;takeken@431710a0a464 ~]$\r\n\r\n\u7d42\u308f\u3063\u305f\uff01\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u3064\u304f\u308b\u3088\u3002\r\n\r\n&#x5B;takeken@431710a0a464 ~]$ rails new test_unicorn --skip bundle\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 run\u00a0 bundle exec spring binstub --all\r\n* bin\/rake: spring inserted\r\n* bin\/rails: spring inserted<\/pre>\n<\/p>\n<p>\u3082\u3046\u3061\u3087\u3044\u3067\u3059\u3002<br \/>\n\u3053\u3053\u304b\u3089\u3061\u3087\u3044\u3068\u7aef\u6298\u3063\u3066node.js\u306fYum\u306e\u30ec\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<br \/>\nunicorn\u3092\u8d77\u52d5\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30c1\u30a7\u30c3\u30af\u3002<\/p>\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">&#x5B;takeken@431710a0a464 test_unicorn]$ unicorn -c config\/unicorn.rb -D\r\n&#x5B;takeken@431710a0a464 test_unicorn]$<\/pre>\n<\/p>\n<p><a href=\"http:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/jaf0afjwf.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/jaf0afjwf.jpg\" alt=\"jaf0afjwf\" width=\"578\" height=\"228\" class=\"alignnone size-full wp-image-4848\" srcset=\"https:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/jaf0afjwf.jpg 578w, https:\/\/www.vincentina.net\/wp-content\/uploads\/2014\/12\/jaf0afjwf-300x118.jpg 300w\" sizes=\"auto, (max-width: 578px) 85vw, 578px\" \/><\/a><\/p>\n<p>\u52d5\u3044\u305f\u4e8b\u306b\u3061\u3087\u3063\u3068\u3073\u3063\u304f\u308a\u3057\u305f\u3051\u308c\u3069\u3001\u6210\u529f\u3063\u3066\u3053\u3068\u3060\u306d\u3002<\/p>\n<p>\u3042\u3068\u306f\u4f55\u3068\u304b\u306a\u308b\u3060\u308d\u3046\uff5e\u3002\u3053\u308c\u3067\u57fa\u672c\u7684\u306a\u3068\u3053\u306f\u4e00\u901a\u308a\u3053\u306a\u305b\u305f\u30fb\u30fb\u6c17\u304c\u3059\u308b\u3002<br \/>\n\u3082\u3068\u3082\u3068\u30a2\u30d7\u30ea\u5236\u4f5c\u306e\u70ba\u306b\u7c21\u5358\u306b\u74b0\u5883\u3092\u4f5c\u308d\u3046\u3068\u601d\u3063\u3066\u3044\u305f\u3068\u3053\u308d\u3067\u3001\u3053\u306e\u307e\u307eDocker\u3068Chef\u3067\u74b0\u5883\u69cb\u7bc9\u3060\uff01\u3068\u3044\u3046\u3082\u306e\u306b\u5d4c\u3063\u3066\u3001\u305d\u308c\u3070\u304b\u308a\u306b\u304b\u307e\u3063\u3066\u3044\u305f\u3089\u672c\u672b\u8ee2\u5012\u3060\u3002<br \/>\n\u672c\u672b\u305f\u3051\u3051\u3093\u306b\u6539\u540d\u3057\u3066\u3082\u3044\u3044\u304f\u3089\u3044\u3060\u3002<\/p>\n<p>\u30d2\u30e3\u30c3\u30cf\u30fc\u3001\u624b\u9806\u306f\u30b3\u30fc\u30c8\u5316\u3060\uff5e\uff5e\u3063\u3066\u8272\u3005\u3068\u9762\u767d\u534a\u5206\u306b\u3084\u3063\u3066\u3044\u308b\u3051\u308c\u3069\u3001\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u5168\u304f\u3084\u3063\u3066\u3044\u306a\u3044\u30a2\u30f3\u30d0\u30e9\u30f3\u30b9\u306a\u72b6\u614b\u304c\u9032\u3093\u3067\u3044\u304f\u306e\u306f\u3001\u3042\u307e\u308a\u3044\u3044\u611f\u3058\u304c\u3057\u306a\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>\u30de\u30a4\u30a2\u30f3\u30b5\u30fcNO\uff11\u3067\u3082\u3044\u3044\u3058\u3083\u306a\u3044\u3068\u3082\u601d\u3044\u307e\u3059\u304b\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u53c2\u8003\u66f8\u7c4d<\/p>\n<p>Chef\u5b9f\u8df5\u5165\u9580\u3000\u6280\u8853\u8a55\u8ad6\u793e<\/p>\n<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.vincentina.net\/?p=4844\" data-text=\"Docker+Chef\u3067\u74b0\u5883\u4f5c\u308a 2 ruby\" data-via=\"TakekenTw\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u304b\u3089\u306e\u7d9a\u304d\u3067\u3059\u3002 Docker + Chef \u3067\u697d\u3005\u74b0\u5883\u4f5c\u308a Docker+Chef\u3067\u74b0\u5883\u4f5c\u308a\u3000\uff11 PHP\/Nginx Ruby\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b Base\u3001PHP\u3001Nginx\u3068\u6765\u307e\u3057\u3066\u3001Ruby\u306e\u30ec\u30b7\u30d4\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002  &hellip; <a href=\"https:\/\/www.vincentina.net\/?p=4844\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Docker+Chef\u3067\u74b0\u5883\u4f5c\u308a 2 ruby&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[106],"tags":[],"class_list":["post-4844","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4844"}],"version-history":[{"count":0,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=\/wp\/v2\/posts\/4844\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vincentina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}