Skip to content
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

release binaries not working on alpine linux #272

Closed
tipruzs opened this issue Nov 14, 2021 · 2 comments · Fixed by #273
Closed

release binaries not working on alpine linux #272

tipruzs opened this issue Nov 14, 2021 · 2 comments · Fixed by #273

Comments

@tipruzs
Copy link

tipruzs commented Nov 14, 2021

Hi,

i was trying to create a pipeline based on k0sctl and alpine docker image, but noticed this is not working:

docker run -it --rm -w /tmp alpine:3.14
/tmp # wget -q https://github.com/k0sproject/k0sctl/releases/download/v0.11.4/k0sctl-linux-x64
/tmp # chmod +x k0sctl-linux-x64
/tmp # ./k0sctl-linux-x64 --help
sh: ./k0sctl-linux-x64: not found

A short investigation of the binary shows glibc dependencies, which should not be there.

/tmp # ldd k0sctl-linux-x64 
	/lib64/ld-linux-x86-64.so.2 (0x7f09af144000)
	libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f09af144000)
	libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f09af144000)
Error relocating k0sctl-linux-x64: __vfprintf_chk: symbol not found
Error relocating k0sctl-linux-x64: __fprintf_chk: symbol not found

There are already oher projects around dealing with this issue (influxdata/influxdb#5554)

My current workaround is using an alpine image with glibc (https://hub.docker.com/r/frolvlad/alpine-glibc/) but this should not be needed, if the issue can be fixed with a change in the build parameters of k0sctl.

Thanks in advance!

@kke
Copy link
Contributor

kke commented Nov 15, 2021

Hmm, the buildflags are already BUILD_FLAGS = -trimpath -a -tags "netgo static_build" -installsuffix netgo -ldflags "$(LD_FLAGS) -extldflags '-static'"

@kke
Copy link
Contributor

kke commented Nov 15, 2021

Looks like it needs osusergo in addition to netgo https://www.arp242.net/static-go.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants