bitcoind – connection rejected – Bitcoin Stack Exchange

I work with bitcoind in unbuntu 16.04. And a web server running in the Docker container. When I apologized to Curl in Containerbash
curl --user user: pass --data-binary & # 39; {"jsonrpc": "1.0", "method": "getblockchaininfo", "params":[]} & # 39; -H & # 39; content type: text / plain; & # 39; http://127.0.0.1:18332/

Answer is curl: (7) Unable to connect to 127.0.0.1 port 18332: Connection refused

inner address of the Docker 172.17.0.1
, But curl on the command line is alright.

Below is the setting .conf:

Server = 1
testnet = 1
rpcuser = user
rpcpassword = pass
rpcallowip = 172.17.0.1
rpcport = 18332
rpcconnect = 127.0.0.1

I have tried all possible combinations of IP address and port number. All results are "connection rejected"
Can anyone advise me how to solve the problem?
Many Thanks

Greetings, max