title: docker network not working without link
body: <p>I have a <code>mysql</code> container and a <code>service</code> container that needs to connect to the <code>mysql</code> container.</p>
  
  <p>I created a networking with <code>docker network create chrisbolton</code></p>
  
  <p>I am spinning up the <code>mysql</code> container with</p>
  
  <p><code>docker run --name chrisbolton-mysql -v /Users/Bolton/chrisbolton-data:/var/lib/mysql --network chrisbolton -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=chrisbolton -d mysql:latest</code></p>
  
  <p>I am spinning up the <code>service</code> container with</p>
  
  <p><code>docker run -p 8080:8080 --name chrisbolton-service --network chrisbolton --link chrisbolton-mysql:mysql -d chrisbolton-service</code></p>
  
  <p>However, I know that <code>link</code> is deprecated and I need to move to only using <code>networks</code>. But if I remove the <code>link</code> here the two containers cannot communicate.</p>
  
  <p>I am connecting to <code>mysql</code> with the following config:</p>
  
  <pre><code>#disbale Spring banner
  spring.main.banner-mode=off
  
  spring.datasource.url=jdbc:mysql://mysql:3306/chrisbolton
  spring.datasource.username=root
  spring.datasource.password=password
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  </code></pre>
  
  <p>I have done a <code>docker network inspect chrisbolton</code> to get the IPAddresses and have tried changing my config file to point to that directly. But still not sure why it won't connect.</p>