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