docker 绑定安装卷的名称类似于 "ts_00:00:00",即名称中有一列

docker bind mount volume named like "ts_00:00:00", i.e. with a column in name

我发现我无法对名称中包含一列的卷执行绑定挂载,例如

docker run -v /mnt/fs/ts_00\:00\:00:/mnt/data container_name bash

失败

docker: Error response from daemon: invalid volume specification: '/mnt/fs/ts_00:00:00:/mnt/data'.

我想知道是否有可能获得一个名称中包含列的卷,以在 docker 容器内绑定挂载。

使用 --mount 而不是 -v 因为冒号是 -v 参数中 source/target 的分隔符 (source)

不确定 ts_00:00:00 是文件还是目录

我运行这个和这个有效

mkdir "ts_00:00:00"
docker run --rm --mount type=bind,source=$(pwd)/ts_00:00:00/,destination=/tmp/hi -it bash

已尝试根据您提供的内容为您准备命令,但不确定是否正确

docker run --mount type=bind,source=/mnt/fs/ts_00:00:00,destination=/mnt/data -it container_name bash

查看更多in the GitHub issue