简体   繁体   中英

Jenkins in Docker container on AWS

I am setting up Jenkins on an AWS instance with

docker run -v jenkins_home:/var/jenkins_home -p 8090:8080 -p 50001:50000 jenkins/jenkins:lts

I have opened ports 8090 and 50001 in the security group of the EC2 instance to reach it from the browser on my local computer. From my local computer, I can reach ports 50001 and 8090 while Jenkins is being set up. At port 8090, I am told that the website will automatically reload once Jenkins is set up.

Once the output of the docker run command tells me that Jenkins is set up, the website at port 8090 is no longer reachable, but port 50001 is still reachable. I can still reach port 8090 from within the EC2 instance, ie at localhost:8090, but not from my browser on my local computer.

What is going on? Do I need to configure an nginx server?

check the ports locally on the AWS instance on a different shell window. you should see the jenkins container is up and 8090/50001 are accessible:

~ docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED              STATUS              PORTS                                              NAMES
840f04633799        jenkins/jenkins:lts   "/sbin/tini -- /usr/…"   About a minute ago   Up About a minute   0.0.0.0:8090->8080/tcp, 0.0.0.0:50001->50000/tcp   relaxed_wozniak

~ nc -vz localhost 8090
Connection to localhost 8090 port [tcp/*] succeeded!

~ nc -vz localhost 50001
Connection to localhost 50001 port [tcp/*] succeeded!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM