Calling redis-cli in docker-compose setup

后端 未结 3 1327
一整个雨季
一整个雨季 2021-01-31 09:31

I run the official Redis image https://hub.docker.com/_/redis/ in a docker-compose setup.

myredis:
  image: redis

How can run

3条回答
  •  攒了一身酷
    2021-01-31 10:04

    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: 
        - 
    

提交回复
热议问题