Docker容器-无法建立新连接:[Errno 111]连接被拒绝

时间:2019-07-17 15:50:09

标签: docker https docker-compose

我正在尝试将https请求从某个容器发送到Web(而不是另一个容器),但是失败。

由于容器使用iptable,我尝试将端口:443重定向到端口:8443

我试图将其添加到Dockerfile RUN iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to 8443 bu我收到此消息:

/bin/sh: iptables: not found

请求: consumer_response = requests.get('{}/consumers/'.format(admin_api), params=params, verify=(running_env != RUNNING_ENV_LOCAL))

错误:

HTTPSConnectionPool(host='MyHost', port=443): Max retries exceeded with url: /consumers/?custom_id=org%orgid%2Fuser%userid (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1ad2264090>: Failed to establish a new connection: [Errno 111] Connection refused',))"

我希望得到200:OK,但实际输出是:

HTTPSConnectionPool(host='MyHost', port=443): Max retries exceeded with url: /consumers/?custom_id=org%orgid%2Fuser%userid (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1ad2264090>: Failed to establish a new connection: [Errno 111] Connection refused',))"

0 个答案:

没有答案