首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将本地代理传递给Mac下的docker容器

将本地代理传递给Mac下的docker容器
EN

Stack Overflow用户
提问于 2021-01-21 16:22:02
回答 1查看 126关注 0票数 0

跟进How to configure docker container proxy?

我在将本地主机代理传递到docker容器时遇到了问题:

代码语言:javascript
复制
$ curl --proxy socks5://localhost:18888 https://goolge.ca
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>

docker run -ti -p 18888:18888 ...

# within docker
$ curl --proxy socks5://localhost:18888 https://goolge.ca
curl: (7) Failed to connect to localhost port 18888: Connection refused

$ curl --proxy https://localhost:18888 https://goolge.ca
curl: (7) Failed to connect to localhost port 18888: Connection refused

$ curl --proxy http://localhost:18888 https://goolge.ca
curl: (7) Failed to connect to localhost port 18888: Connection refused

$ curl --proxy socks5://0.0.0.0:18888 https://goolge.ca
curl: (7) Failed to connect to 0.0.0.0 port 18888: Connection refused

  • --这是macOS.
  • I也试图从码头cli中传递--net=host,但结果是一样的.

我错过了什么?

EN

回答 1

Stack Overflow用户

发布于 2021-01-21 16:24:58

如果在docker容器的bash中运行这些命令,则应该使用

代码语言:javascript
复制
#within docker
$ curl --proxy socks5://0.0.0.0:18888 https://goolge.ca
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65831539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档