title: Calling redis-cli in docker-compose setup
body: <p>I run the official Redis image <a href="https://hub.docker.com/_/redis/" rel="noreferrer">https://hub.docker.com/_/redis/</a> in a <code>docker-compose</code> setup.  </p>
  
  <pre><code>myredis:
    image: redis
  </code></pre>
  
  <p>How can run <code>redis-cli</code> with docker-compose on that image?<br>
  I tried the following, but it didn't connect:</p>
  
  <pre><code>docker-compose run myredis redis-cli
  &gt; Could not connect to Redis at 127.0.0.1:6379: Connection refuse
  </code></pre>
  
  <p>The docs of the image says that I should run:</p>
  
  <pre><code>docker run -it --rm \
  --link some-redis:redis \
  redis \
  sh -c 'exec redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"'
  </code></pre>
  
  <p>How does this translate to <code>docker-compose run</code>?</p>