Which docker image are you using? And what precisely are you trying to do?
If you are using that one --
https://hub.docker.com/r/nicolasdorier/docker-bitcoin -- and are trying to run some RPC commands then maybe you still have to take care of the following:
By default, Docker runs all containers on a private bridge network. This means that you are unable to access the RPC port (8332) necessary to run bitcoin-cli commands.
There are several methods to run bitcoin-cli against a running bitcoind container. The easiest is to simply let your bitcoin-cli container share networking with your bitcoind container:
$ docker run -d --rm --name bitcoind -v bitcoin-data:/data NicolasDorier/bitcoin
$ docker run --rm --network container:bitcoind NicolasDorier/bitcoin bitcoin-cli getinfo