Starting redis-cli container in interactive mode results in freeze

Expected behavior

able to type input for the redis-cli

Actual behavior

terminal freeze and no way to get out (except killing the terminal session)


Weird thing is, that when connecting to the container and starting a shell via ‘docker exec -i -t redis-cli /bin/bash’, the redis-cli (/redis/src/redis-cli) can be started without problems

The same issue arises when running the containers on a new docker host, created with docker-machine

Steps to reproduce the behavior

  1. docker run -d --name redis crosbymichael/redis
  2. write down IPADRESS of redis container via ‘docker inspect redis | grep IPA’
  3. docker run -i -t --name=redis-cli --rm relateiq/redis-cli -h IPADDRESS

My docker version is: 1.12.0-rc3, build 91e29e8, experimental
Running on OSX El Capitan 10.11.5 (15F34) with docker app version 1.12.0-rc3-beta18 (build: 9996)

I don’t know if it’s related to your problem, but steps 2 and 3 are wrong. You should do

docker run -d --name redis crosbymichael/redis
docker run -it --rm --link redis:redis relateiq/redis-cli -h redis

The --link option tells the second container that a DNS name “redis” maps to the running container named “redis”. You don’t need to know the IP address of the container, and you generally shouldn’t be trying to access it directly.

Thanks for the quick reply David!

Sadly I forgot to mention that I also tried the “default” way with linking both containers.
Same issue, with the exception that when I check the env on the redis-cli box, it shows the correct DB settings from the redis container.

Could be a bug perhaps?

–> Solution: upgraded docker to rc4 and issue resolved :smile: