I am not able to curl to my Deployed Application from Jenkins Docker Containers

I deployed the following containers on my local machine:

  • student-app: is my testing application
  • karson-jenkins: is my first jenkins which was run with published localhost ip and port 8082 and docker network as bridge
  • karson-jenkins-host: is my second jenkins which was run with docker network as host
    enter image description here

I am able to launch and navigate to my Application Under Test (AUT) and Jenkins site from browser successfully as below:
enter image description here
enter image description here

And my Issue is I am not able to curl to my application url from Jenkin container which was run with published IP and mapped port 8082 although it belongs to the same network with my application and the docker network is Bridge, that make my sent api request to the application get error Connection Refused when executing test on jenkins job

enter image description here

enter image description here

I was also tried to run another docker container for jenkins with using --network=host in docker run command, and I am able to curl to my AUT url. But another issue is I am not able to find any way to access my jenkin url which was run with docker network host. I tried to navigate to http://host.docker.internal:8080/ and http://host.docker.internal/ but none of them success
enter image description here

enter image description here

Any help from you to help me able to clarify about the my issue and solve it will be extremely appreciated from my indeed.

Source: Docker Questions

LEAVE A COMMENT