docker volume create data_redis
docker run -v data_redis/redis.conf:/etc/redis/redis.conf \
-v data_redis/data:/data \
-d --name some-redis \
-p 6379:6379 \
redis:latest redis-server /etc/redis/redis.conf
我先在宿主机创建了一个目录卷积data_redis,然后映射/etc/redis/redis.conf到宿主机的data_redis目录,映射/data到宿主机的data_redis/data目录,执行命令后,data_redis目录倒是创建了,但是后面的语句报错
docker: Error response from daemon: create data_redis/redis.conf: "data_redis/redis.conf" includes invalid characters for a local volume name, only "a-zA-Z0-9" are allowed. If you intended to pass a host directory, use absolute path.
See 'docker run --help'.
为什么呢,我要怎么改?
宿主机的目录data_redis,这个命名不符合规则,改一下吧,only "a-zA-Z0-9"