How to use Docker with Toolkit

More details on Toolkit Docker Tips.

How to login with docker

When you login with the CLI with eai login, the docker configuration is automatically set up.

  • eai login set up a credential helper for the toolkit registries in ~/.docker/config.

  • In order to use this configuration, a symlink named docker-credential-eai-<profile> must be created and be located in $PATH.

  • The command will display the recommended ln -s directive based on where the eai binary is located.

  • ie: If the eai binary is located in ~/bin then the output of the eai docker configure would suggest: ln -s ~/bin/eai ~/bin/docker-credential-eai-<profile>

For more detail please go to: https://docs.docker.com/engine/reference/commandline/login/#credential-helpers

You can also force the reconfiguration of the docker configuration with eai docker configure

How to use a temporary registry

Toolkit also offers a temporary internal registry, volatile-registry.console.elementai.com, where you can push temporary images. After 24 hours the images in this registry are automatically deleted to save storage space.

It is also possible to extend the storage duration by appending -<number>days or -<number>months (like -3months) to the tag used when pushing the image. The maximum duration is 90 days or 3 months.

For example: volatile-registry.console.elementai.com/<account id>/<image name>-2months will be kept for 2 months.

How to push on Toolkit registry

# Get your default accout ID.
export ACCOUNT_ID=$(eai account get --field id)
export IMAGE=registry.console.elementai.com/$ACCOUNT_ID/job-example
docker build -t $IMAGE .
docker push $IMAGE