title: Accessing dockerized service (Rundeck) from a VM
body: <p>Hello i have an Ubuntu VM (using bridged adapter) in which i'm running a docker container in which im starting Rundeck with a pre-build war file in a mounted Volume.When i run the war the first time it creates its files and the config file:</p>
  
  <pre><code>#loglevel.default is the default log level for jobs: 
  
  ERROR,WARN,INFO,VERBOSE,DEBUG
  loglevel.default=INFO
  rdeck.base=/home/rundeck/rundeck
  
  #rss.enabled if set to true enables RSS feeds that are public (non-authenticated)
  rss.enabled=false
  server.address=7d142a279564
  grails.serverURL=http://7d142a279564:4440
  dataSource.dbCreate = update
  dataSource.url = jdbc:h2:file:/home/rundeck/rundeck/server/data/grailsdb;MVCC=true
  
  # Pre Auth mode settings
  rundeck.security.authorization.preauthenticated.enabled=false
  rundeck.security.authorization.preauthenticated.attributeName=REMOTE_USER_GROUPS
  rundeck.security.authorization.preauthenticated.delimiter=,
  # Header from which to obtain user name
  rundeck.security.authorization.preauthenticated.userNameHeader=X-Forwarded-Uuid
  # Header from which to obtain list of roles
  rundeck.security.authorization.preauthenticated.userRolesHeader=X-Forwarded-Roles
  # Redirect to upstream logout url
  rundeck.security.authorization.preauthenticated.redirectLogout=false
  rundeck.security.authorization.preauthenticated.redirectUrl=/oauth2/sign_in
  
  rundeck.log4j.config.file=/home/rundeck/rundeck/server/config/log4j.properties
  </code></pre>
  
  <p>As you see "server.address" and "grails.serverURL" get the default image ID as IP.
  I can't access the container using this url,but i can access it using localhost:4440.But after loging in in rundeck it redirects me to "grails.serverURL" which gives "Server Not Found" as stated before.
  This is how im starting the container:</p>
  
  <pre><code>sudo docker run -it -v /path/to/source:/path/to/dest -p 4440:4440  &lt;imageID&gt;
  </code></pre>
  
  <p>When i change the "server.address" and "grails.serverURL" to localhost or 127.0.0.1 i can't access the container at all.
  Sorry if the question was answered before I'm new at docker and been at this for several days now,couldn't find a solution,Thanks!</p>