<p>How do I run a docker image that I built locally on <a href="https://cloud.google.com/container-engine/">Google Container Engine</a>?</p>

<p>You can push your image to <a href="https://cloud.google.com/tools/container-registry/" rel="noreferrer">Google Container Registry</a> and reference them from your pod manifest.</p>

<h2>Detailed instructions</h2>

<p>Assuming you have a <code>DOCKER_HOST</code> properly setup , a GKE cluster running the last version of Kubernetes and <a href="https://cloud.google.com/sdk/" rel="noreferrer">Google Cloud SDK</a> installed.</p>

<ol>
<li><p>Setup some environment variables</p>

<pre><code>gcloud components update kubectl
gcloud config set project &lt;your-project&gt;
gcloud config set compute/zone &lt;your-cluster-zone&gt;
gcloud config set container/cluster &lt;your-cluster-name&gt;
gcloud container clusters get-credentials &lt;your-cluster-name&gt;
</code></pre></li>
<li><p>Tag your image</p>

<pre><code>docker tag &lt;your-image&gt; gcr.io/&lt;your-project&gt;/&lt;your-image&gt;
</code></pre></li>
<li><p>Push your image</p>

<pre><code>gcloud docker push gcr.io/&lt;your-project&gt;/&lt;your-image&gt;
</code></pre></li>
<li><p>Create a pod manifest for your container: <code>my-pod.yaml</code></p>

<pre><code>id: my-pod
kind: Pod
apiVersion: v1
desiredState:
  manifest:
    containers:
    - name: &lt;container-name&gt;
      image: gcr.io/&lt;your-project&gt;/&lt;your-image&gt;
    ...
</code></pre></li>
<li><p>Schedule this pod</p>

<pre><code>kubectl create -f my-pod.yaml
</code></pre></li>
<li><p>Repeat from step (4) for each pod you want to run. You can have multiple definitions in a single file using a line with <code>---</code> as delimiter.</p></li>
</ol>
