phpdocker-io/phpdocker.io

Issue with accessing outside container with curl

AntonioCS opened this issue · 4 comments

Hey,

So I created a very basic project with php version 8.1 and with the only extra extension to be mysql (besides the ones already installed)
When I did docker-compose up I got the following:

image

The containers still started so I got in to the php-fpm container with docker-compose exec php-fpm bash no issues there.
But I then got an issue when I when I used composer create-project... to generate a project:

In CurlDownloader.php line 377:
                                                                                                                 
  curl error 6 while downloading https://repo.packagist.org/packages.json: getaddrinfo() thread failed to start  
                                                                                                                 

I am unable to download this.
If I do curl https://repo.packagist.org/packages.json outside the container it works fine (and in other containers I have, not from phpdocker.io). Also in my host machine all works.

Not sure what's going on but this seems to be a container issue.

So I just went to the Dockerfile and changed phpdockerio/php:8.1-fpm to phpdockerio/php:8.0-fpm and now curl works just fine. I able to run composer create-project ... without issues.

It works fine here on my end:

image
image

The errors you are getting are of networking, not from the container. Networking is provided by the docker daemon. It is possible the error was simply temporary or that your docker service on your host has got screwy (you also have some strange file access issues) and needs a restart. This happens more often on docker desktop, if you're using that on the mac or windows.

I'm on a linux vm, never had any issues.

Marking issue as stale