title: Using the host network with docker-compose
body: <p>I'm trying to set up a container with two networks with <code>docker-compose</code>. I would like one of those networks to be the <code>host</code> network (ie: as if I was running <code>docker run --net=host</code>) and the other a user-defined network.</p>
  
  <p>I tried this:</p>
  
  <pre><code>version: '3'
  
  networks:
    test:
      driver: bridge
    host:
      external: true
  
  services:
    helloworld:
      image: python:3.6-alpine
      networks:
        - test
        - host
      cap_add:
        - NET_ADMIN
        - NET_RAW
      ports:
        - 0.0.0.0:8080:8080
      command: sh -c "cd /tmp &amp;&amp; python -m http.server 8080"
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <pre><code>$ docker-compose up
  Removing blah_helloworld_1
  Starting 8743618e8af4_blah_helloworld_1 ... error
  
  ERROR: for 8743618e8af4_blah_helloworld_1  network-scoped alias is supported only for containers in user defined networks
  
  ERROR: for helloworld  network-scoped alias is supported only for containers in user defined networks
  ERROR: Encountered errors while bringing up the project.
  </code></pre>