title: Connect docker container to local workbench MySQL DB
body: <p>HI I have my web app running on my local machine and connected to <strong>Mysql workbench</strong>, I am now trying to dockerize the webapp. I can't seem to get it to connect to the DB on my local dev machine (I am running <strong>Docker Desktop for Windows</strong>), can anyone tell me how I would go about this? Here is what I have so far. </p>
  
  <pre><code>`docker run -it -e "CATALINA_OPTS=-Dspring.profiles.active=dev -DPARAM1=DEV" -p 8080:8080 -p 8005:8005 -p 8009:8009 -p 3306:3306 --add-host=docker:192.168.1.7 -v C:\myapp\trunk\target\myapp.war:/usr/local/tomcat/webapps/myapp.war --name waitapp tomcat:8.0.38-jre8`
  </code></pre>
  
  <p>after a few second, I run <code>docker ps -a</code></p>
  
  <pre><code>CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                           PORTS                                                                                            NAMES
  2a1764dd9640        tomcat:8.0.38-jre8     "catalina.sh run"        2 minutes ago       Up 2 minutes                     0.0.0.0:3306-&gt;3306/tcp, 0.0.0.0:8005-&gt;8005/tcp, 0.0.0.0:8009-&gt;8009/tcp, 0.0.0.0:8080-&gt;8080/tcp   waitapp
  </code></pre>
  
  <p>The container seems to be running, but I get a <strong>404 Not found</strong> when I try the rest request, this is the same as I do when running from inside spring tool suite using built in tomcat server.</p>
  
  <p><strong>NOTE</strong>
  I don't want to run a separate mysql container and link the two over a network, I just want to try get my newly created docker app to connect to my local DB MySQL.</p>