title: Setup secured Jenkins master with docker
body: <p>I would like to set up a secured Jenkins master server on ec2 with docker.
  I'm using standard jenkins docker file from here: <a href="https://registry.hub.docker.com/_/jenkins/" rel="noreferrer">https://registry.hub.docker.com/_/jenkins/</a></p>
  
  <p>By default it opens an unsecured 8080 http port. However I want it to use a standard 443 port with https (at first I want to use self-signed ssl certificate).</p>
  
  <p>I researched in this topic a little bit and found several possible solution. I'm not really experienced with docker so I still couldn't find a simple one I can use or implement. Here are some options I found:</p>
  
  <ul>
  <li>Use standard jenkins docker on 8080 but configure a secured apache or nginx server on my ec2 instance that will redirect the trafic. I don't like this because the server will be outside the docker so I can not keep it in the version control</li>
  <li>Somehow modify the jenkins docker file to start jenkins with a https configured according to <a href="https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins" rel="noreferrer">https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins</a>. I'm not sure how to do that though. Do I need to create my own docker container?</li>
  <li>use docker file with secured nginx like this one <a href="https://registry.hub.docker.com/u/marvambass/nginx-ssl-secure/" rel="noreferrer">https://registry.hub.docker.com/u/marvambass/nginx-ssl-secure/</a> and somehow combine two docker containers or make them communicate? Not sure how to that either.</li>
  </ul>
  
  <p>Could someone experienced please recommend me the best solution? </p>
  
  <p>P.S. I'm not sure how much troubles ec2 is going to give me but I assume its just about opening 443 in a security group.</p>