I have Windows-10 with Docker 18.06.0-ce-win72 (19098). In our network uses NTLM-proxy, so docker goes to the Internet through Ntlmaps (I also try Cntlm, result is the same). I run image based on php:7.2-fpm with docker-compose. I enter the conteiner
docker exec -it {id} bash
and run command:
curl https://packagist.org/packages.json // works!
or
wget https://packagist.org/packages.json // works!
But
php -r "echo file_get_contents('https://packagist.org/packages.json');"
results "failed to open stream: Cannot assign requested address in Command line code on line 1"
curl https://packagist.org/packages.json ----> works
php -r "echo file_get_contents('https://packagist.org/packages.json');" ----------> fails to open stream
php -r "echo curl_exec(curl_init('https://packagist.org/packages.json'));" ---------> works
I see ntlmaps-console and view request from "curl", but it's no requests in console from "file_get_contents".
In php allow_url_open => on
I found similar problem: https://github.com/composer/composer/issues/2169
But I can't disable IPv6 in Docker for test the solution.
I try run "sysctl", but "bash: sysctl: command not found"
I try set
sysctls:
- net.ipv6.conf.all.disable_ipv6=1
- net.ipv6.conf.default.disable_ipv6=1
- net.ipv6.conf.lo.disable_ipv6=1
in docker-compose.yml for service, but it didn't solve the problem
I run this container on VPS and this work on VPS.
How can I solve this problem on Windows + NTLM?
My docker-compose.yml: https://pastebin.com/PfsgzrLs