justxuewei / cloudreve-docker

Source code of Docker image for Cloudreve V3
https://hub.docker.com/r/xavierniu/cloudreve
MIT License
220 stars 51 forks source link

docker run OC方式 容器启动失败 #7

Closed guest6379 closed 4 years ago

guest6379 commented 4 years ago

docker run -d --name cloudreve -p 5212:5212 -v uploads:/cloudreve/uploads -v conf.ini:/cloudreve/conf.ini -v cloudreve.db:/cloudreve/cloudreve.db xavierniu/cloudreve

启动失败

docker logs

  ___ _                 _                    
  / __\ | ___  _   _  __| |_ __ _____   _____ 
 / /  | |/ _ \| | | |/ _ | '__/ _ \ \ / / _ \
/ /___| | (_) | |_| | (_| | | |  __/\ V /  __/
\____/|_|\___/ \__,_|\__,_|_|  \___| \_/ \___|

   V3.0.0  Commit #9910f8d  Pro=false
================================================

[Panic]   2020-05-04 20:55:03 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory
panic: 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory

goroutine 1 [running]:
github.com/HFO4/cloudreve/pkg/util.(*Logger).Panic(0xc000036308, 0xf0e564, 0x21, 0xc00058fbb8, 0x2, 0x2)
        /ProjectCloudreve/Cloudreve/pkg/util/logger.go:68 +0xe2
github.com/HFO4/cloudreve/pkg/conf.Init(0xc0000384a0, 0x13)
        /ProjectCloudreve/Cloudreve/pkg/conf/conf.go:110 +0x1c9
github.com/HFO4/cloudreve/bootstrap.Init(0xc0000384a0, 0x13)
        /ProjectCloudreve/Cloudreve/bootstrap/init.go:18 +0x3e
main.init.0()
        /ProjectCloudreve/Cloudreve/main.go:16 +0x120
justxuewei commented 4 years ago

你需要用touch命令预创建ini和db文件

发自我的iPhone

在 2020年5月4日,下午8:56,guest6379 notifications@github.com 写道:

 docker run -d --name cloudreve -p 5212:5212 -v uploads:/cloudreve/uploads -v conf.ini:/cloudreve/conf.ini -v cloudreve.db:/cloudreve/cloudreve.db xavierniu/cloudreve

启动失败

docker logs


/ \ | _ | |_ / / | |/ | | | |/ | '/ \ \ / / \ / /__| | () | || | (| | | | /\ V / / ___/||_/ _,|_,|_| _| _/ _|

V3.0.0 Commit #9910f8d Pro=false

[Panic] 2020-05-04 20:55:03 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory panic: 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory

goroutine 1 [running]: github.com/HFO4/cloudreve/pkg/util.(*Logger).Panic(0xc000036308, 0xf0e564, 0x21, 0xc00058fbb8, 0x2, 0x2) /ProjectCloudreve/Cloudreve/pkg/util/logger.go:68 +0xe2 github.com/HFO4/cloudreve/pkg/conf.Init(0xc0000384a0, 0x13) /ProjectCloudreve/Cloudreve/pkg/conf/conf.go:110 +0x1c9 github.com/HFO4/cloudreve/bootstrap.Init(0xc0000384a0, 0x13) /ProjectCloudreve/Cloudreve/bootstrap/init.go:18 +0x3e main.init.0() /ProjectCloudreve/Cloudreve/main.go:16 +0x120 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

guest6379 commented 4 years ago

开始报错以后,我尝试手动建立了upload目录 conf.ini和cloudreve.db文件,但还是报错。 难道我记错了?我再试试

guest6379 commented 4 years ago

还是报错,日志如下

[root@helloworld d]# ls
cloudreve_3.0.0_linux_amd64.tar.gz  ok
[root@helloworld d]# touch conf.ini cloudreve.db && mkdir uploads
[root@helloworld d]# ls
cloudreve_3.0.0_linux_amd64.tar.gz  cloudreve.db  conf.ini  ok  uploads
[root@helloworld d]# docker run -d   --name cloudreve   -p 5212:5212   -v uploads:/cloudreve/uploads -v conf.ini:/cloudreve/conf.ini   -v cloudreve.db:/cloudreve/cloudreve.db   xavierniu/cloudreve
c630ac7434fd84cea22b6852392d38977d9a047f1366561efe963f093fb58662
[root@helloworld d]# docker logs cloudreve

   ___ _                 _                    
  / __\ | ___  _   _  __| |_ __ _____   _____ 
 / /  | |/ _ \| | | |/ _ | '__/ _ \ \ / / _ \
/ /___| | (_) | |_| | (_| | | |  __/\ V /  __/
\____/|_|\___/ \__,_|\__,_|_|  \___| \_/ \___|

   V3.0.0  Commit #9910f8d  Pro=false
================================================

[Panic]   2020-05-04 21:32:41 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory
panic: 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory

goroutine 1 [running]:
github.com/HFO4/cloudreve/pkg/util.(*Logger).Panic(0xc0001fae98, 0xf0e564, 0x21, 0xc0002adbb8, 0x2, 0x2)
        /ProjectCloudreve/Cloudreve/pkg/util/logger.go:68 +0xe2
github.com/HFO4/cloudreve/pkg/conf.Init(0xc000038620, 0x13)
        /ProjectCloudreve/Cloudreve/pkg/conf/conf.go:110 +0x1c9
github.com/HFO4/cloudreve/bootstrap.Init(0xc000038620, 0x13)
        /ProjectCloudreve/Cloudreve/bootstrap/init.go:18 +0x3e
main.init.0()
        /ProjectCloudreve/Cloudreve/main.go:16 +0x120
