Closed ctrohin closed 1 month ago
Please provide the full command and error message.
This is basically all I can get from my docker build console:
[transformer 8/8] RUN staticx /app/cloud-connector-arm-non-static /app/cloud-connector-arm: 2.234 staticx: GLIBC binary detected but libnssfix.so not available
Dockerfile-ysl:27
25 | WORKDIR /app 26 | COPY --from=build /app/dist/cloud-connector-aarch64 /app/cloud-connector-arm-non-static 27 | >>> RUN staticx /app/cloud-connector-arm-non-static /app/cloud-connector-arm 28 |
29 | FROM arm64v8/ubuntu:22.04 AS packagerERROR: failed to solve: process "/bin/sh -c staticx /app/cloud-connector-arm-non-static /app/cloud-connector-arm" did not complete successfully: exit code: 2
Managed to capture a more detailed error log by using staticx --debug. Here it is:
[transformer 8/8] RUN staticx --debug /app/cloud-connector-arm-non-static /app/cloud-connector-arm: 3.417 generate(args.prog, args.output, 3.417 File "/usr/local/lib/python3.10/site-packages/staticx/api.py", line 328, in generate 3.419 gen.generate(output=output) 3.419 File "/usr/local/lib/python3.10/site-packages/staticx/api.py", line 134, in generate 3.420 run_hooks(self) 3.420 File "/usr/local/lib/python3.10/site-packages/staticx/hooks/init.py", line 12, in run_hooks 3.421 hook(sx) 3.421 File "/usr/local/lib/python3.10/site-packages/staticx/hooks/glibc.py", line 18, in process_glibc_prog 3.422 raise InternalError("GLIBC binary detected but libnssfix.so not available") 3.422 staticx.errors.InternalError: GLIBC binary detected but libnssfix.so not available
Dockerfile-ysl:27
25 | WORKDIR /app 26 | COPY --from=build /app/dist/cloud-connector-aarch64 /app/cloud-connector-arm-non-static 27 | >>> RUN staticx --debug /app/cloud-connector-arm-non-static /app/cloud-connector-arm 28 |
29 | FROM arm64v8/ubuntu:22.04 AS packagerERROR: failed to solve: process "/bin/sh -c staticx --debug /app/cloud-connector-arm-non-static /app/cloud-connector-arm" did not complete successfully: exit code: 1
Some updates... What I've been doing is building the pyinstaller one file bundle on an alpine container, then tried to build the static binary on a Ubuntu container. I've moved both steps (pyinstaller onefile + staticx) in the same alpine container, and I managed to build it. It did threw some relocation warnings, but it did build it. I've tried running it on an arm64 machine and it did run. I also need to do the same on a arm32 machine.
Latest update: I managed to build a static binary from the pyinstaller output as long as I have used the same Docker file for both operations. Didn't work on Ubuntu 22, seems that staticx was just stuck on ldd-ing the original binary, but it did work with an Alpine linux image. Closing the issue
Hello! I'm trying to build a static binary from a pyinstaller one file output. Below you have my docker setup. I'm getting this libnssfix.so not available error message.
Can you please tell me if I'm missing a library or something? And if so, which library do I need in order to avoid this error.
Thanks