Release a BrowserStackLocal binary for Alpine Linux?
Closed this issue ยท 19 comments
Hey there. I was having some issues, getting the BrowserStackLocal binary to run on Alpine Linux (in a Docker container).
The browserstack-local npm package will automatically download the linux-x64 binary, which does not work on Alpine (which is based on musl instead of GNU C lib).
I got it working with: https://github.com/sgerrand/alpine-pkg-glibc (you'll need at least glibc-2.25-r0.apk, glibc-bin-2.25-r0.apk)
However, it would be a much better experience if BrowserStack just published another build for Alpine/musl and have the node package download that one.
Thanks a lot ๐
@AnkurGel @vedharish Any movement on this? We want to begin using docker containers based on Alpine Linux for our automated testing but we can't because the browserstack binary won't run in them currently.
@pmeinhardt @lots0logs At the moment, we have no plans for supporting Alpine Linux. We will inform you once we have support for it. Closing this issue for now.
Okay. Thanks for the update @punitx ๐
For everyone who needs to run BrowserStackLocal on Alpine in the meantime, check out sgerrand/alpine-pkg-glibc as noted in the issue description above.
Cheers
@punitx I've tried that solution and it doesn't work. I think choosing not to support Alpine is a mistake TBH. Alpine is the default recommended container base image from Docker. Since BrowserStack Automate is going to primarily be used in containers, you guys should support Alpine.
Any updates on this as I am not able to get going with local testing using alpine image
@shripadbothaleAvalara Currently, supporting Alpine Linux is not on our product roadmap. Should there be any update regarding this, we will post it here.
@punitx Well, it should be on your roadmap as most of people using alpine based images for automated tests in CI servers if possible. This is very not wise approach. Maybe at least you could release sources which could be compiled against Alpine linux platform?
I suggest that you add to your README on all these browserstack-local-* projects that alpine is not supported, so that others don't waste time trying to get it to work. I am also another +1 for supporting this in the future.
Completely agree, supporting this in the future would be very awesome.
Having same issue on docker:latest image.
Installed glibc
RUN apk --no-cache add ca-certificates wget
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk
RUN apk add glibc-2.27-r0.apk
Now getting: /usr/local/bin/BrowserStackLocal: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Installed libstdc++
RUN apk add libstdc++
Still no luck.
@tomekit
I just got this working using https://github.com/sgerrand/alpine-pkg-glibc.
I think you are just missing:
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-bin-2.27-r0.apk
RUN apk add glibc-bin-2.27-r0.apk.
This should work fine. No need to install libstdc++
Cheers
Not having any luck with alpine-pkg-glibc, and find the response from very disappointing.
This SHOULD be high up on the roadmap. Pretty much everyone publishes alpine images nowadays, and when running docker images for CI build, size really matters.
Seems like the only option for us if we would like to stick with browserstack will be to redo all our images based on another distro, which will be a lot of work and lead to slower CI pipelines.
That is certainly a huge minus for us when selecting provider.
Try this, works for me.
Feel free to remove stuff you don't need, openssh, bash, docker-compose etc.
Dockerfile
FROM docker:latest
RUN apk update
RUN apk add --no-cache py-pip git openssh bash
RUN pip install docker-compose
RUN pip install selenium
# Copied from https://github.com/sgerrand/alpine-pkg-glibc
# Need to run BrowserStack
RUN apk --no-cache add ca-certificates wget
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk
RUN apk add glibc-2.28-r0.apk
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-bin-2.28-r0.apk
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-i18n-2.28-r0.apk
RUN apk add glibc-bin-2.28-r0.apk glibc-i18n-2.28-r0.apk
RUN /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
RUN apk add libstdc++
RUN wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip \
&& unzip BrowserStackLocal-linux-x64.zip \
&& chmod +x BrowserStackLocal \
&& mv BrowserStackLocal /usr/local/bin \
&& rm BrowserStackLocal-linux-x64.zip
PS. Don't get frustrated so easily. Dealing with stuff like this, day as usual. :)
No luck, still getting /root/.browserstack/BrowserStackLocal: /usr/lib/libstdc++.so.6: no version information available (required by /root/.browserstack/BrowserStackLocal)
Using Alpine 3.8 as base.
Sure I am getting this message as well, but it doesn't stop BrowserStackLocal from running.
No problem, however if it exits with a 1 then it actually doesn't work for you. Did you test your tunnel on your machine? It might be easier to debug any issues with BrowserStackLocal before setting up Gitlab CI.
Sure, the tunnel works fine locally and when using a debian based image.