LogoLogo
WebsiteSlack
0.40
0.40
  • Get started
  • Overview
  • Clusters
    • Management
      • Auth
      • Create
      • Update
      • Delete
      • Environments
      • Production Guide
    • Instances
      • Multi-instance
      • Spot instances
    • Observability
      • Logging
      • Metrics
      • Alerting
    • Networking
      • Load balancers
      • Custom domain
      • HTTPS
      • HTTPS with API Gateway
      • VPC peering
    • Advanced
      • Setting up kubectl
      • Private Docker registry
      • Self hosted images
  • Workloads
    • Realtime
      • Example
      • Configuration
      • Containers
      • Autoscaling
      • Traffic Splitter
      • Metrics
      • Statuses
      • Troubleshooting
    • Async
      • Example
      • Configuration
      • Containers
      • Autoscaling
      • Statuses
    • Batch
      • Example
      • Configuration
      • Containers
      • Jobs
      • Statuses
    • Task
      • Example
      • Configuration
      • Containers
      • Jobs
      • Statuses
  • Clients
    • Install
    • Uninstall
    • CLI commands
    • Python client
Powered by GitBook
On this page
  • Step 1
  • Step 2
  • Step 3
  • Step 4
  • Cleanup
  1. Clusters
  2. Advanced

Self hosted images

PreviousPrivate Docker registryNextRealtime

Last updated 3 years ago

Self-hosting the Cortex cluster's system 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 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.

Step 1

Make sure you have the , , and utilities installed.

Step 2

Export the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables in your current shell, or run aws configure. These credentials must have access to push to ECR.

Step 3

Clone the Cortex repo using the release tag corresponding to your version (which you can check by running cortex version):

export CORTEX_VERSION=0.40.0
git clone --depth 1 --branch v$CORTEX_VERSION https://github.com/cortexlabs/cortex.git

Step 4

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>

Cleanup

You can now configure Cortex to use your images when creating a cluster (see for instructions).

You can delete your ECR images from the (set your region in the upper right corner). Make sure all of your Cortex clusters have been deleted before deleting any ECR images.

ECR
aws
docker
skopeo
here
AWS ECR dashboard