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 “http://repo.packagist.org/p/consolidation/filter-via-dot-access-data%249bff9039eab71580e6bd05bed92385034a6d6746a1d1110797fe6d9d38373b52.json” file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
[Composer\Downloader\TransportException]
The “http://repo.packagist.org/p/consolidation/filter-via-dot-access-data%2 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

https://travis-ci.org/mxr576/swagger_ui_formatter/jobs/567736836

Okay, so it seems builds are only failing if I run Composer install inside a container. Any idea why?
https://travis-ci.org/mxr576/swagger_ui_formatter/jobs/567759667

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

Imprint