Collabora docker cannot ping the internet

Given that I could ping the host server and that the nextcloud server is on this very host, I tried to add the nextcloud domain with this IP in the hosts file of the container, as follow :

docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=my\\.server' --add-host my.server:172.17.0.1 collabora/code:6.4.8.1

(and 172.17.0.1 being the host IP in the docker container)

I can now access documents and collaborate, but not sure this tweak will hold for long.