jockkins를 사용하여 도커 컨테이너를 만들고 동일한 빌드 컨테이너에 대해 통합 테스트를 실행하려고합니다.Jenkins는 도커 컨테이너의 http 끝점 호스트에 말리지 않을 수 있습니다.
현재 내가 겪고있는 문제는 컨테이너를 빌드하고 실행할 수 있으며 http 엔드 포인트에 컬을 시도하면 연결이 거부됩니다. 그래서 나는 그것이 젠킨스 노예 환경 설정과 관련이 있다고 생각합니다. wheel docker jenkins
그룹에 jenkins 사용자를 추가했으며 jenkins로 기록 된 curl 명령을 실행할 때 작동합니다. 하지만 젠킨스에서 실행할 때 연결이 거부됩니다.
JenkinsFile
sh "docker build -t my-service ."
sh "docker rm -f my-service || true"
sh "docker run -d -p 9091:5000 -p 1433:1433 --name=my-service my-service"
sh "docker ps"
sh "curl -v http://172.16.32.20:9091/api/products/"
젠킨스 출력
+ curl -v http://172.16.32.20:9091/api/products/baggingoptions
* About to connect() to 172.16.32.20 port 9091 (#0)
* Trying 172.16.32.20...
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0* Connection refused
* Failed connect to 172.16.32.20:9091; Connection refused
* Closing connection 0
curl: (7) Failed connect to 172.16.32.20:9091; Connection refused
슬레이브 정보 : 당신이 고정 표시기 실행을 할 경우
Static hostname: **************************
Icon name: computer-vm
Chassis: vm
Machine ID: 009cdec7fded4740be96692dfee788c0
Boot ID: fe492def29c047bf910c213911fda980
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-514.26.2.el7.x86_64
Architecture: x86-64
두 포트를 매핑하는 이유는 무엇입니까? 서비스가 두 개의 다른 포트 (5000 및 1433)에서 실행됩니까? – JBone
내 응용 프로그램에 문제가있는 –