Docker Minimal Image PyInstaller Binary File?

时光毁灭记忆、已成空白 提交于 2020-07-23 09:11:24

问题


So I have a Docker image that basically consists of compiling python source code to standalone executable with RUN pyinstaller --onefile app.py in the build stage (after all deps for pyinstaller and python installed). It then copies the standalone executable to a scratch image using COPY --from=builder /dist/app /app. It executes the binary on entrypoint. However in the scratch image, I am getting standard_init_linux.go:211: exec user process caused "no such file or directory" error when the binary is executed. It is statically linked.

My Searches

I fouund many posts talking about dos vs unix newlines, and I used dos2unix, but since it is a binary file, as I found, dos2unix didn't work. I also tried copying in the .spec file, to no avail. A solution would be much appreciated.

来源:https://stackoverflow.com/questions/61262156/docker-minimal-image-pyinstaller-binary-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!