我配置的docker-compose.yaml如下:
redisClusterNode1Master:
container_name: redisClusterNode1Master
image: "redis:3.2"
networks:
- kay_default
ports:
- "8081:6379"
privileged: true
执行 docker-compose up -d 命令时报错
ERROR: Service "redisClusterNode1Master" uses an undefined network "kay_default"
提示没有该网络,即使后面我自己手动创建 docker network create kay_default
NETWORK ID NAME DRIVER SCOPE
f25f324bc925 bridge bridge local
b5c6f7d5f6c6 host host local
a890e95d6d4a kay_default bridge local
了也一直报该错误.
请问这是怎么回事?
需要在services同级声明一下外部网络