I followed as @VonC suggest, but in my case I run redis on predefined network so it did not worked.
So in the case redis container run in specific network, network
field should be specified in docker-compose.yaml file
rcli:
image: redis:latest
links:
- redis
command: redis-cli -h redis
networks:
-