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
staticx and pyinstaller - confused #5607
Comments
Your using onefile mode - that's never going to work because a onefile application is really an archive. PyInstaller already bundles anything that your code is linked against so its unlikely that staticx will find anything extra. |
Thank you for your response. I agree that staticx will not find much of anything else, which is perfect, but it should bind in Glibc, this will allow me to go to a smaller container by using the scratch image for instance, as discussed in this blog: The problem I seem to have has been raised previously here: and suggests that rolling back to pyinstaller 4.0 fixes the issue. For me this did not work. If I am totally off the mark then happy to try to a different approach, at the moment I have a small program in a 300 Mb linux container. |
If your already using docker and trying to produce a docker image, why bother with PyInstaller at all? You could just take a Python docker base image, install your code into it then ship the resultant image. That should run universally AFAIK. |
I agree I could do that, but it would be a docker container whose size would be quite large. I have a number of these containers to ship and each one is around 300+ Mb when installed. |
The motivation and reasons for using
And then rebuild your onefile program and process it with |
Thank you rokm for your response. I followed your instructions which worked perfectly and resulted in pyinstaller-5.0.dev0 being built and installed. Please ignore the above, created a new project with exactly the same code and when built it now works! Thank you. |
I have read through the various bug report etc. but I am confused about how to solve the issues.
I want to use staticx on a single file that I have created by pyinstaller - F main.py, for example.
I get the following error :
[332529] Cannot open self /tmp/staticx-OOLCLA/main or archive /tmp/staticx-OOLCLA/main.pkg
Main simply spins up a flask app
I thought I could fix this by simply going back to version 4.0 of pyinstaller since this had a bootloader compiled with the correct pie settings for this this to work.
However in my case it does not.
Are there any definitive instructions of how to get staticx to work with pysintaller?
I appreciate any assistance, I am trying to get a 300+MB docker container down to something that is more sensible.
The text was updated successfully, but these errors were encountered: