<p>I am trying to follow the instructions at <a href="https://docs.docker.com/docker-for-windows/kubernetes/#use-docker-commands" rel="nofollow noreferrer">https://docs.docker.com/docker-for-windows/kubernetes/#use-docker-commands</a> for running a docker-compose.yml file against kubernetes on Docker for Windows.</p>

<p>I am using the Edge version of Docker for Windows -- 18.03.0-ce-rc4 -- and I have kubernetes enabled.</p>

<p>I am using the example docker-compose app at <a href="https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file" rel="nofollow noreferrer">https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file</a>, i.e.</p>

<pre><code>version: '3.3'
services:
  web:
    build: .
    ports:
      - '5000:5000'
  redis:
    image: redis
</code></pre>

<p>This example works fine with <code>docker-compose build</code> and <code>docker-compose up</code></p>

<p>But following the documentation linked above for <code>docker stack</code>, I get the following:</p>

<pre><code>PS C:\dev\projects\python\kubetest&gt; docker stack deploy --compose-file .\docker-compose.yml mystack
Ignoring unsupported options: build

Stack mystack was created
Waiting for the stack to be stable and running...
 - Service redis has one container running
PS C:\dev\projects\python\kubetest&gt; kubectl get services
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)     AGE
kubernetes   ClusterIP   10.96.0.1    &lt;none&gt;        443/TCP     5d
redis        ClusterIP   None         &lt;none&gt;        55555/TCP   8s
</code></pre>

<p>Note that it doesn't create the web service, along with that "ignoring unsupported options: build" error</p>

<p>I also tried using the sample docker-compose.yml file in that documentation linked above, and it didn't work, either, with a totally different error.</p>

<p>In short, by following the documentation, I'm unable to get anything deployed to kubernetes on Docker for Windows.</p>

<p>Due to the lack of support for a <code>build</code> there would be no <code>image</code> to run for the <code>web</code> service containers. </p>

<p>Compose can manage the build for you on a single Docker host. As Swarm and Kubernetes are normally run across multiple nodes, an <code>image</code> should reference a registry available on the network so all nodes can access the same image.</p>

<p><a href="https://docs.docker.com/engine/swarm/stack-deploy/#create-the-example-application" rel="nofollow noreferrer">Dockers <code>stack deploy</code> example</a> includes a step to <a href="https://docs.docker.com/engine/swarm/stack-deploy/#set-up-a-docker-registry" rel="nofollow noreferrer">setup a private registry</a> and use that for source of the image:</p>

<pre><code>services:
  web:
    image: 127.0.0.1:5000/stackdemo
</code></pre>

<h3>Workaround</h3>

<p>In this instance, it <em>might</em> be possible to get away with building the image manually and referencing that image name due to everything running under the one Docker instance, it depends on how Kubernetes is setup.</p>

<pre><code>version: '3.3'
services:
  web:
    build: .
    image: me/web
    ports:
      - '5000:5000'
  redis:
    image: redis
</code></pre>

<p>Build the image externally</p>

<pre><code>docker-compose build web
</code></pre>

<p>or directly with <code>docker</code>:</p>

<pre><code>docker build -t me/web .
</code></pre>
