XWiki can't connect to remote SOLR using docker

I ran into the same issue and this is caused by a bug in the Docker image, more specifically in docker-entrypoint.sh. There already is a pull request that fixes this, but it has not been merged yet.
The easiest workaround is editing /usr/local/xwiki/data/xwiki.properties inside the Docker container (this file is stored on the volume, so changes are going to be preserved) and adding the following line:

solr.remote.baseURL=http://solr-server:8983/solr

You most likely will also have to create all the necessary cores inside the SOLR Docker container. The documentation for the Docker image is outdated in this regard, but https://extensions.xwiki.org/xwiki/bin/view/Extension/Solr%20Search%20API gives the correct list of cores and links to the JARs and ZIP archives that should be extracted to create each respective core.