Docker Community Forums

Share and learn in the Docker community.

Connect container to local workbench DB

HI I have my web app running on my local machine and connected to mysql workbench, I am now trying to dockerize the webapp. I can seem to get it to connect to the DB, can anyone tell me how I would go about this. Here is what I have so far.

docker run -it -e " -DPARAM1=DEV" -p 8080:8080 -p 8005:8005 -p 8009:8009 -p 3306:3306 --add-host=docker: -v C:\myapp\trunk\target\myapp.war:/usr/local/tomcat/webapps/myapp.war --name waitapp tomcat:8.0.38-jre8

after a few second, I run docker ps -a

CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                           PORTS                                                                                            NAMES
2a1764dd9640        tomcat:8.0.38-jre8     " run"        2 minutes ago       Up 2 minutes           >3306/tcp,>8005/tcp,>8009/tcp,>8080/tcp   waitapp

The container seems to be running, but I get a 404 Not found 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.