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

Not working on alpine linux #194

Closed
ukreddy-erwin opened this issue Jun 24, 2022 · 10 comments
Closed

Not working on alpine linux #194

ukreddy-erwin opened this issue Jun 24, 2022 · 10 comments
Labels

Comments

@ukreddy-erwin
Copy link

I tried installing this on a docker container, alpine linux.

docker run -it alpine:3.6

And ran below set of commands.

wget https://github.com/mike-engel/jwt-cli/releases/download/5.0.3/jwt-linux.tar.gz;tar -xvzf jwt-linux.tar.gz;rm -rf jwt-linux.tar.gz;mv jwt /usr/local/bin/

But, when I ran jwt, getting error as not found.
.usr/local/bin is already in system path.

Even from current working directory also same issue.

./jwt
/bin/sh: ./jwt: not found
@mike-engel
Copy link
Owner

I'm not sure that this is an issue with jwt-cli specifically? This seems like an issue with the docker setup or alpine linux where it can't find the executable. jwt-cli has no concept, as far as I know, about its environment and definitely doesn't call itself during execution. Could this be a permissions issue? chmod +x /usr/local/bin/jwt?

@ukreddy-erwin
Copy link
Author

still same issue, i don't know why this question is closed without resolution.
Could you please share that, if you missed to paste.

The environment I provided also easy to replicate as just single docker run command shared in my first comment

@mike-engel mike-engel reopened this Jun 28, 2022
@mike-engel
Copy link
Owner

Sorry, I assumed this wasn't a problem with the jwt binary.

Upon further inspection, alpine linux seems to require a static binary (not dynamically linked). This would require rust to be built with the musl target, but unfortunately ring, which is a transitive dependency of jsonwebtoken doesn't support static linking: briansmith/ring#713

Until ring supports static linking via the musl target, jwt won't be able to run on alpine linux. Sorry! I'll leave this issue open for now though

@tomwiggers
Copy link

tomwiggers commented Nov 16, 2022

Hi, I think it is a good idea to document your findings. I now also spent a few hours facing the same issue on a busybox container with the most recent version.

Basically using the same method as OP. It is also not possible to pass it as argument to sh:

$ sh jwt
jwt: line 1: syntax error: unexpected "("

edit: a workaround seems to be to just use the rust container image.

mike-engel added a commit that referenced this issue Jan 4, 2023
@mike-engel
Copy link
Owner

Added a note with 10cea20. Thanks all!

@folliehiyuki
Copy link

Hi! Just let you know that I'm making an attempt to package jwt-cli for AlpineLinux at https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/46338.

It already works on my machine after the build. If the MR gets merged, you can install the package directly from Alpine's edge repo.

@mike-engel
Copy link
Owner

Looks great, thanks @folliehiyuki!

@Rogach
Copy link

Rogach commented Feb 6, 2024

FYI - currently static executable builds without issues with x86_64-unknown-linux-musl target and rustc 1.77.0-nightly (only had to update proc-macro2 dependency to avoid the unknown feature proc_macro_span_shrink error).

@ajschmidt8
Copy link

Sorry, I assumed this wasn't a problem with the jwt binary.

Upon further inspection, alpine linux seems to require a static binary (not dynamically linked). This would require rust to be built with the musl target, but unfortunately ring, which is a transitive dependency of jsonwebtoken doesn't support static linking: briansmith/ring#713

Until ring supports static linking via the musl target, jwt won't be able to run on alpine linux. Sorry! I'll leave this issue open for now though

The linked ring issue seems resolved now.

Can this issue be revisited to support Alpine?

@mike-engel
Copy link
Owner

I've now included a musl build as part of the release process. Hope this is what y'all are looking for, and if not, please let me know here. Thanks!

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

No branches or pull requests

6 participants