If I set the following environment variables in docker-compose.yml, it works.
environment:
- JAVA_OPTIONS="-Dhttp.proxyHost=proxyserver -Dhttp.proxyPort=port -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -Dhttps.proxyHost=proxyserver -Dhttps.proxyPort=port -Dhttps.proxyUser=username -Dhttps.proxyPassword=password”