{"id":1879,"date":"2015-06-03T22:17:23","date_gmt":"2015-06-03T13:17:23","guid":{"rendered":"http:\/\/mattyan.net\/blog\/?p=1879"},"modified":"2015-06-03T22:17:23","modified_gmt":"2015-06-03T13:17:23","slug":"docker%e3%81%a7%e3%82%b3%e3%83%b3%e3%83%86%e3%83%8a%e3%81%ae%e4%b8%ad%e3%81%8b%e3%82%89%e3%83%9b%e3%82%b9%e3%83%88%e3%81%abssh%e3%81%a7%e9%80%9a%e4%bf%a1%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/mattyan.net\/blog\/?p=1879","title":{"rendered":"docker\u3067\u30b3\u30f3\u30c6\u30ca\u306e\u4e2d\u304b\u3089\u30db\u30b9\u30c8\u306bssh\u3067\u901a\u4fe1\u3057\u3066\u307f\u305f"},"content":{"rendered":"<p>\u4f8b\u306b\u3088\u3063\u3066\u81ea\u5206\u7528\u306e\u30e1\u30e2\u3060\u304b\u3089\u3069\u3053\u304b\u304a\u304b\u3057\u3044\u304b\u3082<br \/>\n<!--more--><\/p>\n<h3>\u524d\u63d0<\/h3>\n<p>jenkins\u3067\u5b9a\u671f\u7684\u306b\u30b3\u30f3\u30c6\u30ca\u306e\u52d5\u4f5c\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u3066\u3001\u505c\u6b62\u3057\u3066\u308b\u30b3\u30f3\u30c6\u30ca\u304c\u3042\u3063\u305f\u3089\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3057\u3066\u6b32\u3057\u3044\u3002<br \/>\n->\u3067\u3082\u30db\u30b9\u30c8\u74b0\u5883\u306b\u30c9\u30ab\u30c9\u30ab\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u305f\u3089\u9762\u767d\u304f\u306a\u3044\u3002<br \/>\n->\u76e3\u8996\u3059\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u3063\u3066\u305d\u3053\u306bjenkins\u5165\u308c\u3066\u30db\u30b9\u30c8\u306b\u30b3\u30de\u30f3\u30c9\u98db\u3070\u305b\u3070\u3044\u3044\u3093\u3058\u3083\u306d<br \/>\n\u3063\u3066\u3053\u3068\u3067\u307e\u305a\u306f\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u30db\u30b9\u30c8\u306bssh\u3067\u63a5\u7d9a\u3057\u3066nginx\u5165\u308c\u3066\u308b\u30b3\u30f3\u30c6\u30ca\u7acb\u3061\u4e0a\u3052\u308b\u30b3\u30f3\u30c6\u30ca\u3092\u4f5c\u3063\u3066\u307f\u305f\u3002<\/p>\n<pre>\nFROM base\/archlinux\nRUN pacman -Syy --noconfirm\nRUN pacman -S --noconfirm archlinux-keyring\nRUN pacman -Syu --noconfirm\nRUN pacman-db-upgrade\nRUN pacman -S --noconfirm openssh\nADD id_rsa \/\nEXPOSE 80\nCMD ssh -t -t -o 'StrictHostKeyChecking no' ${HOST_IP} -i \/id_rsa docker run -i -t -d -p 80:80 mattyan\/nginx\n<\/pre>\n<p>EXPORSE\u306f\u4eca\u306f\u5fc5\u8981\u306a\u304b\u3063\u305f\u306a\u2026<br \/>\n\u4e8b\u524d\u306b\u30db\u30b9\u30c8\u3067ssh\u306e\u30ad\u30fc\u3092\u4f5c\u3063\u3066\u516c\u958b\u9375\u3092\u767b\u9332\u3002\u79d8\u5bc6\u9375\u3092ADD\u3067\u30b3\u30f3\u30c6\u30ca\u306b\u3002<br \/>\n\u3053\u308c\u3092mattyan\/docadmin\u306e\u540d\u524d\u3067\u30d3\u30eb\u30c9\u3002<br \/>\n\u30db\u30b9\u30c8\u306eIP\u306f\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u306f\u308f\u304b\u3089\u306a\u3044\u307f\u305f\u3044\u3060\u304b\u3089\u30b3\u30f3\u30c6\u30ca\u5b9f\u884c\u6642\u306b\u74b0\u5883\u5909\u6570\u3092\u4f7f\u3063\u3066\u6e21\u3057\u3066\u3042\u3052\u308b\u3002(\u53c2\u8003: <a href=\"http:\/\/qiita.com\/rerofumi\/items\/a6307f3db7c1cbfaaef2\">Docker\u30b3\u30f3\u30c6\u30ca\u5185\u90e8\u304b\u3089\u30db\u30b9\u30c8\u306eSMTP\u3092\u5229\u7528\u3057\u305f\u3044<\/a>)<br \/>\n[bash]<br \/>\ndocker run -e &quot;HOST_IP=`ip r | grep &#8216;docker0&#8217; | awk &#8216;{print $9}&#8217;`&quot; mattyan\/docadmin<br \/>\n[\/bash]<br \/>\n\u666e\u901a\u306bSSH\u3092\u5b9f\u884c\u3057\u3066\u3082<\/p>\n<pre>\nPseudo-terminal will not be allocated because stdin is not a terminal.\n<\/pre>\n<p>\u3068<\/p>\n<pre>\nHost key verification failed.\n<\/pre>\n<p>\u304c\u51fa\u3066\u304d\u3066\u63a5\u7d9a\u3067\u304d\u306a\u304b\u3063\u305f\u306e\u3067\u30b0\u30b0\u30c3\u305f\u7d50\u679c\u3002<br \/>\nPseudo-\u306f\u4eee\u60f3\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u5f37\u5236\u7684\u306b\u5272\u308a\u5f53\u3066\u308b\u305f\u3081\u306b-t\u30aa\u30d7\u30b7\u30e7\u30f3\u30922\u500b\u8a2d\u5b9a\u3002<br \/>\nHost key-\u306f-o &#8216;StrictHostKeyChecking no&#8217;\u3092\u8a2d\u5b9a\u3057\u3066\u30db\u30b9\u30c8\u306e\u30ad\u30fc\u30c1\u30a7\u30c3\u30af\u3092\u7121\u8996\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3002<br \/>\n\u3067\u9ed9\u3063\u305f\u3002(\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u306f\u307e\u305a\u305d\u3046\u3060\u3051\u3069\u3002\u7279\u306b\u5f8c\u8005)<br \/>\n\u3053\u308c\u3067mattyan\/docadmin\u3092\u8d70\u3089\u305b\u305f\u3089mattyan\/nginx\u3092\u7acb\u3061\u4e0a\u3052\u3066\u81ea\u52d5\u7684\u306b\u6b7b\u306c\u30b3\u30f3\u30c6\u30ca\u304c\u3067\u304d\u305f\u3002\u3042\u3068\u306f\u751f\u5b58\u76e3\u8996\u3068jenkins\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3060\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f8b\u306b\u3088\u3063\u3066\u81ea\u5206\u7528\u306e\u30e1\u30e2\u3060\u304b\u3089\u3069\u3053\u304b\u304a\u304b\u3057\u3044\u304b\u3082<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1],"tags":[],"class_list":["post-1879","post","type-post","status-publish","format-standard","hentry","category-3","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1879"}],"version-history":[{"count":0,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1879\/revisions"}],"wp:attachment":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}