# dockerToEcr

Build and push a Docker image for a given project to Amazon Elastic Container Registry (ECR).

## Parameters

| Name                     | Description                                                                                                                                                                                                               | Type           | Default                     | Required |
|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|-----------------------------|----------|
| additionalContexts       | A map of additional build contexts to provide to the Docker build.                                                                                                                                                        | `Map`          | n/a                         | no       |
| awsRegions               | A list of AWS regions containing ECR repositories                                                                                                                                                                         | `List<String>` | n/a                         | yes      |
| dockerBuildArgs          | Map of Docker build arguments                                                                                                                                                                                             | `Map`          | n/a                         | no       |
| dockerBuildCacheDisabled | Whether Docker build cache is disabled                                                                                                                                                                                    | `boolean`      | true                        | no       |
| dockerBuildContext       | Docker build context                                                                                                                                                                                                      | `string`       | Current workspace directory | no       |
| dockerBuildFile          | Location of Dockerfile                                                                                                                                                                                                    | `string`       | ./Dockerfile                | no       |
| dockerBuildTarget        | Name of Docker build target                                                                                                                                                                                               | `string`       | n/a                         | no       |
| dockerBuildSecrets       | List of maps containing build secrets, in either `{id: someKey, src: someValue}` format, where `src` is the path to a file, or `{id: someKey, env: someValue}` format where `env` is the name of an environment variable. | `List<Map>`    | n/a                         | no       |
| ecrAccountId             | AWS Account ID containing ECR repositories                                                                                                                                                                                | `string`       | n/a                         | yes      |
| imageName                | Name of Docker image and ECR repository                                                                                                                                                                                   | `string`       | n/a                         | yes      |
| imageTag                 | Name of Docker image tag. Should generally be a git commit hash                                                                                                                                                           | `string`       | n/a                         | yes      |
| pushLatest               | Whether or not to also push the image with the `latest` tag                                                                                                                                                               | `boolean`      | `true`                      | no       |
| registryCredentials      | List of maps containing registry credentials to `docker login` with. Each map must have `username` and `password` keys, and an optional `url` key for the registry server (defaults to Docker Hub if omitted).            | `List<Map>`    | n/a                         | no       |
