title: "network not manually attachable" when running one-off command against docker swarm network
body: <p>I'm trying to run a one-off command to initialise a database schema in a new docker swarm which is deployed with 1.13's new support for docker-compose files.</p>
  
  <p>The swarm has the following network:</p>
  
  <pre><code>$ docker network ls
  NETWORK ID          NAME                DRIVER              SCOPE
  ...
  b7dptlu8zyqa        vme_internal         overlay             swarm
  ...
  </code></pre>
  
  <p>defined in the <code>docker-compose.yml</code> file as:</p>
  
  <pre><code>networks:
      internal:
  </code></pre>
  
  <p>The command I run is</p>
  
  <pre><code>docker run --rm --network vme_internal app:0.1 db upgrade
  </code></pre>
  
  <p>with the extra <code>vme_</code> prefix coming from the name that I gave the stack when deploying. Now when I run the above command, I get:</p>
  
  <pre><code>docker: Error response from daemon: Could not attach to network vme_internal:
  rpc error: code = 7 desc = network vme_internal not manually attachable.
  </code></pre>
  
  <p>How do I make the network attachable?</p>
  
  <p>I couldn't find any specific info about attachable in <a href="https://docs.docker.com/compose/networking/%22Docker%20networking%22" rel="noreferrer">Docker networking</a> and tried adding an attribute <code>attachable</code> to the network definition without success.</p>