<commit_before>---
layout: post
title: Pushing to Google Container Registry from CircleCI
date: '2015-07-24 19:36'
categories:
   - cloud
   - containers
---

[CircleCI](https://circleci.com) is a great build tool with a lot of flexibility. They even have a good [tutorial on interacting with docker](https://circleci.com/docs/docker) with a [special section](https://circleci.com/docs/docker#google-compute-engine-and-kubernetes) referencing Google Compute Engine and Kubernetes. The only slight difference here is that I want to deploy directly to [Google's Container Registry](https://cloud.google.com/container-registry/) (GCR) rather than deploy my own registry, which is slightly more involved. So, let's get started.

Our starting point is [circleci/docker-hello-google](https://github.com/circleci/docker-hello-google), then a little help from this fork [bellkev/docker-hello-google](https://github.com/bellkev/docker-hello-google). These repos handle a lot of the other aspects of building a docker image, running, and testing it.

From the command line, it is really easy to [push docker images to the GCR](https://cloud.google.com/container-registry/#pushing_to_the_registry).

For example:

```sh<commit_msg>Added update on gcloud and CircleCI.<commit_after>---
layout: post
title: Pushing to Google Container Registry from CircleCI
date: '2015-07-24 19:36'
categories:
   - cloud
   - containers
---

<div class="alert alert-success" role="alert">
   <strong>Update: March 30, 2016</strong>

   <p>CircleCI has been adding some baked in support for Google Cloud, negating much of this blog post.</p>

   <p>Please check out the links below:</p>

   <ul>
      <li>
         The `gcloud` tool is now <a href="https://circleci.com/docs/environment">included in each CircleCI instance</a> No more manual installation!
      </li>
      <li>
         They have some more <a href="https://circleci.com/docs/google-auth">complete docs on gcloud authentication</a>
      </li>
      <li>
         They have other docs on using GCP too, so <a href="https://circleci.com/docs/search">search for gcloud</a> to find them.
      </li>
   </ul>
</div>

[CircleCI](https://circleci.com) is a great build tool with a lot of flexibility. They even have a good [tutorial on interacting with docker](https://circleci.com/docs/docker) with a [special section](https://circleci.com/docs/docker#google-compute-engine-and-kubernetes) referencing Google Compute Engine and Kubernetes. The only slight difference here is that I want to deploy directly to [Google's Container Registry](https://cloud.google.com/container-registry/) (GCR) rather than deploy my own registry, which is slightly more involved. So, let's get started.

Our starting point is [circleci/docker-hello-google](https://github.com/circleci/docker-hello-google), then a little help from this fork [bellkev/docker-hello-google](https://github.com/bellkev/docker-hello-google). These repos handle a lot of the other aspects of building a docker image, running, and testing it.

From the command line, it is really easy to [push docker images to the GCR](https://cloud.google.com/container-registry/#pushing_to_the_registry).

For example:

```sh
{'fraction_non_alphanumeric': 0.11211742660836976, 'fraction_numerical': 0.009369144284821987, 'mean_word_length': 4.166129032258064, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 17, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6036867', 'n_tokens_mistral': 957, 'n_tokens_neox': 885, 'n_words': 343}