在jenkins中运行时,连接到localhost的连接被拒绝,但在travis和local中有效

时间:2019-12-12 17:47:31

标签: jenkins jenkins-cli

我有一个通过docker compose运行的容器,在docker-compose中,我进行了如下端口映射:

version: '3.7'
services: 
  mock-server:
    build: " path/mock-server" 
    ports: 
      - "4000:4000"

因此,在运行docker-compose之后,我可以看到它在travis和local上都有效:

curl http://127.0.0.1:4000/readiness

但是,相同的curl命令会在jenkins中返回错误:

fatal: [localhost]: FAILED! => {"changed": false, "content": "", "elapsed": 0, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 111] Connection refused>", "redirected": false, "status": -1, "url": "http://127.0.0.1:4000/readiness"}

任何建议都非常感谢

0 个答案:

没有答案