snowdreamtech / frp

Docker Images for Frp. (amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, mips64le, ppc64le,riscv64, s390x)
https://github.com/snowdreamtech/frp
MIT License
622 stars 101 forks source link

docker: Error安装出现错误是什么原因? #11

Closed lhm518 closed 3 years ago

lhm518 commented 3 years ago

docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/etc/frp/frps.ini" to rootfs at "/var/lib/docker/overlay2/c0c54fc57d0f1d2af10c1eafa8c40832725cad331dc2862f15cdd1adc9ae613b/merged/etc/frp/frps.ini" 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.

Gaoyukun commented 3 years ago

我也遇到这个问题, 是因为一开始你没有/etc/frp/frps.ini这个文件, docker映射的时候在内部创建了一个文件夹, 后续都失败了. 你需要:

docker ps -a
docker rm -v <你旧的docker的名字>
rm -rf /etc/frp/frps.ini && touch /etc/frp/frps.ini

最后再运行:

docker run --restart=always --network host -d -v /etc/frp/frps.ini:/etc/frp/frps.ini --name frps snowdreamtech/frps
snowdream commented 3 years ago

docker: Error response from daemon: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/etc/frp/frps.ini" to rootfs at "/var/lib/docker/overlay2/c0c54fc57d0f1d2af10c1eafa8c40832725cad331dc2862f15cdd1adc9ae613b/merged/etc/frp/frps.ini" 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.

You need create your own frp config file: /etc/frp/frps.ini (for frps)or /etc/frp/frpc.ini (for frpc) Then you can download and run the docker image.