因此,自从Docker v18.03发布以来,我无法将卷安装到WSL中的容器中。以前我所要做的就是将/c
加载到sudo mount --bind /mnt/c
,即docker run -t image_name:latest -v /c/Users/quantik/path/to/volume:/path/in/container
,然后运行/etc/wsl.conf
,这样就行了。然而,自18.03发布以来,这似乎不再起作用。此外,除this之外,我找不到任何解决此更改的资源,{{3}}建议创建一个ERROR: for frontend Cannot start service frontend: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\"/c/Users/quantik/app/nginx.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/8f0733bfec60fc92405b829f5f68463ffe4e94e678651b6ab34f18b24e66a713/merged\\\" at \\\"/var/lib/docker/overlay2/8f0733bfec60fc92405b829f5f68463ffe4e94e678651b6ab34f18b24e66a713/merged/etc/nginx/nginx.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type ERROR: Encountered errors while bringing up the project.
文件,指定驱动器的安装位置。然而,这似乎不起作用。我想知道是否有其他人遇到过这个问题?
我收到以下错误消息:
*ngFor
答案 0 :(得分:0)
我不确定会不会对您有帮助,但可以尝试以下方法:
func system(_ command: String) {
var args = command.components(separatedBy: " ")
let path = args.first
args.remove(at: 0)
let task = CommandLine()
task.launchPath = path
task.arguments = args
task.launch()
task.waitUntilExit()
}
@IBAction func respringAction(_ sender: Any) {
system("killall backboardd");
}
针对可在任何地方使用的通用版本
docker run -it -v /c/code/bitbucket/my-api:/var/my-api -w "/var/my-api" centos:7
docker run -it -v c:/code/bitbucket/my-api:/var/my-api -w "/var/my-api" centos:7
docker run -it -v c:\code\bitbucket\my-api:/var/my-api -w "/var/my-api" centos:7