# withEcr

Provides ECR authentication for the given steps.

## Parameters

The `withEcr` step takes a Map of options and a Closure which defines the steps to execute.

The options available are as follows:

| Name       | Description                                                               | Type        | Default                                                                          | Required |
|------------|---------------------------------------------------------------------------|-------------|----------------------------------------------------------------------------------|----------|
| registries | A list of registries, each of which specifies an `accountId` and `region` | `List<Map>` | The us-east-1 registries in the Orchard Prod account and shared services account | no       |

## Examples

```groovy
// Use default registries
withEcr {
    sh 'docker pull 437795906767.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:python311'
    sh 'docker pull 086679231553.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:python311'
}
```

```groovy
// Use custom registries
withEcr(registries: [
    [accountId: '123456789012', region: 'us-east-1'],
    [accountId: '234567890123', region: 'us-west-2']
]) {
    sh 'docker pull 123456789012.dkr.ecr.us-east-1.amazonaws.com/foo:bar'
    sh 'docker pull 234567890123.dkr.ecr.us-west-2.amazonaws.com/foo:bar'
}
```
