Include docker image with CLI client

Feature name

CLI client docker image

Feature function

  • What will this feature do differently?
    • Provide a docker image on dockerhub
  • What benefits will this feature bring?
    • Easy installation regardless of platform
    • Easy usage in CI/CD environments
  • Remember to add a tag for each client application that will be affected
    • app:cli

Related topics + references

  • Are there any related topics that may help explain the need and function of this feature?
    • Having to manage updating the client version then checking the SHA in a CI pipeline is doable, but annoying
  • Are there any references to this feature or function on other platforms that may be helpful?

Hi @LoveIsGrief - welcome to the community forums!

You rationale for this feature request is that it is too complicated to install the Bitwarden CLI, which seems odd given that it is only a single executable file. I get that checking SHA signatures is an additional step, but were you aware that the bw-cli is also installable by Snap, Homebrew, Chocolatey, and Node’s NPM? These installers cover all the major OS’s supported by Bitwarden.

I think your feature request would be much more compelling if you could explain how installing a docker image is going to be any less complicated or time consuming. Or is it just a personal preference of yours to install software as a docker image (e.g., because you want bw on a NAS)?

Hi @dh024 ,

My specific usecase is for Gitlab CI. Right now, my YAML would have to look something like

get secrets:
  image: debian:bullseye
    BW_CLI_URL: https://...
    BW_CLI_SHA: ahei1084alns01h...
    - apt-get update -qq
    - apt-get install -y unzip
    - mkdir "${CI_PROJECT_DIR}/.bw" && cd "${CI_PROJECT_DIR}/.bw"
    - wget -O "${BW_CLI_URL}"
    - echo "${BW_CLI_SHA}" | sha256sum --check -
    - unzip
    - bw --help

That’s a lot of work just to install and make bw available in the CI environment. What it could look like is

get secrets:
  image: bitwarden/cli:1.22.0
    - bw --help

No wget, no checksum verification, no PATH modification, just an image like 1Password provides, and the rest is up to me. It would make the switch from 1password that little bit easier :slight_smile:


OK, interesting use case. Thanks for elaborating.

I hope others trying to achieve similar things support your request with their votes so this feature request attracts some attention by the BW devs. Cheers!

1 Like

As found by @dwbit , the related issue on github is Unable to use CLI in Docker container · Issue #214 · bitwarden/cli · GitHub