{"id":10626,"date":"2017-06-05T10:15:25","date_gmt":"2017-06-05T01:15:25","guid":{"rendered":"http:\/\/sitest.jp\/blog\/?p=10626"},"modified":"2017-06-05T10:10:34","modified_gmt":"2017-06-05T01:10:34","slug":"%e3%83%ad%e3%82%b0%e7%ae%a1%e7%90%86%e3%81%ab%e6%9c%80%e9%81%a9%ef%bc%81google-cloud-platform-%e3%81%a7-docker-%e3%81%ae%e3%83%ad%e3%82%b0%e3%82%92%e7%ae%a1%e7%90%86%e3%81%97%e3%82%88%e3%81%86","status":"publish","type":"post","link":"https:\/\/sitest.jp\/blog\/?p=10626","title":{"rendered":"\u30ed\u30b0\u7ba1\u7406\u306b\u6700\u9069\uff01Google Cloud Platform \u3067 Docker \u306e\u30ed\u30b0\u3092\u7ba1\u7406\u3057\u3088\u3046"},"content":{"rendered":"<p>\u7686\u3055\u3093\u306f\u3069\u306e\u3088\u3046\u306b\u30ed\u30b0\u7ba1\u7406\u3092\u3055\u308c\u3066\u3044\u307e\u3059\u304b\uff1f<\/p>\n<p>\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u529b\u3001\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3057\u3066\u4e00\u5b9a\u671f\u9593\u7d4c\u904e\u3067\u30a2\u30fc\u30ab\u30a4\u30d6\u3084\u524a\u9664\u306a\u3069\u3001<br \/>\n\u601d\u3063\u3066\u3044\u308b\u4ee5\u4e0a\u306b\u3084\u308b\u3079\u304d\u3053\u3068\u306f\u591a\u3044\u3067\u3059\u3088\u306d\u3002<br \/>\n\u7279\u306b\u305d\u308c\u304c Docker \u306e\u30ed\u30b0\u3068\u306a\u308b\u3068\u306a\u304a\u3055\u3089\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fGoogle Cloud Platform (\u4ee5\u4e0b GCP \uff09\u3067<br \/>\nDocker \u306e\u30ed\u30b0\u3092\u7ba1\u7406\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n<p><!--more--><\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">Stackdriver Logging \u3068\u306f\uff1f<\/h3>\n<\/div>\n<p><a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/05\/Stackdriver_Logging_-_Google_Cloud_Platform_-_-_Google_Cloud_Platform.png\"><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/05\/Stackdriver_Logging_-_Google_Cloud_Platform_-_-_Google_Cloud_Platform.png\" alt=\"\" width=\"1290\" height=\"622\" class=\"alignnone size-full wp-image-10704\" \/><\/a><br \/>\nGCP \u3067\u306f <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/cloud.google.com\/logging\/\">Stackdriver Logging [beta]<\/a> \u3068\u3044\u3046\u30b5\u30fc\u30d3\u30b9\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\nStackdriver \u3068\u306f\u3001GCP \u3068\u30b7\u30fc\u30e0\u30ec\u30b9\u306b\u7d71\u5408\u3057\u305f\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u3067\u3059\u3002<br \/>\n\u305d\u306e\u4e2d\u3072\u3068\u3064\u3067\u3042\u308b Logging \u306f\u5f37\u529b\u306a\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30ed\u30b0\u5206\u6790\u6a5f\u80fd\u3092\u5099\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001Docker \u306e\u30ed\u30b0\u3092 Stackdriver Logging \u306b\u5bfe\u3057\u3066<br \/>\n\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\nDocker \u305d\u306e\u3082\u306e\u306b\u3064\u3044\u3066\u306f\u904e\u53bb\u8a18\u4e8b\u306e\u300c<a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/sitest.jp\/blog\/?p=8823\">1\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u3063\u305f\u3002Docker\u3067\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u65b9\u6cd5<\/a>\u300d\u306b\u8a73\u3057\u304f\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u3053\u306e\u8a18\u4e8b\u3092\u3054\u4e00\u8aad\u4e0b\u3055\u3044\u3002<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">Docker \u306e\u30ed\u30b0\u51fa\u529b\u5148\u3092\u5909\u66f4\u3057\u3088\u3046<\/h3>\n<\/div>\n<p>Docker \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u8a2d\u5b9a\u3067\u306f\u3001\u30b3\u30f3\u30c6\u30ca\u5185\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u6a19\u6e96\u51fa\u529b\u3057\u305f\u30ed\u30b0\u306f\u30b3\u30f3\u30c6\u30ca\u3092\u524a\u9664\u3057\u3066\u3057\u307e\u3046\u3068\u540c\u6642\u306b\u524a\u9664\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001\u306a\u306b\u304b\u3057\u3089\u306e\u65b9\u6cd5\u3067\u5916\u90e8\u306b\u30ed\u30b0\u3092\u4fdd\u5b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>Docker \u3067\u306f\u3001\u30ed\u30b0\u306e\u51fa\u529b\u65b9\u5f0f\u3092\u5909\u66f4\u3067\u304d\u308b <a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/docs.docker.com\/engine\/admin\/logging\/overview\/\">log-driver<\/a> \u3068\u3044\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<style>\ntable.log-driver {\n  margin: 10px 0;\n}\ntable.log-driver > thead {\n  background-color: #e0f2f1;\n}\ntable.log-driver th, td {\n  padding: 10px;\n  border: 2px solid #e0f2f1;\n  vertical-align: middle;\n}\ntable.log-driver td:first-child {\n  text-align: center;\n}\n<\/style>\n<table class=\"log-driver\">\n<thead>\n<tr>\n<th>Log Driver<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>none<\/td>\n<td><code>docker logs<\/code> \u306b\u4f55\u3082\u51fa\u529b\u3055\u308c\u307e\u305b\u3093<\/td>\n<\/tr>\n<tr>\n<td>json-file<\/td>\n<td>JSON\u5f62\u5f0f\u306e\u30ed\u30b0\u3092\u51fa\u529b\u3057\u307e\u3059<br \/>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30ed\u30b0\u30c9\u30e9\u30a4\u30d0\u3067\u3059<\/td>\n<\/tr>\n<tr>\n<td>journald<\/td>\n<td>journald \u306b\u5bfe\u3057\u3066\u30ed\u30b0\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059<\/td>\n<\/tr>\n<tr>\n<td>fluentd<\/td>\n<td>fluentd \u306b\u5bfe\u3057\u3066\u30ed\u30b0\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059<\/td>\n<\/tr>\n<tr>\n<td>awslogs<\/td>\n<td>AWS Cloud Watch \u306b\u5bfe\u3057\u3066\u30ed\u30b0\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059<\/td>\n<\/tr>\n<tr>\n<td>gcplogs<\/td>\n<td>GCP \u306b\u5bfe\u3057\u3066\u30ed\u30b0\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>GCP \u3078\u306e\u51fa\u529b\u306f <code>--log-driver=gcplogs<\/code> \u3092\u30b3\u30f3\u30c6\u30ca\u7acb\u3061\u4e0a\u3052\u6642\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001<br \/>\nStackdriver Logging \u306b\u30ed\u30b0\u66f8\u304d\u8fbc\u307f\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001GCP \u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u30b3\u30f3\u30c6\u30ca\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3068\u3001<br \/>\n\u81ea\u52d5\u7684\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u60c5\u5831\u306a\u3069\u3092\u5224\u5225\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u30ed\u30b0\u30c9\u30e9\u30a4\u30d0\u3092\u5909\u66f4\u3057\u3066 nginx \u30b3\u30f3\u30c6\u30ca\u3092\u7acb\u3066\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>docker run --name nginx -p 80:80 --log-driver=gcplogs -it -d nginx\n<\/code><\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067 nginx \u304b\u3089\u51fa\u529b\u3055\u308c\u308b\u30ed\u30b0\u306f GCP \u306b\u66f8\u304d\u8fbc\u307e\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f GCP \u306e\u7ba1\u7406\u753b\u9762\u304b\u3089\u51fa\u529b\u3055\u308c\u305f\u30ed\u30b0\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n<a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/05\/7c3cdf866d6eeaafd41b3d8dbfbf3067.png\"><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/05\/7c3cdf866d6eeaafd41b3d8dbfbf3067.png\" alt=\"\" width=\"1184\" height=\"712\" class=\"alignnone size-full wp-image-10705\" \/><\/a><br \/>\n\u30ed\u30b0\u306f1\u884c\u305a\u3064 JSON \u5f62\u5f0f\u3067\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n<code>jsonPayload.data<\/code> \u306b\u51fa\u529b\u3055\u308c\u305f\u30ed\u30b0\u304c\u5165\u3063\u3066\u304a\u308a\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u60c5\u5831\u3084\u3069\u306e\u30ea\u30fc\u30b8\u30e7\u30f3\u3001<br \/>\n\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u304b\u3068\u3044\u3046\u60c5\u5831\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001<a target=\"_blank\" rel=\"nofollow\" href=\"https:\/\/cloud.google.com\/logging\/docs\/view\/advanced_filters?hl=ja&#038;_ga=1.219580954.2048237055.1495776868\">\u9ad8\u5ea6\u306a\u30ed\u30b0\u30d5\u30a3\u30eb\u30bf<\/a>\u3092\u99c6\u4f7f\u3059\u308b\u3053\u3068\u3067\u3001<br \/>\n\u7279\u5b9a\u306e\u30ed\u30b0\u3060\u3051\u3092\u7c21\u5358\u306b\u62bd\u51fa\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">Cloud Storage \u306b\u30ed\u30b0\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u3088\u3046<\/h3>\n<\/div>\n<p>Stackdriver Logging \u306b\u306f\u30ed\u30b0\u30927\u65e5\u5206\u307e\u3067\u3057\u304b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001Cloud Storage \u3084 BigQuery \u306a\u3069\u306e\u30b5\u30fc\u30d3\u30b9\u306b<br \/>\n\u30ed\u30b0\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u304c\u3067\u304d\u308b\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a target=\"_blank\" href=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/05\/4153c361f064924a40e4f78414740e8f.png\"><img loading=\"lazy\" src=\"https:\/\/storage.googleapis.com\/sitest-wp\/blog\/wp-content\/uploads\/2017\/05\/4153c361f064924a40e4f78414740e8f.png\" alt=\"\" width=\"1358\" height=\"665\" class=\"alignnone size-full wp-image-10709\" \/><\/a><br \/>\n\u30d5\u30a3\u30eb\u30bf\u6761\u4ef6\u3082\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u305f\u3081\u3001<br \/>\n\u7279\u5b9a\u306e\u30ed\u30b0\u3060\u3051\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3068\u3044\u3046\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>Cloud Storage \u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u8a2d\u5b9a\u3092\u3057\u305f\u5834\u5408\u306f1\u65e51\u56de\u3001<br \/>\n1\u6642\u9593\u5358\u4f4d\u3067\u81ea\u52d5\u7684\u306b\u30ed\u30fc\u30c6\u30fc\u30c8\u3057\u305f JSON \u30d5\u30a1\u30a4\u30eb\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>Cloud Storage \u306e\u30b9\u30c8\u30ec\u30fc\u30b8\u30af\u30e9\u30b9\u3092 Nearline \u3084 Coldline \u306b\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u30b3\u30b9\u30c8\u3092\u5927\u5e45\u524a\u6e1b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u4fdd\u5b58\u76ee\u7684\u3067\u307b\u3068\u3093\u3069\u30ed\u30b0\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3057\u306a\u3044\u5834\u5408\u306f\u3068\u3066\u3082\u304a\u3059\u3059\u3081\u3067\u3059\uff01<br \/>\n\u307e\u305f\u3001REST API \u3082\u3057\u304f\u306f <code>gsutil<\/code> \u30b3\u30de\u30f3\u30c9\u304b\u3089\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u4e00\u5b9a\u671f\u9593\u7d4c\u904e\u3067\u524a\u9664\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u9577\u671f\u4fdd\u5b58\u3055\u308c\u308b\u5834\u5408\u306f\u5fc5\u305a\u8a2d\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\u307e\u3068\u3081<\/h3>\n<\/div>\n<p>\u4eca\u56de\u306f GCP \u3067\u306e Docker \u30ed\u30b0\u7ba1\u7406\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br \/>\n\u30ed\u30b0\u306e\u4fdd\u5b58\u5148\u306b\u306f Cloud Storage \u3092\u9078\u629e\u3057\u307e\u3057\u305f\u304c\u3001<br \/>\n\u3057\u3063\u304b\u308a\u3068\u3057\u305f\u5206\u6790\u3092\u884c\u3046\u306e\u3067\u3042\u308c\u3070 BigQuery \u306b\u4fdd\u5b58\u3057\u305f\u65b9\u304c<br \/>\n\u5206\u6790\u3092\u3057\u3084\u3059\u304f\u306a\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>GCP \u306b\u306f\u4ed6\u306b\u3082\u6ca2\u5c71\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u63d0\u4f9b\u3057\u3066\u304a\u308a\u3001\u300c<a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/sitest.jp\/blog\/?p=5947\">Google\u306eCloud Vision API\u3092\u4f7f\u3063\u3066\u753b\u50cf\u5206\u6790\u3092\u3057\u3066\u307f\u3088\u3046\uff01<\/a>\u300d\u3084\u300c<a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/sitest.jp\/blog\/?p=5407\">Google Cloud Natural Language API\u3067\u81ea\u7136\u8a00\u8a9e\u89e3\u6790\u5165\u9580<\/a>\u300d\u306e\u8a18\u4e8b\u3067\u3082\u3054\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3054\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u305c\u3072\u3053\u3061\u3089\u3082\u3054\u89a7\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7686\u3055\u3093\u306f\u3069\u306e\u3088\u3046\u306b\u30ed\u30b0\u7ba1\u7406\u3092\u3055\u308c\u3066\u3044\u307e\u3059\u304b\uff1f \u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u51fa\u529b\u3001\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3057\u3066\u4e00\u5b9a\u671f\u9593\u7d4c\u904e\u3067\u30a2\u30fc\u30ab\u30a4\u30d6\u3084\u524a\u9664\u306a\u3069\u3001 \u601d\u3063\u3066\u3044\u308b\u4ee5\u4e0a\u306b\u3084\u308b\u3079\u304d\u3053\u3068\u306f\u591a\u3044\u3067\u3059\u3088\u306d\u3002 \u7279\u306b\u305d\u308c\u304c Docker \u306e\u30ed\u30b0\u3068\u306a\u308b\u3068\u306a\u304a\u3055\u3089\u3060\u3068\u601d\u3044\u307e\u3059\u3002 \u4eca\u56de\u306fGoogle Cloud Platform (\u4ee5\u4e0b GCP \uff09\u3067 Docker \u306e\u30ed\u30b0\u3092\u7ba1\u7406\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n","protected":false},"author":1,"featured_media":10814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27],"tags":[],"acf":false,"_links":{"self":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/10626"}],"collection":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/comments?post=10626"}],"version-history":[{"count":13,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/10626\/revisions"}],"predecessor-version":[{"id":10815,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/10626\/revisions\/10815"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media\/10814"}],"wp:attachment":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media?parent=10626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/categories?post=10626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/tags?post=10626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}