Windows中的Docker将文件挂载为目录

时间:2016-01-13 09:11:43

标签: docker

我正在尝试在我的Powershell中运行此命令:

docker run -u postgres --net host -v /`pwd`/file.sql://tmp/setup.sql --rm postgres:9.4 psql -h localhost -U postgres -f //tmp/setup.sql my_db;

这给了我这个错误:

psql:/tmp/setup.sql:0: could not read from input file: Is a directory

我尝试通过此命令在该docker容器中运行bash:

docker run -it -u postgres --net host -v /`pwd`/file.sql://tmp/setup.sql --rm postgres:9.4 bash

然后在docker tty中做了一个简单的ls -l /tmp,它显示setup.sql文件实际上是目录

drwxr-xr-x 2 root root 40 Jan 13 08:39 setup.sql

我该怎么做呢?我也尝试过msysgit提供的bash shell,结果相同。

0 个答案:

没有答案