{"id":1147,"date":"2023-09-20T18:52:43","date_gmt":"2023-09-20T09:52:43","guid":{"rendered":"https:\/\/gomokulog.gomocool.net\/?p=1147"},"modified":"2023-09-20T18:53:24","modified_gmt":"2023-09-20T09:53:24","slug":"windows%e3%80%81wsl%e3%80%81docker%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83%e3%81%a7%e3%81%a8%e3%81%ab%e3%81%8b%e3%81%8f%e5%8b%95%e3%81%8b%e3%81%97%e3%81%a6%e7%b7%a8%e9%9b%86%e3%81%97%e3%81%a6%e3%81%bf","status":"publish","type":"post","link":"https:\/\/gomokulog.gomocool.net\/?p=1147","title":{"rendered":"Windows\u3001WSL\u3001Docker\u958b\u767a\u74b0\u5883\u3067\u3068\u306b\u304b\u304f\u52d5\u304b\u3057\u3066\u7de8\u96c6\u3057\u3066\u307f\u308b [AmazonLinux2, Apache, PHP, MySQL, CakePHP4]"},"content":{"rendered":"\n<p>Windows\u306bWSL2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001Docker Desktop \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3067\u3001WIndows\u3067Docker\u74b0\u5883\u3092\u624b\u306b\u5165\u308c\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-gomokulog wp-block-embed-gomokulog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Ln96lMxHPj\"><a href=\"https:\/\/gomokulog.gomocool.net\/?p=1050\">Windows\u3067Vagrant\u3082\u3001Docker\u3082\u52d5\u304f\uff01[WSL2]<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Windows\u3067Vagrant\u3082\u3001Docker\u3082\u52d5\u304f\uff01[WSL2]&#8221; &#8212; gomokulog\" src=\"https:\/\/gomokulog.gomocool.net\/?p=1050&#038;embed=true#?secret=KHvBxEzuLz#?secret=Ln96lMxHPj\" data-secret=\"Ln96lMxHPj\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u3067\u306f\u3001\u6b21\u306fGit\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30af\u30ed\u30fc\u30f3\u3057\u3066\u3001docker-compose up \u30b3\u30de\u30f3\u30c9\u3067Docker\u74b0\u5883\u3092\u7acb\u3061\u4e0a\u3052\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001\u30b5\u30f3\u30d7\u30eb\u306b\u4f7f\u7528\u3057\u3066\u3044\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u306f\u3001\u3082\u3068\u3082\u3068Vagrant\u3068Chef\u3067\u52d5\u304b\u3057\u3066\u3044\u305f\u3082\u306e\u3067\u3001Vagrant\u4e0a\u3067AmazonLinux2\u306eBox\u3092\u4f7f\u7528\u3057\u3066\u3044\u305f\u3002<\/p>\n\n\n\n<p>Docker\u3067\u306f\u3001AmazonLinux2\u30b3\u30f3\u30c6\u30ca\u3067Apache\u3068PHP8.1\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001MySQL\u30b3\u30f3\u30c6\u30ca\u3092\u540c\u6642\u306b\u7acb\u3061\u4e0a\u3052\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u52d5\u4f5c\u3059\u308b\u306e\u306fCakePHP4\u3067\u4f5c\u3063\u305f\u30b5\u30f3\u30d7\u30eb\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WSL\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bGit Clone<\/h2>\n\n\n\n<p>Windows\u306eWSL\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u304c\u79c1\u306e\u30b5\u30f3\u30d7\u30ebGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/gomokuro\/googlebookapi\">https:\/\/github.com\/gomokuro\/googlebookapi<\/a><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306bwsl\u3067\u4e57\u3063\u3051\u3066\u3044\u308bUbuntu\u306e\u81ea\u8eab\u306ehome\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u9069\u5f53\u306b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u3063\u3066\u305d\u3053\u306b\u30af\u30ed\u30fc\u30f3\u3092\u884c\u3046<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\\\\wsl.localhost\\Ubuntu\\home\\{username}\\work\\src\\projectname<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">docker-compose \u30b3\u30de\u30f3\u30c9\u3067\u7acb\u3061\u4e0a\u3052\u308b<\/h2>\n\n\n\n<p>Ubuntu\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u7acb\u3061\u4e0a\u3052\u3066\u3001\u843d\u3068\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\/work\/src\/projectname<\/code><\/pre>\n\n\n\n<p>\u79fb\u52d5\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3001docker-composer.yml \u304c\u3042\u308c\u3070\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u304f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up -d<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u304c\u7acb\u3061\u4e0a\u304c\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"839\" height=\"226\" src=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-5.png\" alt=\"\" class=\"wp-image-1160\" srcset=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-5.png 839w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-5-300x81.png 300w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-5-768x207.png 768w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-5-350x94.png 350w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u7acb\u3061\u4e0a\u3052\u305f\u30b3\u30f3\u30c6\u30ca\u3067composer install<\/h2>\n\n\n\n<p>DockerDesktop\u306e\u7acb\u3061\u4e0a\u3052\u305f\u30b3\u30f3\u30c6\u30ca\u306eTerminal\u3067\u5171\u6709\u3057\u3066\u3044\u308b\u30dc\u30ea\u30e5\u30fc\u30e0\u3078\u79fb\u52d5\u3002<br>(\u4ed6\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089 <code>docker exec<\/code> \u30b3\u30de\u30f3\u30c9\u306a\u3069\u3067\u7e4b\u3044\u3067\u3082\u3088\u3044)<\/p>\n\n\n\n<p>\u305d\u306e\u5f8c\u3001<code>composer instal<\/code>l \u3092\u5b9f\u884c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"423\" height=\"297\" src=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-2.png\" alt=\"\" class=\"wp-image-1156\" srcset=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-2.png 423w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-2-300x211.png 300w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-2-350x246.png 350w\" sizes=\"auto, (max-width: 423px) 100vw, 423px\" \/><\/a><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/html\ncomposer install<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7acb\u3061\u4e0a\u3052\u305f\u30b3\u30f3\u30c6\u30ca\u3067Migration<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sh-4.2# php bin\/cake.php migrations migrate<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d6\u30e9\u30a6\u30b6\u3067\u3001localhost:8080 \u3078\u63a5\u7d9a<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"508\" height=\"432\" src=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-4.png\" alt=\"\" class=\"wp-image-1159\" srcset=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-4.png 508w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-4-300x255.png 300w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-4-350x298.png 350w\" sizes=\"auto, (max-width: 508px) 100vw, 508px\" \/><\/a><\/figure>\n\n\n\n<p>\u3053\u308c\u3067\u3001\u52d5\u4f5c\u3059\u308b\u306f\u305a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7de8\u96c6\u3057\u3066\u307f\u308b<\/h2>\n\n\n\n<p>templates\\Index\\index.php \u3092\u9069\u5f53\u306aWindows\u5074\u306e\u30a8\u30c7\u30a3\u30bf\u3067\u958b\u3044\u3066\u3001Search\u3068\u66f8\u3044\u305f\u90e8\u5206\u3092\u691c\u7d22\u3068\u66f8\u304d\u63db\u3048\u3066\u307f\u308b\u3002(\u4eca\u56de\u306fSakura Editor \u4f7f\u3063\u3066\u307e\u3059)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"303\" src=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-6.png\" alt=\"\" class=\"wp-image-1165\" srcset=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-6.png 673w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-6-300x135.png 300w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-6-350x158.png 350w\" sizes=\"auto, (max-width: 673px) 100vw, 673px\" \/><\/a><\/figure>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u3092\u30ea\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u5f53\u305f\u308a\u524d\u3060\u304c\u6587\u8a00\u304c\u5909\u308f\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"141\" src=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-7.png\" alt=\"\" class=\"wp-image-1166\" srcset=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-7.png 406w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-7-300x104.png 300w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-7-350x122.png 350w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">ubutun\u30bf\u30fc\u30df\u30ca\u30eb\u3067app.php\u306e\u6a29\u9650\u3092777\u306b\u5909\u66f4<\/h2>\n\n\n\n<p>\u3067\u306f\u3001\u6b21\u306b\u3001app_local.php\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>debug\u30e2\u30fc\u30c9\u3092false\u306b\u3057\u3066\u4fdd\u5b58\u3092\u8a66\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"81\" src=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-8.png\" alt=\"\" class=\"wp-image-1167\" srcset=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-8.png 541w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-8-300x45.png 300w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-8-350x52.png 350w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/a><\/figure>\n\n\n\n<p>\u6050\u3089\u304f\u4fdd\u5b58\u3067\u304d\u306a\u3044\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u306f\u3001Docker\u306e\u30b3\u30f3\u30c6\u30ca\u5074\u3067\u518d\u751f\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306froot\u6a29\u9650\u3067\u4f5c\u6210\u3055\u308c\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>app_local.php\u306f\u30b3\u30f3\u30c6\u30ca\u5185\u306ecomposer install \u3067\u4f5c\u6210\u3055\u308c\u305f\u306e\u3067\u3001\u6a29\u9650\u304croot\u306b\u306a\u3063\u3066\u304a\u308a\u3001Windows\u5074\u3067\u5909\u66f4\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001root\u3067\u306a\u304fWSL\u306bUbuntu\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30e6\u30fc\u30b6\u30fc\u3067\u64cd\u4f5c\u3059\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u65b9\u6cd5\u306f\u3044\u304f\u3064\u304b\u3042\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u3053\u308c\u3068\u3044\u3063\u305f\u6c7a\u3081\u624b\u306f\u306a\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u79c1\u306f\u3001777\u306b\u3059\u308b\u3053\u3068\u3067\u5909\u66f4\u53ef\u80fd\u306b\u3057\u3066\u304a\u308a\u307e\u3059\u3002\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u4e0a\u306e\u958b\u767a\u74b0\u5883\u306a\u306e\u3067\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-9.png\"><img loading=\"lazy\" decoding=\"async\" width=\"662\" height=\"73\" src=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-9.png\" alt=\"\" class=\"wp-image-1168\" srcset=\"https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-9.png 662w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-9-300x33.png 300w, https:\/\/gomokulog.gomocool.net\/wp-content\/uploads\/2023\/09\/image-9-350x39.png 350w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><\/a><\/figure>\n\n\n\n<p>composer \u7ba1\u7406\u306evendor\u306a\u3069\u306f\u3059\u3079\u3066root\u306b\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u304c\u3001\u305d\u3082\u305d\u3082Windows\u5074\u304b\u3089\u89e6\u308b\u90e8\u5206\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u3088\u307b\u3069\u3058\u3083\u306a\u3044\u9650\u308a\u89e6\u308b\u3053\u3068\u3082\u306a\u3044\u306e\u3067\u3001\u4eca\u306e\u3068\u3053\u308d\u554f\u984c\u306a\u3044\u3067\u3059\u304c\u3001\u4eca\u5f8cbake\u30b3\u30de\u30f3\u30c9\u6253\u3064\u305f\u3073\u306b\u6a29\u9650\u5468\u308a\u3092\u4fee\u6b63\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u70b9\u306f\u8981\u691c\u8a0e\u8ab2\u984c\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows\u306bWSL2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001Docker Desktop \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3067\u3001WIndows\u3067Docker\u74b0\u5883\u3092\u624b\u306b\u5165\u308c\u305f\u3002 \u3067\u306f\u3001\u6b21\u306fGit\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30af\u30ed\u30fc\u30f3\u3057\u3066\u3001docker-com&hellip;  <a href=\"https:\/\/gomokulog.gomocool.net\/?p=1147\" class=\"more-link\">more <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[21,79,80],"class_list":["post-1147","post","type-post","status-publish","format-standard","hentry","category-69","tag-cakephp","tag-docker","tag-wsl"],"_links":{"self":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/1147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1147"}],"version-history":[{"count":12,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/1147\/revisions"}],"predecessor-version":[{"id":1169,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=\/wp\/v2\/posts\/1147\/revisions\/1169"}],"wp:attachment":[{"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gomokulog.gomocool.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}