> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nuon.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Build Components

> Docker build components allow you to connect a Dockerfile that will be used to build a container image.

Docker build components allow you to build an existing `Dockerfile` in a public or connected repo, and sync it into your
customer installs.

## Configuring a Docker build component

To configure a Docker build component, specify a repo, the required build parameters and Dockerfile path.

```toml components/app_image.toml theme={null}
# docker-build
name       = "app_image"
type       = "docker_build"
dockerfile = "Dockerfile"

[connected_repo]
directory = "components/app-image"
repo      = "<your-app>"
branch    = "main"
```

You can configure Docker build components to use either a public repo (using a `public_repo` block) or a private GitHub
repo (using a `connected_repo` block). Read more about VCS configuration [here](/guides/vcs).

## Deployments

Docker build components *cannot* be deployed directly in a customer install. When an image is released, it will be *synced*
into the customer install and made available to other components via [variables](/guides/using-variables).

To deploy a Docker build component, reference the image from a Helm Component or Terraform Component or an Action:

```toml components/eks_deployment.toml theme={null}
# helm
name       = "eks_deployment"
type       = "helm_chart"
chart_name = "<your-app>"

[connected_repo]
repo      = "<your-app>"
directory = "components/helm-chart"
branch    = "main"

[values]
"env.IMAGE_TAG"        = "{{.nuon.components.app_image.image.tag}}"
"env.IMAGE_REPOSITORY" = "{{.nuon.components.app_image.image.repository.uri}}"
```

```toml components/ecs_service.toml theme={null}
# terraform
name              = "ecs_service"
type              = "terraform_module"
terraform_version = "1.11.3"

[connected_repo]
repo      = "<your-app>"
directory = "components/ecs-service"
branch    = "main"

[vars]
"image_tag"        = "{{.nuon.components.app_image.image.tag}}"
"image_repository" = "{{.nuon.components.app_image.image.repository.uri}}"
```

```toml actions/eks_job.toml theme={null}
# action
name      = "eks_job"
type      = "job"
image_url = "{{.nuon.components.app_image.image.repository.uri}}"
tag       = "{{.nuon.components.app_image.image.tag}}"
```

## Image Syncing

When a Docker build component is released, Nuon will automatically sync the image into the end customer account. This
image is stored in a local registry that is provisioned in the customer account.

Nuon image syncing allows you to sync images into accounts, without worrying about cross account permissions, registry
authentication or publishing public images. Any `Dockerfile` in a repo can be built, and synced.

The sync process works by creating a 1-time authentication flow that grants the Install Runner access to pull the image
from the org data plane, and copy it into the local registry.

## Build Arguments and Environment Variables

You can specify custom build arguments and environment variables to be used when building an image:

<Note>
  If you have custom build requirements, we recommend building your images from within your own CI/CD platform, and using
  a [container image](/guides/container-image-components.mdx) to import them.
</Note>
