问题
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