title: Initializing database in the base image of a running container
body: <p>I pulled a mysql:5.5 image from the docker repo which I am using as a base image for my containerized app. After running this application that uses the mysql from the base image, it gives the following error</p>
  
  <p>error: database is uninitialized and MYSQL_ROOT_PASSWORD not set
    Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?</p>
  
  <p>How can I make sure that mysql is running on "localhost:3306" on the application container and that it is correctly initialized?</p>
  
  <p>EDIT:
  Dockerfile</p>
  
  <pre><code>FROM mysql+java+ubuntu_baseimage:latest
  
  # Copy the fat jar inside the image
  COPY shaded_jar      /some/location/on/image/app.jar
  COPY config.yml      /some/location/on/image/config.yml
  
   ## What to run when the container starts
  #ENTRYPOINT ["java", "-jar", "/some/location/on/image/app.jar", "server",    "/some/location/on/image/config.yml"]
  
   #Ports used by this image
   EXPOSE 8080 (http port of the app)
  </code></pre>
  
  <p>Note that the container exposes both 8080 and 3306(mysql) port. But not sure how to connect to this database using 'ocalhost:3306" in the same container?</p>