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

Alpine Binary Issues #1

Closed
garrettdowd opened this issue May 9, 2020 · 7 comments
Closed

Alpine Binary Issues #1

garrettdowd opened this issue May 9, 2020 · 7 comments

Comments

@garrettdowd
Copy link

garrettdowd commented May 9, 2020

Thanks for publishing this tool! I have tried it out on Ubuntu and it seems to work well.

However, I would like to run this in a container with an alpine linux base image. The binary does not work currently. I have tested it with the following Dockerfile

FROM alpine:3.11

WORKDIR /usr/local/bin

RUN wget https://github.com/lightpohl/podcast-dl/releases/download/v1.3.1/podcast-dl-linux-x64 \
  && chmod +x podcast-dl-linux-x64 \
  && mv podcast-dl-linux-x64 podcast-dl \
  && mkdir /downloads

WORKDIR /downloads

CMD ["ldd", "/usr/local/bin/podcast-dl"]
#CMD ["podcast-dl", "--help"]
#CMD ["tail","-f","/dev/null"]

which can be built with docker build --tag podcast-dl:1.3.1 .
and run with docker run --name podcast-dl -it podcast-dl:1.3.1

ldd displays the issues with the binary and I do not know where to go from here.

EDIT: a snippet of the ldd output

Error relocating /usr/local/bin/podcast-dl: _ZNSsC1ERKSsmm: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZnamRKSt9nothrow_t: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNKSs7compareEPKc: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSt11logic_errorD1Ev: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZdlPvRKSt9nothrow_t: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSs15_M_replace_safeEmmPKcm: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSsD1Ev: symbol not found
Error relocating /usr/local/bin/podcast-dl: backtrace: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSsC1EPKcRKSaIcE: symbol not found
Error relocating /usr/local/bin/podcast-dl: getcontext: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSt15basic_streambufIcSt11char_traitsIcEE6setbufEPcl: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSo9_M_insertIxEERSoT_: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZNSs7reserveEm: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZTISt9exception: symbol not found
Error relocating /usr/local/bin/podcast-dl: _ZTVSt12domain_error: symbol not found
@lightpohl
Copy link
Owner

Thank you for the bug report!

I'm going to track this Alpine issue over in pkg that I suspect is the likely culprit. After it is resolved I'll rebuild the binaries for Alpine and attach them to the latest release.

There's a potential workaround mentioned here if you'd like to try that in mean time.

@garrettdowd
Copy link
Author

After adding

apk add libstdc++
apk add libgcc

to the previous Dockerfile, there are still issues.

While there is no longer a "segmentation fault" there still seems be a missing dependency.

Running the binary gives sh: podcast-dl: not found which according to this could mean a missing dependency.

Output from ldd gives

        /lib64/ld-linux-x86-64.so.2 (0x152788d53000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x152788d53000)
        librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x152788d53000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x152788bba000)
        libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x152788d53000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x152788ba6000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x152788d53000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x152788d53000)
Error relocating podcast-dl: gnu_get_libc_version: symbol not found
Error relocating podcast-dl: __register_atfork: symbol not found
Error relocating podcast-dl: __strdup: symbol not found
Error relocating podcast-dl: setcontext: symbol not found
Error relocating podcast-dl: makecontext: symbol not found
Error relocating podcast-dl: backtrace: symbol not found
Error relocating podcast-dl: getcontext: symbol not found

@lightpohl
Copy link
Owner

I saw another comment saying they had better luck with the Node 10 pkg image used for Alpine. I quickly tested to make sure the CLI works with that Node version, and uploaded that binary here if you'd like to try that one on your Alpine image.

Let me know if that one works. 👍

@garrettdowd
Copy link
Author

Similar issues unfortunately. I tried the new package with and without libstd++ libgcc as well on Alpine 3.11, 3.10, and 3.9. With libstd++ libgcc it gives a segmentation fault and without it gives a much of linking errors.

I believe there is a Node image for Alpine, maybe that will be easier than trying to run the binary. My only experience with Node is running Node RED, but I will try giving it a shot. It looks like if I install npx with npm then I can just run npx podcast-dl?

@garrettdowd
Copy link
Author

garrettdowd commented May 13, 2020

I believe there is a Node image for Alpine, maybe that will be easier than trying to run the binary. My only experience with Node is running Node RED, but I will try giving it a shot. It looks like if I install npx with npm then I can just run npx podcast-dl?

Yes this was much easier. I just installed with npm and it works perfectly. I will push it to Docker Hub and maybe (in the near future) build a little web gui like youtube-dl-server to make it quicker to use. I will update this post with a link when it's up.

EDIT: Here it is. A very rudimentary setup with WEB interface that works. https://hub.docker.com/repository/docker/garrettdowd/podcast-dl-server

@lightpohl
Copy link
Owner

Oh, that's awesome! Glad it worked out. 😃

@lightpohl
Copy link
Owner

Closing for now until pkg resolve the issue on their end, and then I'll start adding the Alpine binaries back to the releases. 👍

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

No branches or pull requests

2 participants