Unable to wget from alpine when behind ntlm prxy

The Docker Version being used is
$ docker version
time=“2018-01-29T15:03:54+05:30” level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Mar 2 01:11:00 2017
OS/Arch: windows/amd64

Version: 17.04.0-ce
API version: 1.28 (minimum version 1.12)
Go version: go1.7.5
Git commit: 4845c56
Built: Wed Apr 5 18:45:47 2017
OS/Arch: linux/amd64
Experimental: false

The laptop has Windows 10 installed.

CNTLM proxy has been set to run on
The docker machine has been configured to use this proxy by setting the value of HostOptions.EngineOptions.Env in config.json of the docker machine. The docker pull command is able to get the images from the hub.

The alpine image was downloaded and this was run using the command
docker run -it alpine /bin/sh
This also works.
Now environment variables http_proxy and https_proxy were set to use the proxy as indicated earlier.
ping to works fine.

/ # ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=127 time=1.139 ms
64 bytes from seq=1 ttl=127 time=1.086 ms
— ping statistics —
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 1.086/1.112/1.139 ms

When wget is invoked a socket is established to from the docker-machine, but in the container it hangs showing connecting to (The netstat -an in the windows command line shows that the connection has been established).

What is the mistake? And how to rectify it?

wget did not work, but curl works. To install curl using apk add curl the http_proxy and https_proxy had to be changed to http_proxy=http://proxyip:port and https_proxy=https://<proxy_ip:port>. Then again it had to be reverted for curl to work. Not sure why wget is not working.

try adding /etc/wgetrc with following contents:

use_proxy = on
http_proxy =  http://username:password@proxy.server.address:port/
https_proxy =  http://username:password@proxy.server.address:port/
ftp_proxy =  http://username:password@proxy.server.address:port/