A better boxcli without all the nonsense errors.
986
A better boxcli without all the nonsense errors.
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.
To build the image, follow these steps:
docker build -t boxcli .docker run --rm -it boxcli /bin/bashIf you don't want to build your own image, then you can use the one we have shared via the Docker Registry.
This image is hosted on Docker Hub. To use the most recent version, run the following commands:
docker pull mfeadmin/boxclidocker run --rm -it mfeadmin/boxcli /bin/bashThat's it.
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.
Once you have been presented with a bash prompt, you will need to specify where your config file is.
box configure:environments:add /config.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.
Content type
Image
Digest
sha256:7512fe428…
Size
434.9 MB
Last updated
about 3 years ago
docker pull mfeadmin/boxcli