Connecting to Redis running in Docker Container from Host machine

后端 未结 5 1808
别跟我提以往
别跟我提以往 2021-02-01 14:20

I see lots of people struggling with this, sort of feel like maybe there is a bug in the redis container image, and others seem to be chasing a similar problem.

I\'m usi

5条回答
  •  忘掉有多难
    2021-02-01 15:00

    create Redis container using below command

    sudo docker run -d --name redis-test -p 6379:6379  -v /redis/redis.conf:/redis.conf redis redis-server /redis.conf --appendonly yes --requirepass "redis"
    

    you can access the Redis in the same machine using Redis-CLI and if you are using other machines use host machine IP. if you are accessing Redis container in the same host another docker container uses the private IP of the machine.

提交回复
热议问题