{"id":97,"date":"2022-01-28T21:48:58","date_gmt":"2022-01-28T14:48:58","guid":{"rendered":"http:\/\/warawich.com\/?p=97"},"modified":"2022-01-28T21:51:49","modified_gmt":"2022-01-28T14:51:49","slug":"google-cloud-registry-too-long-not-read","status":"publish","type":"post","link":"https:\/\/warawich.com\/index.php\/2022\/01\/28\/google-cloud-registry-too-long-not-read\/","title":{"rendered":"Google Cloud Registry  too long not read"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">1. Install Google SDK on your computer Ref. https:\/\/cloud.google.com\/sdk\/docs\/install<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Login google account and gcloud project with command below<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gcloud auth login\u2028\ngcloud auth configure-docker<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Incase , you use docker-compose file or use CI\/CD pipeline , we recommend use  service account with json key file to authen with google cloud<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Create service account with <strong>google cloud storage role (read, write,admin)<\/strong><br>Example login with JSON key<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cat keyfile.json | docker login -u _json_key --password-stdin https:\/\/HOSTNAME\nwhere\u00a0HOSTNAME\u00a0is\u00a0gcr.io,\u00a0us.gcr.io,\u00a0eu.gcr.io, or\u00a0asia.gcr.io.\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">cat box-in-the-box-7ab21e41seb57.json|  docker login -u _json_key --password-stdin https:\/\/asia.gcr.io<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Build image by use image path details as below<br><br>[HOSTNAME]\/[PROJECT-ID]\/[IMAGE]<br><br>Example <br><a href=\"http:\/\/asia.gcr.io\/kpat-in-the-box\/kpat-core-social\">asia.gcr.io\/box-in-the-box\/core-social<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Docker build , tag, push , pull<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker build -t asia.gcr.io\/box-in-the-box\/social:latest .\ndocker push asia.gcr.io\/box-in-the-box\/social:latest \ndocker pull asia.gcr.io\/box-in-the-box\/social:latest \n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5. Docker Compose example <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">version: '3'\n\nservices:\n  box_core-social:\n    container_name: social\n    environment:\n      - \"NODE_ENV=${NODE_ENV}\"\n    #build:\n    #  context: .\n    #  dockerfile: Dockerfile-live\n    image: asia.gcr.io\/box-in-the-box\/social\n    ports:\n      - \"2000:3000\"\n    volumes:\n      - \"\/opt\/app\/\"\n    restart: on-failure:5<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. Install Google SDK on your computer Ref. https:\/\/cloud.google.com\/sdk\/docs\/install 2. Login google account and gcloud project with command below gcloud auth login\u2028 gcloud auth configure-docker Incase , you use docker-compose file or use CI\/CD pipeline , we recommend use service account with json key file to authen with google cloud Create service account with google &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/warawich.com\/index.php\/2022\/01\/28\/google-cloud-registry-too-long-not-read\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Google Cloud Registry  too long not read&#8221;<\/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":[1],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/comments?post=97"}],"version-history":[{"count":2,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":100,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/posts\/97\/revisions\/100"}],"wp:attachment":[{"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/media?parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/categories?post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/warawich.com\/index.php\/wp-json\/wp\/v2\/tags?post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}