redis connect timeout to remote server in a docker

I start a redis container with docker-compose in machine A.


  • how manage users and groups to share data between multiple containers?
  • how many docker containers should a java web app w/ database have?
  • How to log docker build installation package errors
  • DNS Server in Docker Container
  • Adding a new NIC to a Docker container in a specific order
  • Docker swarm mode - no published ports on worker nodes
  • redis:
        - "6379:6379"
        image: redis

    on machine A, I can connect to it with redis-cli in terminal.


    But I can’t connect to it use A’s IP on machine B even on machine A itself.

    on machine B or A.

    redis-cli -h
    Could not connect to Redis at Connection timed out
    not connected> 

  • 502 Bad Gateway error using Docker-Compose and nginx-proxy
  • mounting external drives to a Docker container
  • Is it possible to create image from file on docker host using docker API?
  • Launch Docker containers to handle HTTP requests
  • Dockerfile inconsistent caching
  • Configuring docker container with ansible
  • One Solution collect form web for “redis connect timeout to remote server in a docker”

    It’s strange. I can run redis-cli on both host A and host B with A’s IP.
    Following is the output of “docker ps”

    docker ps
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
    a59c39bf448e        redis               "/ redis"   3 minutes ago       Up 3 minutes>6379/tcp   test_redis_1

    After mapping port 6379 of redis container to the host port 6379. The redis service should be available for all network interfaces( of host A. So you don’t have to change the redis configuration.

    Can you show the output of “docker ps”?

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.