0

Following up on How to configure docker container proxy?

I'm having problem passing my localhost proxy into docker container:

$ 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
  • This is under macOS.
  • I also tried to pass --net=host from docker cli, but the result is the same.

What I've missed?

xpt
  • 20,363
  • 37
  • 127
  • 216

1 Answers1

0

If you are running the commands in docker container's bash then you should use

#within docker
$ curl --proxy socks5://0.0.0.0:18888 https://goolge.ca