我正在尝试在WSL(Bash)上使用docker命令安装卷。但是我需要挂载的文件和文件夹不会显示在Docker上,因此,当我运行docker命令时,它显示未找到文件。
我正在尝试仅使用Alpine容器来查看是否可以使它工作。但是它也无法识别我在其上运行的目录中的所有文件/文件夹。
以下命令:
docker run --rm -v /c/Users/alexandrec/Desktop/AWS_Layers/pandas:/data alpine ls /data
返回:
test
此命令:
/mnt/c/Users/alexandrec/Desktop/AWS_Layers/pandas$ ls -la
返回:
-total 2238
-drwxrwxrwx 0 root root 512 May 29 15:22 .
-drwxrwxrwx 0 root root 512 May 29 14:56 ..
-rwxrwxrwx 1 root root 254 May 28 16:52 get_layer_packages.sh
-rwxrwxrwx 1 root root 85 May 29 11:31 my_module.py
-drwxrwxrwx 0 root root 512 May 29 15:22 New folder
-drwxrwxrwx 0 root root 512 May 28 16:49 python
-rwxrwxrwx 1 root root 28 May 28 14:56 requirements.txt
-drwxrwxrwx 0 root root 512 May 29 14:56 test
-drwxrwxrwx 0 root root 512 May 28 20:30 var
以某种方式,DIR中的大多数文件夹/文件都不会仅挂载test
。
最终我希望能够运行此程序:
docker run --rm -v "$PWD":/var/task lambci/lambda:python3.6 my_module.my_handler
当前返回的是:
START RequestId: d3df9063-56ea-4c56-b097-2932c633d74f Version: $LATEST
Unable to import module 'my_module': No module named 'my_module'
END RequestId: d3df9063-56ea-4c56-b097-2932c633d74f
REPORT RequestId: d3df9063-56ea-4c56-b097-2932c633d74f Duration: 0 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 19 MB
{"errorMessage": "Unable to import module 'my_module'"}
我只是似乎不知道这是权限问题还是与Windows / Docker / Linux交互有关的问题。
以下链接显示了我的bash终端命令:https://imgur.com/4tqpdaR
答案 0 :(得分:0)
好的,这是由于Windows凭据所致,需要对其进行更新。在Docker App中, 设置->共享驱动器->重置凭据
以管理员身份运行只是为了确保。