title: Jenkins not starting in docker (Dockerfile included)
body: <p>I am attempting to build a simple app with Jenkins in a docker container. I have the following Dockerfile:</p>
  
  <pre><code>FROM ubuntu:trusty
  
  # Install dependencies for Flask app.
  RUN sudo apt-get update
  RUN sudo apt-get install -y vim
  RUN sudo apt-get install -y curl 
  RUN sudo apt-get install -y python3-pip
  RUN pip3 install flask
  
  # Install dependencies for Jenkins (Java).
          # Install Java 1.8.
  RUN sudo apt-get install -y python-software-properties debconf-utils
  RUN sudo apt-get install -y software-properties-common
  RUN sudo add-apt-repository -y ppa:webupd8team/java
  RUN sudo apt-get update
  RUN echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
  RUN sudo apt-get install -y oracle-java8-installer
          # Install, start Jenkins.
  RUN sudo apt-get install -y wget
  RUN wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | apt-key add -
  RUN echo deb http://pkg.jenkins-ci.org/debian binary/ &gt; /etc/apt/sources.list.d/jenkins.list
  RUN sudo apt-get update
  RUN sudo apt-get install -y jenkins
  RUN sudo /etc/init.d/jenkins start
  
  COPY ./app /app
  
  CMD ["python3","/app/main.py"]
  </code></pre>
  
  <p>I run this container with the following:</p>
  
  <pre><code>docker build -t jenkins_test .
  docker run --name jenkins_test_container -tid -p 5000:5000 -p 8080:8080 jenkins_test:latest
  </code></pre>
  
  <p>I am able to start flask and install Jenkins, however, when running, Jenkins is not running. <code>curl localhost:8080</code> is not successful.</p>
  
  <p>In the log output, I am able to see:</p>
  
  <pre><code>Correct java version found
   * Starting Jenkins Automation Server jenkins [ OK ] 
  </code></pre>
  
  <p>However, it's still not running.</p>
  
  <p>I can ssh into the container and manually run <code>sudo /etc/init.d/jenkins start</code> to start it, but I want it to start on <code>docker run</code> or <code>docker build</code>.</p>
  
  <p>I have also tried putting <code>sudo /etc/init.d/jenkins start</code> in the <code>CMD</code> portion of the Docker file:</p>
  
  <pre><code>CMD python3 /app/main.py; sudo /etc/init.d/jenkins start
  </code></pre>
  
  <p>With this, I am able to curl Flask, but still not Jenkins.</p>
  
  <p><strong>How can I get Jenkins to start automatically?</strong></p>