如题,我现在使用下面的命令没有办法创建 siyuan 的 docker,启动后会直接 exit
docker run -it -d \
b3log/siyuan:latest \
--name siyuan \
-v /root/docker/siyuan:/siyuan \
-p 30000:6806 \
--restart=always \
-workspace=/siyuan
请问是哪里写的不对吗?--workspace=/siyuan
也试过,也不行。
献丑了,如果要指定 docker 中运行的命令,应该要把 docker 镜像的名字放在后头。下面的命令可以完美启动思源,但还是有问题!
docker run -d \
--name siyuan \
-v /root/docker/siyuan:/root/docker/siyuan \
-p 30000:6806 \
--restart=always \
b3log/siyuan:latest \
--workspace=/root/docker/siyuan \
--lang=zh_CN \
--accessAuthCode=123456
可是用上面的 docker 命令创建的思源容器,会出现如下找不到路径的错误,docker 内部没办法找到我标出来的这个路径。会自己改动成一个新的工作路径。
W 2023/11/16 10:11:39 file.go:262: determines whether [/root/docker/siyuan] is a directory failed: [lstat /root/docker/siyuan: permission denied]
W 2023/11/16 10:11:39 working.go:225: use the default workspace [/home/siyuan/SiYuan] since the specified workspace [/root/docker/siyuan] is not a dir
我尝试弄一个特殊的路径出来,比如 /var/siyuan
,但还是会显示没有权限,我应该怎么解决这个问题?
docker run -d \
--privileged \
--name siyuan \
-v /var/siyuan:/var/siyuan \
-p 30000:6806 \
--restart=always \
b3log/siyuan:latest \
--workspace=/var/siyuan \
--lang=zh_CN \
--accessAuthCode=123456
E 2023/11/16 11:29:23 working.go:247: create os tmp dir [/var/siyuan/temp/os] failed: mkdir /var/siyuan/temp: permission denied
E 2023/11/16 11:29:24 working.go:247: create os tmp dir [/var/siyuan/temp/os] failed: mkdir /var/siyuan/temp: permission denied
E 2023/11/16 11:29:25 working.go:247: create os tmp dir [/var/siyuan/temp/os] failed: mkdir /var/siyuan/temp: permission denied