[root@helloworld d]# 
justxuewei commented 4 years ago

还是报错,日志如下

[root@helloworld d]# ls
cloudreve_3.0.0_linux_amd64.tar.gz  ok
[root@helloworld d]# touch conf.ini cloudreve.db && mkdir uploads
[root@helloworld d]# ls
cloudreve_3.0.0_linux_amd64.tar.gz  cloudreve.db  conf.ini  ok  uploads
[root@helloworld d]# docker run -d   --name cloudreve   -p 5212:5212   -v uploads:/cloudreve/uploads -v conf.ini:/cloudreve/conf.ini   -v cloudreve.db:/cloudreve/cloudreve.db   xavierniu/cloudreve
c630ac7434fd84cea22b6852392d38977d9a047f1366561efe963f093fb58662
[root@helloworld d]# docker logs cloudreve

   ___ _                 _                    
  / __\ | ___  _   _  __| |_ __ _____   _____ 
 / /  | |/ _ \| | | |/ _ | '__/ _ \ \ / / _ \
/ /___| | (_) | |_| | (_| | | |  __/\ V /  __/
\____/|_|\___/ \__,_|\__,_|_|  \___| \_/ \___|

   V3.0.0  Commit #9910f8d  Pro=false
================================================

[Panic]   2020-05-04 21:32:41 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory
panic: 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory

goroutine 1 [running]:
github.com/HFO4/cloudreve/pkg/util.(*Logger).Panic(0xc0001fae98, 0xf0e564, 0x21, 0xc0002adbb8, 0x2, 0x2)
        /ProjectCloudreve/Cloudreve/pkg/util/logger.go:68 +0xe2
github.com/HFO4/cloudreve/pkg/conf.Init(0xc000038620, 0x13)
        /ProjectCloudreve/Cloudreve/pkg/conf/conf.go:110 +0x1c9
github.com/HFO4/cloudreve/bootstrap.Init(0xc000038620, 0x13)
        /ProjectCloudreve/Cloudreve/bootstrap/init.go:18 +0x3e
main.init.0()
        /ProjectCloudreve/Cloudreve/main.go:16 +0x120
[root@helloworld d]# 

我看着似乎没什么问题了,你试一试docker rm -f cloudreve后再试试

justxuewei commented 4 years ago

另外加上相对路径试一试-v ./conf.ini:/cloudreve/conf.ini -v ./cloudreve.db:/cloudreve/cloudreve.db

guest6379 commented 4 years ago

还是报错,日志如下

[root@helloworld d]# ls
cloudreve_3.0.0_linux_amd64.tar.gz  ok
[root@helloworld d]# touch conf.ini cloudreve.db && mkdir uploads
[root@helloworld d]# ls
cloudreve_3.0.0_linux_amd64.tar.gz  cloudreve.db  conf.ini  ok  uploads
[root@helloworld d]# docker run -d   --name cloudreve   -p 5212:5212   -v uploads:/cloudreve/uploads -v conf.ini:/cloudreve/conf.ini   -v cloudreve.db:/cloudreve/cloudreve.db   xavierniu/cloudreve
c630ac7434fd84cea22b6852392d38977d9a047f1366561efe963f093fb58662
[root@helloworld d]# docker logs cloudreve

   ___ _                 _                    
  / __\ | ___  _   _  __| |_ __ _____   _____ 
 / /  | |/ _ \| | | |/ _ | '__/ _ \ \ / / _ \
/ /___| | (_) | |_| | (_| | | |  __/\ V /  __/
\____/|_|\___/ \__,_|\__,_|_|  \___| \_/ \___|

   V3.0.0  Commit #9910f8d  Pro=false
================================================

[Panic]   2020-05-04 21:32:41 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory
panic: 无法解析配置文件 '/cloudreve/conf.ini': BOM: read /cloudreve/conf.ini: is a directory

goroutine 1 [running]:
github.com/HFO4/cloudreve/pkg/util.(*Logger).Panic(0xc0001fae98, 0xf0e564, 0x21, 0xc0002adbb8, 0x2, 0x2)
        /ProjectCloudreve/Cloudreve/pkg/util/logger.go:68 +0xe2
github.com/HFO4/cloudreve/pkg/conf.Init(0xc000038620, 0x13)
        /ProjectCloudreve/Cloudreve/pkg/conf/conf.go:110 +0x1c9
github.com/HFO4/cloudreve/bootstrap.Init(0xc000038620, 0x13)
        /ProjectCloudreve/Cloudreve/bootstrap/init.go:18 +0x3e
main.init.0()
        /ProjectCloudreve/Cloudreve/main.go:16 +0x120
[root@helloworld d]# 

我看着似乎没什么问题了,你试一试docker rm -f cloudreve后再试试

上面的日志就是删除过的干净环境,不知道怎么了? 而且 docker rm -f cloudreve 以后一样报错,删了很多次了,这个是什么原因啊?

我下载cloudreve的包直接运行就是ok的

guest6379 commented 4 years ago

是不是新版本改路径了,你docker里还用的是老路径?

justxuewei commented 4 years ago

并没有 你可以参考dockerfile,建议你为了防止路径错误,这一次启动全部使用完整路径,并删除全部的文件和文件夹做一次测试。

启动的方式可以参见CAC的Step5和Step6

guest6379 commented 4 years ago

另外加上相对路径试一试-v ./conf.ini:/cloudreve/conf.ini -v ./cloudreve.db:/cloudreve/cloudreve.db

这点忽略了,马上去试试!

guest6379 commented 4 years ago

相对路径docker会报错 ok了,在文件前面加上绝对路径。 谢谢大佬调教!