With Tool Kit [already set up](https://github.com/financial-times/dotcom-tool-kit#installing-and-using-tool-kit), install this plugin as a dev dependency:
With Tool Kit already set up, install this plugin as a dev dependency:
``sh`
npm install --save-dev @dotcom-tool-kit/docker
And add it to your repo's .toolkitrc.yml:
`yml`
plugins:
- '@dotcom-tool-kit/docker'
Run docker build to create Docker images.
#### Task options
| Property | Description | Type | Default |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------- | :------ |
| ssh | whether to forward host's SSH agent, see https://docs.docker.com/reference/cli/docker/buildx/build/#ssh | boolean | false |buildArgs
| | An object of Docker build variables to include when building the image. To use values from Tool Kit's environment (since we usually build Docker images on CircleCI, this would be the CI environment), you can use the !toolkit/env tag, e.g. buildArgs: { GIT_COMMIT: !toolkit/env "GIT_COMMIT" } | Record | {} |
_All properties are optional._
| Property | Type |
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| images (\*) | _Object with dynamic keys of type_ string _and values of type_ _Object with properties:_definition: string - The path to the Dockerfile definition file for this imageplatform: string - The platform to target when building the Docker image, e.g. linux/arm64 or linux/amd64registry: string - The registry that the Docker image is pushed to, excluding name and tagname: string (_regex: /^[a-z][a-z-]+$/`_) - The name of the image, excluding a tag |
_(\*) Required._