What you’ll learn
- How to configure an AWS ECR repository policy for cross-account access.
- How to add an ECR credential in the Runpod console.
- How to deploy a Pod using your private ECR image.
Requirements
- A Runpod account with credits.
- An AWS account with an ECR repository containing a private container image.
- AWS CLI installed (optional, for command-line configuration).
Step 1: Configure your ECR repository policy
To pull images from your private ECR repository, Runpod needs cross-account access. You grant this access by adding an IAM policy to your repository.- Open the Amazon ECR console.
- Select the repository containing your container image.
- In the left navigation, select Permissions.
- Click Edit policy JSON and add the following policy statement:
- Click Save.
The
aws:PrincipalArn condition restricts access to Runpod’s deployment role, ensuring only Runpod can use this permission to pull images.Alternative: Configure via AWS CLI
You can also configure the repository policy using the AWS CLI:YOUR_REPOSITORY_NAME with the name of your ECR repository.
Step 2: Add your ECR credential to Runpod
Once the ECR policy is configured, add the credential to the Runpod console:- Navigate to Settings in the Runpod console.
- Scroll down to Container Registry Authentication and click Add Credential.
- Select AWS ECR as the registry type.
- Enter a Name for this credential (for example,
my-ecr-repo). - Enter the ECR Image URI in the format
ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/REPOSITORY_NAME. - Click Create.
Step 3: Deploy a Pod with your private image
Now you can deploy a Pod using your private ECR image:- Navigate to Pods and select Deploy.
- Choose your GPU configuration.
- Under Container Image, enter your full ECR image URI (for example,
123456789012.dkr.ecr.us-east-2.amazonaws.com/my-app:latest). - Configure any additional settings such as environment variables or exposed ports.
- Click Deploy.
You’ve configured cross-account ECR delegation and deployed a Pod using a private container image.
Next steps
- Learn how to create custom templates from your container images.
- Explore environment variables for configuring your containers.
- Set up network volumes for persistent storage.