Backblaze / B2_Command_Line_Tool

The command-line tool that gives easy access to all of the capabilities of B2 Cloud Storage
Other
529 stars 120 forks source link

Package `b2` for Alpine Linux #996

Closed salim-b closed 4 months ago

salim-b commented 5 months ago

Summary

Currently, b2 is not natively available on Alpine Linux. Would be nice if that would change (and the package be maintained by the Backblaze team).

Thanks.

Possible workaround until b2 APK is available

FROM alpine:latest

RUN apk add --no-cache \
  ca-certificates \
  curl \
  dasel

RUN set -o pipefail \
  && curl --silent https://api.github.com/repos/Backblaze/B2_Command_Line_Tool/releases/latest \
  | dasel --read json 'assets.all().filter(equal(name,b2-linux)).browser_download_url' \
  | xargs -n 1 curl --silent --location --output /usr/local/bin/b2 \
  && chmod +x /usr/local/bin/b2
ppolewicz commented 5 months ago

How about pip3 install b2? That should work almost anywhere

salim-b commented 5 months ago

How about pip3 install b2? That should work almost anywhere

True. But you have to install the Python interpreter for this to work before, which bloats container size. (To be fair, b2 cuts a poor figure in terms of size anyways...😅)

ppolewicz commented 4 months ago

I think there shouldn't be much difference between FROM python:3-alpine with pip3 install b2 and the b2 binary that we build using pyinstaller.

Anyway, is the docker image so bloated that you can't use it?

I can't really see the problem we'd have to fix here. You can use it with pip, you can download the binary, you can use it through docker and it's a fresh version, unlike the deb/apk that would be hugely delayed due to operating system release schedule. It think we are ok, right?

salim-b commented 4 months ago

I think there shouldn't be much difference between FROM python:3-alpine with pip3 install b2 and the b2 binary that we build using pyinstaller.

I just compared container image sizes. In my case, python:3-alpine + pip3 install b2 results in ~107MiB, while alpine:latest + b2 binary from GH releases is ~75MiB (using the more lightweight jq instead of dasel to parse the GH JSON API response). This is a relative size increase of ~43%.

Anyway, is the docker image so bloated that you can't use it?

I can absolutely live with what we have today. I just thought it would be cool for Backblaze to provide its CLI as a native Alpine package. ☺️ Feel free to close this issue if you think otherwise.

ppolewicz commented 4 months ago

As you said, you are fine with what there is today and adding another packaging format to the support matrix is not free.

Personally I don't think it's a priority. I don't want to contribute apk building and maintain it in the future, but if you believe it's worth your time, please submit a PR :)