Skip to main content

add-token

Usage

bx add-token [-i] [--help] [-s=<server>] [-t=<token>]

Parameters and inputs

ShorthandLong versionDescription
-s--serverTarget server: host[:port]
-t--tokenToken
-i--inRead from stdin
--helpDisplay this help message and exit

Examples

Docker registry tokens

This command can be used to pass Docker registry credentials to BatchX, in order to import images from its private repositories.

In this case the token is composed by concatenating <user>:<password>:

$ bx add-token -s <server> -t <user>:<password>

DockerHub example

$ bx add-token -s registry.hub.docker.com -t <dockerHubUser>:<dockerHubPassword>

AWS ECR shortcut

Additionally, there is a shortcut for adding an AWS ECR token to BatchX. Just pipe the aws ecr get-login output to the add-token command and add the -i flag:

$ aws ecr get-login --no-include-email --region eu-west-1 | bx add-token -i
info

If succeeded, these command will return a Token successfully imported message and you will now be able to import Docker images into BatchX from the private repositories the token grants access to.