<p>I want to deploy a simply docker container to my Kubernetes cluster. I'm on Docker for Mac (Edge mode since that's what supports Kubernetes), and I don't know how to push my image to my Google Cloud Container Registry.</p>

<p>Following the docs, I run:</p>

<p><code>docker stack deploy --compose-file ./docker-compose.yml my-app</code></p>

<p>and I get this in return:</p>

<blockquote>
  <p>Ignoring unsupported options: build</p>
  
  <p>this node is not a swarm manager. Use "docker swarm init" or "docker
  swarm join" to connect this node to swarm and try again</p>
</blockquote>

<p>And here is my <code>docker-compose.yml</code>:</p>

<pre><code>version: '3'
services:
  web:
    build: ./
    environment:
      FLASK_APP: myApp
      FLASK_ENV: development
    command: flask run --host=0.0.0.0
    ports:
      - "9090:5000"
    volumes:
      - ./app:/app
volumes:
  data:
    driver: local
</code></pre>

<p>What am I doing wrong? </p>

AlxVallejo
<p>To push a Docker image to a remote Docker registry you need to follow the next steps:</p>

<ol>
<li>Build your Docker image, e.g., <code>docker build .</code></li>
<li>Tag your image with name of remote registry <code>docker tag &lt;image_name&gt; &lt;repository_name_or_address&gt;/&lt;image_name&gt;</code></li>
<li>Login to the remote registry using <code>docker login &lt;repository_name_or_address&gt;</code> command</li>
<li>Push your image using <code>docker push &lt;repository_name_or_address&gt;/&lt;image_name&gt;</code> command</li>
</ol>

<p>Steps for authorization can differ for various types of repositories. For Google Cloud Container Registry, you need to look through <a href="https://cloud.google.com/container-registry/docs/pushing-and-pulling" rel="nofollow noreferrer">this link</a>. For more information, you can also visit the <a href="https://docs.docker.com/docker-cloud/builds/push-images/" rel="nofollow noreferrer">link</a> on the Docker official site.</p>

<p>After you push the image to the remote Docker registry, you can use it in Kubernetes. The simplest command for that is <code>kubectl run &lt;name_of_your_deployment&gt; --image=&lt;repository_name_or_address&gt;/&lt;image_name&gt;</code></p>

<p>It is possible that you will need to configure Kubernetes for pulling images from your private repository. In this case, use instructions posted <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">here</a>.</p>
