Sign inSign up

mfeadmin/boxcli

By mfeadmin

•Updated about 3 years ago

A better boxcli without all the nonsense errors.

Image
0

986

mfeadmin/boxcli repository overview

⁠boxcli

A better boxcli without all the nonsense errors.

⁠Summary

This is a port of the official NodeJS docker image, but with some adjustments to prevent dependency errors. Includes mount points for config and data directories. The config directory can be mapped to the host folder where your config.json file is (assuming you are using JWT auth). The data directory is so that you may map the folder(s) and file(s) you will wish to share, test, delete, whatever.

"Wait a sec, what does NodeJS have to do with Box CLI?". Yeah, I asked myself that question too. It's because Box has developed the CLI primarily for Windows and MacOS⁠. They must hate Linux users since we have to use a NodeJS app⁠. All opinions are my own.

⁠Building the image

To build the image, follow these steps:

  1. Clone this repo, of course.
  2. Build the image.
    docker build -t boxcli .
  3. Run the container.
    docker run --rm -it boxcli /bin/bash

If you don't want to build your own image, then you can use the one we have shared via the Docker Registry.

⁠Running from the Docker Registry

This image is hosted on Docker Hub⁠. To use the most recent version, run the following commands:

  1. Pull the image.
    docker pull mfeadmin/boxcli
  2. Run the container.
    docker run --rm -it mfeadmin/boxcli /bin/bash

That's it.

⁠Running with a bit more persistence

If you make the container more persistent, you must use volume mapping. Also, we recommend you run the container in detached mode. Example below.

docker run -d -v <config_folderpath>:/config -v <workspace_folderpath>:/data --restart unless-stopped mfeadmin/boxcli

Example:
docker run -d -v /home/boxcli/config:/config -v /home/boxcli/documents:/data --restart unless-stopped mfeadmin/boxcli

This will drop you back to the prompt and will produce a long hexadecimal value. This value is the Container ID, so copy it. To enter into the NodeJS shell, you'll need to run this command.

docker exec -it <container_id> /bin/bash

Example:
docker exec -it 93bc07b4a37c209d33d4517e6a83b05bf4184322f99d903db6692ed88887efad /bin/bash

Note: you really only need the first twelve characters of the Container ID, but I'm too lazy to explain how to go about doing that. You can always Google it, but I recommend you take a basic Docker course instead.

⁠Authenticating with JWT

Once you have been presented with a bash prompt, you will need to specify where your config file is.

  1. To authenticate, use box configure:environments:add /config.
  2. To validate authentication, try running box users:get. If you get back some JSON or YAML output, then it's likely working correctly.

For more information, see the Box Developer Guide⁠ for details.

Tag summary

Content type

Image

Digest

sha256:7512fe428…

Size

434.9 MB

Last updated

about 3 years ago

docker pull mfeadmin/boxcli