定制

自定义SeaTable Python运行器
从文档 部署SeaTable Python运行器,我们可以看到 Python Runner 是启动了新容器来运行脚本,启动容器使用的镜像是我们提供的标准镜像,docker.seafile.top/seafileltd/seatable-python-runner,内置了一些可能用到的第三方包,详情见 编程手册。
如果你需要安装额外的第三方包,就需要对镜像进行定制。
定制镜像
下文将以 加装qrcode库 为例子进行定制镜像的说明
拉取镜像
dockerpulldocker.seafile.top/seafileltd/seatable-python-runner:latest
以后台程序启动镜像,并把容器名叫做 add-libs
dockerrun-d--name="add-libs"docker.seafile.top/seafileltd/seatable-python-runner:latestcustom
进入容器
dockerexec-itadd-libssh
安装自己需要的第三方库或者其他自定义程序,完成后退出容器
/settings # pip install qrcode
提交新镜像
dockercommit-m"add qrcode"--change"CMD null"add-libsdocker.seafile.top/seafileltd/seatable-python-runner:qrcode
使用新镜像,更改 .env 文件替换镜像
...

SEATABLE_RUNNER_IMAGE=docker.seafile.top/seafileltd/seatable-python-runner:qrcode