{"id":2903,"date":"2024-12-07T08:43:07","date_gmt":"2024-12-06T23:43:07","guid":{"rendered":"https:\/\/www.agile-software.site\/?p=2903"},"modified":"2024-12-07T08:43:08","modified_gmt":"2024-12-06T23:43:08","slug":"2903","status":"publish","type":"post","link":"https:\/\/agile-software.net\/?p=2903","title":{"rendered":""},"content":{"rendered":"\n<p><strong>1. Docker\u30a4\u30e1\u30fc\u30b8\u304c\u6b63\u3057\u304f\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<p>\u307e\u305a\u3001\u30ed\u30fc\u30ab\u30eb\u3067Docker\u30a4\u30e1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>docker build -t gcr.io\/roadtoentrepreneur\/morning-slack-up .\n<\/code><\/pre><\/div>\n\n\n\n<p>\u2022 -t: \u30a4\u30e1\u30fc\u30b8\u30bf\u30b0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u2022 .: Dockerfile\u304c\u5b58\u5728\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002<\/p>\n\n\n\n<p><strong>\u30a4\u30e1\u30fc\u30b8\u304c\u30ed\u30fc\u30ab\u30eb\u306b\u5b58\u5728\u3059\u308b\u304b\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<p>\u30d3\u30eb\u30c9\u3057\u305fDocker\u30a4\u30e1\u30fc\u30b8\u304c\u30ed\u30fc\u30ab\u30eb\u306b\u5b58\u5728\u3059\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>docker images<\/code><\/pre><\/div>\n\n\n\n<p><br>\u51fa\u529b\u4f8b:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>REPOSITORY                               TAG        IMAGE ID       CREATED          SIZE\ngcr.io\/roadtoentrepreneur\/morning-slack-up   latest     abcdef123456   5 minutes ago   120MB<\/code><\/pre><\/div>\n\n\n\n<p><br>gcr.io\/roadtoentrepreneur\/morning-slack-up\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070\u30d3\u30eb\u30c9\u6210\u529f\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>2. Docker\u30a4\u30e1\u30fc\u30b8\u3092Google Container Registry\u306b\u30d7\u30c3\u30b7\u30e5<\/strong><\/p>\n\n\n\n<p>\u6b21\u306b\u3001\u30a4\u30e1\u30fc\u30b8\u3092Google Container Registry (GCR) \u306b\u30d7\u30c3\u30b7\u30e5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>Docker\u3068GCR\u306e\u8a8d\u8a3c<\/strong><\/p>\n\n\n\n<p>GCR\u306b\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u306b\u306f\u8a8d\u8a3c\u304c\u5fc5\u8981\u3067\u3059\u3002\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>gcloud auth configure-docker<\/code><\/pre><\/div>\n\n\n\n<p><strong>Docker\u30a4\u30e1\u30fc\u30b8\u3092\u30d7\u30c3\u30b7\u30e5<\/strong><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067Docker\u30a4\u30e1\u30fc\u30b8\u3092GCR\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>docker push gcr.io\/roadtoentrepreneur\/morning-slack-up<\/code><\/pre><\/div>\n\n\n\n<p><strong>3. GCR\u306b\u30a4\u30e1\u30fc\u30b8\u304c\u5b58\u5728\u3059\u308b\u304b\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<p>\u30d7\u30c3\u30b7\u30e5\u5f8c\u3001\u30a4\u30e1\u30fc\u30b8\u304cGCR\u306b\u5b58\u5728\u3059\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>gcloud container images list --repository=gcr.io\/roadtoentrepreneur<\/code><\/pre><\/div>\n\n\n\n<p><br>\u51fa\u529b\u4f8b:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>NAME                                           DIGEST        TAGS           TIMESTAMP\ngcr.io\/roadtoentrepreneur\/morning-slack-up    sha256:abc123  latest         2024-12-05T12:34:56<\/code><\/pre><\/div>\n\n\n\n<p><br>gcr.io\/roadtoentrepreneur\/morning-slack-up \u304c\u30ea\u30b9\u30c8\u306b\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u518d\u5ea6\u30d7\u30c3\u30b7\u30e5\u3092\u8a66\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong>4. Cloud Run\u306b\u518d\u30c7\u30d7\u30ed\u30a4<\/strong><\/p>\n\n\n\n<p>\u30a4\u30e1\u30fc\u30b8\u304cGCR\u306b\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u5f8c\u3001Cloud Run\u306b\u518d\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>gcloud run deploy morning-slack-up \\\n  --image gcr.io\/roadtoentrepreneur\/morning-slack-up \\\n  --region asia-northeast1 \\\n  --platform managed \\\n  --allow-unauthenticated<\/code><\/pre><\/div>\n\n\n\n<p><strong>5. \u30a8\u30e9\u30fc\u304c\u89e3\u6d88\u3057\u306a\u3044\u5834\u5408\u306e\u8ffd\u52a0\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<p><strong>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u8a2d\u5b9a\u3092\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<p>Google Cloud\u30d7\u30ed\u30b8\u30a7\u30af\u30c8ID\u304c\u6b63\u3057\u3044\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>gcloud config get-value project<\/code><\/pre><\/div>\n\n\n\n<p><br>\u6b63\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8ID\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>gcloud config set project roadtoentrepreneur<\/code><\/pre><\/div>\n\n\n\n<p><strong>API\u306e\u6709\u52b9\u5316\u3092\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<p>Cloud Run\u3068Container Registry\u306eAPI\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>gcloud services enable run.googleapis.com containerregistry.googleapis.com<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Docker\u30a4\u30e1\u30fc\u30b8\u304c\u6b63\u3057\u304f\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d \u307e\u305a\u3001\u30ed\u30fc\u30ab\u30eb\u3067Docker\u30a4\u30e1\u30fc\u30b8\u3092\u30d3\u30eb\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 \u2022 -t: \u30a4\u30e1\u30fc\u30b8\u30bf\u30b0\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002 \u2022 .: Dockerfile\u304c\u5b58\u5728\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002 <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jin_ogp_image_url":"","_jin_last_featured_id":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2903","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2903"}],"version-history":[{"count":1,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2903\/revisions"}],"predecessor-version":[{"id":2905,"href":"https:\/\/agile-software.net\/index.php?rest_route=\/wp\/v2\/posts\/2903\/revisions\/2905"}],"wp:attachment":[{"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agile-software.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}