Windows中的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,结果相同。