-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: optimize the Dockerfile to reduce the image size #86
Conversation
c7cd051
to
bf92d33
Compare
Hi, sorry for the late review, have you tested it already? is everything works well? |
@Yeuoly yes, i have tested it, everything works well. |
What about httpx, requests and jinja2, there are always some weird issues of those packages |
By the way, is it possible to add a Makefile for dify-sandbox to simplify the installation, compilation, image creation, and environment cleanup of the sandbox? Most Go projects have a Makefile. Also, add scripts directory to store the installation and compilation shell scripts. |
I agree, but it's not urgent, but also, github workflows need to be refactored as well, maybe you can contribute it : ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@hwzhuhao It looks like there is a compilation error during docker build https://github.com/langgenius/dify-sandbox/actions/runs/10935045578/job/30356121638 |
@blue-long which version are you currently testing? |
@hwzhuhao 0.2.9 |
@hwzhuhao |
@blue-long You can reopen an issue and provide detailed version information and logs. |
使用版本:https://github.com/langgenius/dify-sandbox/releases/tag/0.2.9 dify-sandbox 走了这部分逻辑 [INFO]lib.Seccomp allowed_syscalls: [64 57 56 63 62 61 98 222 214 226 215 139 135 132 216 146 144 174 172 173 178 93 94 131 134 29 124 100 99 293 20 113 169 101 21 115 72 85 86 87 278], allowed_not_kill_syscalls: [220 34] lib.Seccomp 添加 syscalls 权限,并没有报错 执行成功的时候拥有的 syscalls 权限和执行失败是一样: [INFO]lib.Seccomp allowed_syscalls: [64 57 56 63 62 61 98 222 214 226 215 139 135 132 216 146 144 174 172 173 178 93 94 131 134 29 124 100 99 293 20 113 169 101 21 115 72 85 86 87 278], allowed_not_kill_syscalls: [220 34] |
@blue-long I didn't reproduce this issue. Maybe you can try removing the allowed_syscalls setting, try it again. |
这个问题做相关的分析,发现 sandbox 0.2.9 的 docker 镜像在 centOS 系统上部署,一切正常,没有出现 operation not permitted 问题, |
或许你可以从#99 (comment) |
1.Add the --no-install-recommends option to the apt-get install command to reduce unnecessary installations.
2.Run the apt-get clean command after apt-get install to reduce cache.
3.Run rm -rf /var/lib/apt/lists/* after apt-get install to ensure cache is removed within the same layer.
4.Use the --no-cache-dir option when installing Python packages to reduce the size.