Builds with Composer are failing because of a DNS error

All builds are failing since last Friday that tries to install dependencies with Composer in a Docker container with the following error:

The “” file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check for more info
The “ 49bff9039eab71580e6bd05bed92385034a6d6746a1d1110797fe6d9d38373b52.json” fil
e could not be downloaded: php_network_getaddresses: getaddrinfo failed: Na
me does not resolve
failed to open stream: php_network_getaddresses: getaddrinfo failed: Name d
oes not resolve

Okay, so it seems builds are only failing if I run Composer install inside a container. Any idea why?

FYI, Also having network issues in Travis - Travis Network Timeout Issue