> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# travelaudience/docker

CircleCI Orb for docker. Provides similar functionality to orb: circleci/docker (supporting persistent workspace & multiple tags)
But also includes image scanning with: ovotech/clair-scanner
see github page for more info: https://github.com/travelaudience/orbs


## Commands

### collect_image_names

Save image name to persisted directory, that will be used later to scan all images collected

| Parameter | Type | Default | Description |
|---|---|---|---|
| `image` | string |  |  |
| `tag` | string | $CHANGE_NAME |  |

### get_change_name

Set env var with either changed branch name OR git tag

## Jobs

### build_and_push

Standard docker workflow for building an image, and pushing to private repository


| Parameter | Type | Default | Description |
|---|---|---|---|
| `artifact-registry` | env_var_name | ARTIFACT_REGISTRY | Name of environment variable storing the artifact registry host |
| `docker-context` | string | . | Path to the directory containing your build context, defaults to . (working directory)
 |
| `docker-hub-password` | env_var_name | DOCKER_HUB_PASSWORD | Name of environment variable storing your Docker password |
| `docker-hub-username` | env_var_name | DOCKER_HUB_USERNAME | Name of environment variable storing your Docker username |
| `docker-password` | env_var_name | GCR_PASSWORD | Name of environment variable storing your Docker password |
| `docker-username` | env_var_name | GCR_USERNAME | Name of environment variable storing your Docker username |
| `docker-version-override` | string | default | Manual override for the Docker version to be used |
| `dockerfile` | string | Dockerfile | Relative or absolute path, including name, to the Dockerfile |
| `executor` | executor | default | Executor to use for this job |
| `extra-build-args` | string |  | Additional docker build flags |
| `extra-tag` | string | $CHANGE_NAME | Additional tag to apply to the image besides the default SHA tag. Defaults to the change name (git branch OR tag) |
| `image-name` | string |  | Name of image to build |
| `lfs-enabled` | boolean | false | Enable git-lfs |
| `lint-enabled` | boolean | false | Option flag to enable linting of Dockerfile |
| `registry` | env_var_name | GCR_REGISTRY | Name of environment variable storing the registry host |

### docker_git_tag

Retag an existing SHA image with a git tag that maps to the specified sha.
Should be triggered in workflows that filter for tags.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `docker-password` | env_var_name | GCR_PASSWORD | Name of environment variable storing your Docker password |
| `docker-username` | env_var_name | GCR_USERNAME | Name of environment variable storing your Docker username |
| `docker-version-override` | string | default | Manual override for the Docker version to be used |
| `executor` | executor | default | Executor to use for this job |
| `image-name` | string |  | Name of image to re-tag |
| `registry` | env_var_name | GCR_REGISTRY | Name of environment variable storing the registry host |
| `retry_count` | integer | 8 | Amount of attempts to make while waiting for the image to exist in the registry |
| `wait_period` | integer | 90 | Seconds to wait between retries |

### docker_scan

| Parameter | Type | Default | Description |
|---|---|---|---|
| `docker-password` | env_var_name | GCR_PASSWORD | Name of environment variable storing your Docker password |
| `docker-username` | env_var_name | GCR_USERNAME | Name of environment variable storing your Docker username |
| `registry` | env_var_name | GCR_REGISTRY | Name of environment variable storing the registry host |

## Executors

### default

Executor with a docker version compatible with the commands used in this orb and its dependencies