Self-hosted Docker images can be useful for reducing the ingress costs, for accelerating image pulls, or for eliminating the dependency on Cortex's public container registry.
In this guide, we'll use ECR as the destination container registry. When an ECR repository resides in the same region as your Cortex cluster, there are no costs incurred when pulling images.
AWS_SECRET_ACCESS_KEY environment variables in your current shell, or run
aws configure. These credentials must have access to push to ECR.
Clone the Cortex repo using the release tag corresponding to your version (which you can check by running
export CORTEX_VERSION=0.34.0git clone --depth 1 --branch v$CORTEX_VERSION https://github.com/cortexlabs/cortex.git
Run the script below to export images to ECR in the same region and account as your cluster.
Feel free to modify the script if you would like to export the images to a different registry such as a private docker hub.
./cortex/dev/export_images.sh <AWS_REGION> <AWS_ACCOUNT_ID>
You can now configure Cortex to use your images when creating a cluster (see here for how to specify cluster images) and/or when deploying APIs (see the configuration docs corresponding to your API type for how to specify API images).
You can delete your ECR images from the AWS ECR dashboard (set your region in the upper right corner). Make sure all of your Cortex clusters have been deleted before deleting any ECR images.