大佬们,有没有在 Docker 跑过记忆神器 AnkiServer 的经验?首次在 docker 跑,运行失败,虚心求教。 我是 Docker 新手,不是很懂 docker 的机制,麻烦大佬指点。谢谢
$ sudo docker run -it --name AnkiServer -p 27701:27701 -v /volume1/anki:/anki lertsenem/anki-server
# 输入以下日志
Missing 'production.ini' in anki root dir: adding...
cp: can't stat '/anki/production.ini': Permission denied
Missing 'collections' in anki root dir: adding...
cp: can't stat '/anki/collections': Permission denied
Missing 'auth.db' in anki root dir: adding...
cp: can't stat '/anki/auth.db': Permission denied
Traceback (most recent call last):
File "/usr/bin/paster", line 11, in <module>
sys.exit(run())
File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
result = self.command()
File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 282, in command
relative_to=base, global_conf=vars)
File "/usr/lib/python2.7/site-packages/paste/script/serve.py", line 324, in loadserver
relative_to=relative_to, **kw)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 255, in loadserver
return loadobj(SERVER, uri, name=name, **kw)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 271, in loadobj
global_conf=global_conf)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
global_conf=global_conf)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 317, in _loadconfig
loader = ConfigLoader(path)
File "/usr/lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 393, in __init__
with open(filename) as f:
IOError: [Errno 13] Permission denied: '/anki/production.ini'
1
pengwen 2018-12-27 00:42:34 +08:00
文件权限问题
暴力解决方法是给 /volume1/anki 文件 777 权限 或者 chown -R 33333 /volume1/anki 33333 是 lertsenem/anki-server 容器里面的 anki 用户 id |
2
maleclub OP @pengwen 你好,lertsenem/anki-server 容器里面的 anki 用户 id,这里不怎么怎么查看 anki 用户 id,可以详细指点下吗?感谢
|
3
maleclub OP 容器里面的 anki 用户 id,这里通过什么命令查看的?可以详细指点下吗?感谢
|
4
maleclub OP @pengwen 折腾了下,刚刚才搞清楚原来用户 id 33333 是自动分配的。谢谢你的指点哦。另外,如果我还想请教下你是怎么新建用户?
|
6
maleclub OP @pengwen 嗯嗯,老哥,搭建好后遇到个奇怪问题:Android 客户端正常登陆和同步资料,windows 和 MacOS 客户端总提示密码错误,有解吗?麻烦你了,感谢。
我的操作流程如下,不知道有没有疏漏: 1. MacOS 客户端在路径 /Users/用户名 /Library/Application Support/Anki2 加入 python 脚本文件 mysyncserver.py (内容如下) 「 Windows 客户端同理,在路径 用户名 /Anki/addons 加入脚本文件 」 ```python import anki.sync anki.sync.SYNC_BASE = 'http://192.168.1.2:27701/' anki.sync.SYNC_MEDIA_BASE = 'http://192.168.1.2:27701/msync/' ``` 2. 重启 anki 3. 使用默认用户 anki 默认密码 anki 登陆.....提示用户名或密码错我.....我知道账户和密码是没错的 有劳你了。谢 |
8
maleclub OP 好的,感谢
|