Create Jenkin Web Server with Jenkin Image in the Container By Using Port Expose

Share via:

Create Jenkin Web Server with Jenkin Image in the Container By Using Port Expose

Dear Readers,

In this article,we will see Create Jenkin Web Server with Jenkin Image in the Container (Port Expose).

Steps to Follow

  1. Search the Jenkins image from online Docker Registry (Docker Hub).
  2. Create a Demonized Container “ktexperts-jenkins” with image “jenkins” and port mapping 8080:8080.
  3. Verify the container.
  4. Verify content of container “ktexperts-jenkins”.
  5. Add the port 8080 in Security Group of Docker Instance.
  6. Verify content of container “ktexperts-jenkins”.

To see the list of all images in your machine

To see the list of running containers

To see the list of all the containers

1. Search the Jenkins image from online Docker Registry (Docker Hub)

2. Create a Demonized Container “ktexperts-jenkins” with image “jenkins” and port mapping 8080:8080

3. Verify the container

To see the list of running containers

4. Verify content of container “ktexperts-jenkins” 

Generally container won’t have any IP that’s why we expose the ports in both sides then give Docker Public IPV4 to users.

They can access container webserver through docker.

Copy Public IPV4 of the Docker

Search IPV4 Public IP along with port 8080 (13.232.62.198:8080) of Docker in browser

we unable to see content of the container “ktexperts-jenkins” because of we didn’t add the port in SG of base machine (docker instance)

We need to add the port 8080 in SG of Docker Instance.

5. Add the port 8080 in Security Group of Docker Instance

Select Docker instance and click on Security Group “Docker-SG”.

Go to Inbound and click on Edit.

Click on Add Rule.

Add port 8080 and click on save.

6. Verify content of container “ktexperts-jenkins”

Refresh,IPV4 Public IP along with port 8080 (13.232.62.198:8080) of Docker in browser.

we can able to see content of container “ktexperts-jenkins”.

Key Points

Demonized Mode (Even Though you exit from container,those will be running).
Container is running without going inside the container.
Mapping 2 ports while running the docker run command.
one port for base machine (Docker) and another one for container (ktexperts-webserver).
We can change host port but can’t container port.
We need to add port 8080 in SG of Docker.
Container don’t have any IP Address but it has port.
We access the container web content through base machine IP Address.

Thank you for giving your valuable time to read the above information.

Follow us on 

Website :  www.ktexperts.com

Facebook Page : KTexperts

Linkedin Page : KT EXPERTS

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

One thought on “Create Jenkin Web Server with Jenkin Image in the Container By Using Port Expose

Add Comment