sentry-cli: sentry-cli install script fails on alpine

There are undocumented dependencies needed for sentry-cli needed for alpine linux

To reproduce:

FROM alpine:edge

RUN apk add --update ca-certificates \
    && apk add bash curl

RUN curl -sL https://sentry.io/get-cli/ | bash

CMD bash
docker run -it sentry bash
bash-4.3# sentry-cli
bash: /usr/local/bin/sentry-cli: No such file or directory
bash-4.3# ls -al /usr/local/bin/
total 12644
drwxr-xr-x    2 root     root          4096 May 15 19:02 .
drwxr-xr-x    7 root     root          4096 May 15 19:02 ..
-rwxr-xr-x    1 root     root      12935936 May 15 19:02 sentry-cli
bash-4.3#

I know that there is a dependency missing, I have another alpine image that works with sentry-cli installed the same way(I cannot post that docker file).

It would be nice if there was a more helpful error message so I know what is missing

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I might look into musl builds again. I nuked and updated some dependencies so there might be fewer stoppers now.

@oscar-b I used the docker image above and exported the binary to my ci image. I think it only needs llvm-libunwind openssl as runtime dependencies

This seems to be the minimal docker image to build and run sentry-cli on Alpine:

FROM alpine:edge

RUN echo "http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
ENV SENTRY_VERSION="1.9.2"
RUN apk add --no-cache --virtual .build-deps \
                                build-base \
                                openssl \
                                rust \
                                cargo \
                                git \
                                curl \
                                openssl-dev \
                                cmake \
                                file \
                                curl-dev \
                                gcc \
  && git clone -b $SENTRY_VERSION https://github.com/getsentry/sentry-cli.git /tmp/sentry \
  && cargo build --manifest-path /tmp/sentry/Cargo.toml --release \
  && mv /tmp/sentry/target/release/sentry-cli /usr/local/bin \
  && rm -rf /tmp/sentry \
  && rm -rf /root/.cargo \
  && apk del .build-deps \
  && apk add --no-cache curl llvm-libunwind openssl

@Rishka for what it’s worth in that tarball is a full ubuntu installation. So your alpine linux becomes … ubuntu.

Until recently linuxes without glibc were pretty uncommon but docker is setting a trend to have alpine there so we might investigate this again. The main issue I have is that the only alternative to glibc is musl and musl compiled binaries behave weirdly for some users (eg: ldd breaks).

I actually just found why it works in my other image,

RUN set -x \
  && curl -sL https://github.com/DarthHater/docker-phantomjs2/releases/download/2.1.1/dockerized-phantomjs.tar.gz | tar xz -C / \
  && phantomjs --version \
  && curl -sL https://sentry.io/get-cli/ | bash

and it works fine…

phantomjs has a similar issue with glibc and apparently the workarounds there makes sentry-cli work as well.

updated the example

@Rishka Rust/Cargo seems to leave 260 Mb of installed packages in /root/.cargo, need to rm it.