title: How can I deploy cloudfoundry-uaa as a docker image based on tomcat?
body: <p>We were using the cf-uaa's gradle tasks to create a docker image but those have been removed in the latest version. I've loaded the war in a recent version, but the service does not seem to be starting correctly.</p>
  
  <p>I've been building the war from the v74 tag, adding it to tomcat:8.5.45-jdk12-openjdk-oracle or tomcat:9.0.24-jdk12-openjdk-oracle, and setting the various env vars that we were passing in to the previous image. I'm not seeing any log entries after the initial tomcat output stating that my war has been deployed and the server startup time. </p>
  
  <p>The Dockerfile is basically just an adaptation of what was being passed in the previous image:</p>
  
  <pre><code>FROM tomcat:8.5.45-jdk12-openjdk-oracle
  #FROM tomcat:9.0.24-jdk12-openjdk-oracle
  ENV LOGIN_CONFIG_URL WEB-INF/classes/required_configuration.yml
  ENV UAA_CONFIG_PATH /uaa
  RUN bash -c "rm -r /usr/local/tomcat/webapps/ROOT"
  RUN bash -c "rm -r /usr/local/tomcat/webapps/host-manager"
  RUN bash -c "rm -r /usr/local/tomcat/webapps/manager"
  RUN bash -c "rm -r /usr/local/tomcat/webapps/examples"
  RUN bash -c "rm -r /usr/local/tomcat/webapps/docs"
  ADD *.war /usr/local/tomcat/webapps/uaa.war
  RUN bash -c "echo $LOGIN_CONFIG_URL"
  EXPOSE 8080
  </code></pre>
  
  <p>I would expect to see the service responding to my requests, or some errors in the log indicating that the war failed to deploy. I am not currently getting any log output generated from the application code. When I send a request to the service, the response is a 500 with the an error header from the service. </p>
  
  <p><code>X-Cf-Uaa-Error:Server failed to start. Possible configuration error.</code></p>
  
  <p>update: I've located the uaa logs within <code>.../tomcat/logs/uaa.log</code> I'm not seeing anything indicating that the service failed to deploy, but I am also not seeing anything to indicate that it is picking up the env vars I have set in the container. I recreated the service using the war from the original setup which started successfully using the uaa.yml which I mounted as a volume. Comparing the logs, the original setup's first log entry is YamlProcessor which does not show up in the v75 logs at all. In fact, no debug entries show up at all, which suggests to me that my <code>LOG_LEVEL</code> env var is not propagating either.</p>
  
  <p>Update 2: We reverted the image base to <code>FROM tomcat:8.5-jre8</code> and started seeing flyway errors in the uaa.log. Our previous datasource url format was <code>url: jdbc:postgresql://${POSTGRES_NAME}:5432/${DB}?currentSchema=uaa</code> which caused a flyway exception. After removing the schema reference, it created the tables in the public schema. By creating the uaa schema manually before starting the service, it was able to run with the original format. The flyway version has updated, so perhaps there something new that needs to be set.</p>
  
  <p>The application seems to be running, but when I try to get a token at <code>/uaa/oauth/token</code> I get a 500 with this error in the logs: <code>Caused by: java.lang.NoSuchMethodError: java.nio.CharBuffer.limit(I)Ljava/nio/CharBuffer;</code></p>