title: docker-compose up error, Invalid address
body: <p>I want to use elastic's docker-elk,  then I cloned elastic github code. And I want to use a specific ip for every container, so I define a specific ip for every container, when I run <code>docker-compose up</code>, I meet the error</p>
  
  <pre><code>ERROR: for elasticsearch  Cannot start service elasticsearch: Invalid address 172.18.1.3: It does not belong to any of this network's subnets
  ERROR: Encountered errors while bringing up the project.
  </code></pre>
  
  <p>it shows no any of network's subnet, but I define the subnet, and <code>docker-compose.yml</code> like this</p>
  
  <pre><code>version: '2'
  
  services:
  
    elasticsearch:
      build: elasticsearch/      
      ports:
        - "9200:9200"
        - "9300:9300"
      environment:
        ES_JAVA_OPTS: "-Xmx256m -Xms256m"
      networks:
        elk:
          ipv4_address: 172.18.1.3
  
    logstash:
      build: logstash/
      ports:
        - "5000:5000"
      environment:
        LS_JAVA_OPTS: "-Xmx256m -Xms256m"
      networks:
        elk:
          ipv4_address: 172.18.1.4
      depends_on:
        - elasticsearch
  
    kibana:
      build: kibana/
      ports:
        - "5601:5601"
      networks:
        elk:
          ipv4_address: 172.18.1.5
      depends_on:
        - elasticsearch
  
  networks:
  
    elk:
      driver: bridge
      ipam:
        config:
          - subnet: 172.18.1.0/24
  </code></pre>
  
  <p>and <code>docker version</code></p>
  
  <pre><code>Client:
   Version:      17.06.0-ce
   API version:  1.30
   Go version:   go1.8.3
   Git commit:   02c1d87
   Built:        Fri Jun 23 21:20:36 2017
   OS/Arch:      linux/amd64
  
  Server:
   Version:      17.06.0-ce
   API version:  1.30 (minimum version 1.12)
   Go version:   go1.8.3
   Git commit:   02c1d87
   Built:        Fri Jun 23 21:21:56 2017
   OS/Arch:      linux/amd64
   Experimental: false
  </code></pre>