Situation :
- I set up Jenkins with docker, to install package on AEM instance.
- In my pom.xml, 'targetURL' of profile 'autoInstallPackage' is "http://localhost:4502/crx/packgmr/service.jsp".
Problem :
- When I set 'targetURL' with IP address, it works.
- When I set 'targetURL' with 'localohost', it fails.
What I want to do :
- Run 'autoInstallPackage' targetURL with 'localhost', not IP address.
I guess the cause is this (not sure) :
- Jenkins is running inside docker, so the docker container could be considered as 'localhost'.
Please help me. Thank you.
CodePudding user response:
Your guess is right. The localhost exists only inside the container.
To bypass this behaviour you can run the docker image as so:
docker run --network host --name jenkins your_jenkins_image
The --network host
param will cause the docker container to use the dns of the host machine (the machine running docker).