title: Docker API - how do I join a network?
body: <p>this is the documentation for the API: <a href="https://docs.docker.com/engine/api/v1.24/#containers" rel="nofollow noreferrer">https://docs.docker.com/engine/api/v1.24/#containers</a>
  where you'll see that for the create container method a section of the JSON labelled "NetworkingConfig" is displayed</p>
  
  <p>this section is not described at all and I can't quite figure out how to express what I need, which is the equivalent of a docker-compose:</p>
  
  <pre><code>services:
    myservice:
      networks:
        - mynetwork
  networks:
    mynetwork:
      external: true
  </code></pre>
  
  <p>how can I do the above programatically?</p>