title: Docker ERROR: only one instance of "host" network is allowed
body: <p>I am trying to run a container where I need to user network driver as &quot;host&quot; instead of &quot;bridge&quot;. I am running it on Centos machine and my docker-compose.yml is</p>
  <pre><code>version: '3.4'
  
  services:
    testContainer:
      build:
        context: .
        args: 
          HADOOP_VERSION: 2.6.0
          HIVE_VERSION: 1.1.0
      image: testcontainer
      container_name: testcontainer
      hostname: testcontainer
      ports:
        - 9200:9200
        - 9300:9300
        - 5601:5601
        - 9001:9001
      ulimits:
        memlock:
          soft: -1
          hard: -1  
      networks:
        - elknet  
  
  networks:
    elknet:
      driver: host      
  </code></pre>
  <p>But i am getting the following error when I fire &quot;<em><strong>docker-compose up</strong></em>&quot; :</p>
  <blockquote>
  <p>ERROR: only one instance of &quot;host&quot; network is allowed</p>
  </blockquote>
  <p>Can anyone please suggest how can I use host network using docker-compose.yml.</p>
  <p>Also note that if I use network_host as suggested by @larsks, I am still getting error</p>
  <pre><code>version: '3.4'
  
  services:
    testContainer:
      build:
        context: .
        args: 
          HADOOP_VERSION: 2.6.0
          HIVE_VERSION: 1.1.0
      image: testcontainer
      container_name: testcontainer
      hostname: testcontainer
      ports:
        - 9200:9200
        - 9300:9300
        - 5601:5601
        - 9001:9001
      ulimits:
        memlock:
          soft: -1
          hard: -1  
      network_mode: host
  </code></pre>
  <p>I am getting following error</p>
  <blockquote>
  <p>ERROR: The Compose file './docker-compose.yml' is invalid because:
  Unsupported config option for services: 'testContainer'</p>
  </blockquote>