<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Google Container Registry &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/google-container-registry/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 04:04:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>Google Container Registry &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>GCP + Container Registry: Pushing/Pulling Images</title>
		<link>https://myshittycode.com/2021/05/28/gcp-container-registry-pushing-pulling-images/</link>
					<comments>https://myshittycode.com/2021/05/28/gcp-container-registry-pushing-pulling-images/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Fri, 28 May 2021 18:58:35 +0000</pubDate>
				<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Google Cloud CLI]]></category>
		<category><![CDATA[Google Cloud Platform]]></category>
		<category><![CDATA[Google Container Registry]]></category>
		<guid isPermaLink="false">https://myshittycode.com/?p=1239</guid>

					<description><![CDATA[<p>PROBLEM You want to push a new image to Google Container Registry (GCR) or pull an existing image from GCR. SOLUTION Pushing a New Image to GCR Prepare your Dockerfile. Create an image and tag it with a path pointing to GCR within a project. There are several variations of GCR&#8217;s hostname (ex: gcr.io, us.gcr.io, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2021/05/28/gcp-container-registry-pushing-pulling-images/">GCP + Container Registry: Pushing/Pulling Images</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">PROBLEM</h2>



<p>You want to push a new image to Google Container Registry (GCR) or pull an existing image from GCR.</p>



<h2 class="wp-block-heading">SOLUTION</h2>



<h3 class="wp-block-heading">Pushing a New Image to GCR</h3>



<p>Prepare your Dockerfile.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
FROM alpine:3.7

# some content...
</pre></div>


<p>Create an image and tag it with a path pointing to GCR within a project. </p>



<p>There are several variations of GCR&#8217;s hostname (ex: <strong>gcr.io</strong>, <strong>us.gcr.io</strong>, <strong>eu.gcr.io</strong>, etc) depending on the data center&#8217;s location. </p>



<p>The GCR path has the following format: <strong>[HOSTNAME]/[PROJECT-ID]/[IMAGE]</strong>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
docker build -t gcr.io/shitty-project/shitty-repo .
</pre></div>


<p>Log into GCP.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
gcloud auth login
</pre></div>


<p>Register <strong>gcloud</strong> as a Docker credential helper.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
gcloud auth configure-docker
</pre></div>


<p>Push the image to GCR.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
docker push gcr.io/shitty-project/shitty-repo
</pre></div>


<p>View pushed image.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
gcloud container images list-tags gcr.io/shitty-project/shitty-repo

DIGEST        TAGS    TIMESTAMP
78b36c0b456d  latest  2019-03-07T16:19:53
</pre></div>


<p>The repository and image can also be viewed in GCP Console.</p>



<figure class="wp-block-image size-large"><a href="https://myshittycode.com/wp-content/uploads/2021/05/gcr-1.png?x45560"><img fetchpriority="high" decoding="async" width="1874" height="586" src="https://myshittycode.com/wp-content/uploads/2021/05/gcr-1.png?x45560" alt="" class="wp-image-1248" srcset="https://myshittycode.com/wp-content/uploads/2021/05/gcr-1.png 1874w, https://myshittycode.com/wp-content/uploads/2021/05/gcr-1-300x94.png 300w, https://myshittycode.com/wp-content/uploads/2021/05/gcr-1-1024x320.png 1024w, https://myshittycode.com/wp-content/uploads/2021/05/gcr-1-768x240.png 768w, https://myshittycode.com/wp-content/uploads/2021/05/gcr-1-1536x480.png 1536w" sizes="(max-width: 1874px) 100vw, 1874px" /></a><figcaption class="wp-element-caption">Image in GCR</figcaption></figure>



<h3 class="wp-block-heading">Pulling an Existing Image from GCR</h3>



<p>Proceed with the authentication process if it is not done already.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
gcloud auth login
gcloud auth configure-docker
</pre></div>


<p>Pull the image from GCR.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
docker pull gcr.io/shitty-project/shitty-repo
</pre></div><p>The post <a rel="nofollow" href="https://myshittycode.com/2021/05/28/gcp-container-registry-pushing-pulling-images/">GCP + Container Registry: Pushing/Pulling Images</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2021/05/28/gcp-container-registry-pushing-pulling-images/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1239</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching using Disk

Served from: myshittycode.com @ 2026-02-21 09:10:30 by W3 Total Cache
-->