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?
3 Likes

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
  variables:
    BW_CLI_URL: https://...
    BW_CLI_SHA: ahei1084alns01h...
  before_script:
    - apt-get update -qq
    - apt-get install -y unzip
    - mkdir "${CI_PROJECT_DIR}/.bw" && cd "${CI_PROJECT_DIR}/.bw"
    - wget -O bw_cli.zip "${BW_CLI_URL}"
    - echo "${BW_CLI_SHA} bw_cli.zip" | sha256sum --check -
    - unzip bw_cli.zip
    - PATH="${CI_PROJECT_DIR/.bw":$PATH
  script
    - 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
  script:
    - 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:

Cheers

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!

2 Likes

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

Adding my support for this - I would really like to see a Bitwarden official Docker image for the CLI. We are a paying Teams customer with Enterprise clients of our own

Thanks @Joel_DeTeves, the feedback will be passed along to the team :+1:

3 Likes

Same here, (already added my vote, but my company pays for teams as well) I could definitely see it being very useful for CI/CD use cases.

I particularly end up using container images to copy single binaries (i.e. terraform/packer - golang binaries) out of so I’m getting the official version of the client to use inside my containers. That way (in theory) the provider of the binaries are already doing the necessary security things (signing and verifying signatures) to ensure their containers haven’t been tampered with and I don’t have to.

So, I definitely would love this feature!