Docker build components allow you to build an existing Dockerfile in a public or connected repo, and sync it into your customer installs. Please refer to the Terraform reference for full configuration options.

Configuring a Docker build component

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

resource "nuon_docker_build_component" "e2e" {
name   = "e2e_docker_build"
  app_id = nuon_app.main.id

  dockerfile = "Dockerfile"

  connected_repo = {
    directory = "components/go-httpbin"
    repo      = "powertoolsdev/demo"
    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.

Deployments

Docker build components can not 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.

To deploy a Docker build component, reference the image from a Helm component, Terraform component or Job component:

  name   = "helm"
  app_id = nuon_app.main.id

  value {
    name = "env.IMAGE_TAG"
    value = "{{.nuon.components.image.image.tag}}"
  }
  value {
    name = "env.IMAGE_REPOSITORY"
    value = "{{.nuon.components.image.image.repository.uri}}"
  }
}

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:

If you have custom build requirements, we recommend building your images from within your own CI/CD platform, and using a container image to import them.