Open afoltzm opened 4 years ago
I just confirmed this is an Alpine issue - using debian:stable-slim
as the base image and converting the relevant apk
command to apt-get install ...
resulted in a successful build. This solves the issue for what I need to get started. If Alpine builds are not a priority for you, then please feel free to close this.
FYI: Clj-kondo and babashka publish releases that use the --static
flag which can run on Alpine. The newest GraalVM (20.2.0) offers more fine-grained static possibilities which I haven't used yet.
Step 14/16 : RUN ldd /usr/local/bin/bootleg
---> Running in a6012cf1b3f4
/lib64/ld-linux-x86-64.so.2 (0x7fb423c72000)
Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/local/bin/bootleg)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7fb423c72000)
libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7fb423c72000)
Error relocating /usr/local/bin/bootleg: _Znam: symbol not found
Error relocating /usr/local/bin/bootleg: __strdup: symbol not found
Error relocating /usr/local/bin/bootleg: __strtok_r: symbol not found
Error relocating /usr/local/bin/bootleg: _ZdaPv: symbol not found
libz.so.1 => /lib/libz.so.1 (0x7fb41fbe6000)
librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7fb423c72000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fb423c72000)
In 2022, it's recommended to compile using musl and not use the --static
flag as a standalone option. If musl is not an option, then a "mostly static" image (everything except glibc) is also an option.
https://www.graalvm.org/22.0/reference-manual/native-image/StaticImages/
Hi there! Thanks for putting together this great library, and for making it available to Babashka users as a pod. I'm trying to get it set up in Docker for some lightweight documentation tasks, but I'm coming across a strange issue where I can't find the binary on Alpine linux after installing it.
Here's a
Dockerfile
that reproduces the issue:The output of the
ls -la /usr/local/bin
step shows the following:so it's clearly there and it's marked as executable, but attempting to execute it fails further down in the
Dockerfile
.Is this because there's a runtime dependency for
bootleg
orGraalVM
that the Alpine base image lacks?babashka
's static binary appears to work just fine without any additional dependencies.Happy to provide any additional information if need be.