title: How to deploy web service on Docker container
body: <p>This is my Dockerfile:</p>
  
  <pre><code>#Build java web app container image
  FROM ubuntu
  MAINTAINER wangyao
  #Make java and tomcat install directory
  RUN mkdir /usr/local/java
  RUN mkdir /usr/local/tomcat
  #Copy jre and tomcat into image
  ADD jdk1.8.0_45.jdk /usr/local/java/
  ADD apache-tomcat-7.0.62 /usr/local/tomcat/
  ENV JAVA_HOME=/usr/local/java/Contents/Home
  CMD cd /usr/local/tomcat;./bin/catalina.sh run
  #Expose http port
  EXPOSE 8080
  </code></pre>
  
  <p>Then i built it and try to start it:</p>
  
  <pre><code>wangyaos-MBP-3:flexcloud wangyao$ ls
  Dockerfile      apache-tomcat-7.0.62    jdk1.8.0_45.jdk
  wangyaos-MBP-3:flexcloud wangyao$ docker build -t flexcloud .
  Sending build context to Docker daemon 355.6 MB
  Sending build context to Docker daemon 
  ........
  Successfully built 1f824d246b39
  wangyaos-MBP-3:flexcloud wangyao$ docker run -i -t flexcloud
  Using CATALINA_BASE:   /usr/local/tomcat
  Using CATALINA_HOME:   /usr/local/tomcat
  Using CATALINA_TMPDIR: /usr/local/tomcat/temp
  Using JRE_HOME:        /usr/local/java/Contents/Home
  Using CLASSPATH:        /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
  /usr/local/java/Contents/Home/bin/java: 20: /usr/local/java/Contents/Home/bin/java: Syntax error: word unexpected (expecting ")")
  wangyaos-MBP-3:flexcloud wangyao$ 
  </code></pre>
  
  <p>what does <code>word unexpected  (expecting ")")</code> mean ? </p>
  
  <p>I used <code>$ ./bin/catalina.sh run</code> without docker,  and I can run it,  but i why can not run it on the docker container ?</p>