Skip to main content

Build Configuration

In this section, we will provide information on the Build Configuration.

Build configuration is used to create and push docker images in the container registry of your application. You will provide all the docker related information to build and push docker images on the Build Configuration page.

Only one docker image can be created for multi-git repository applications as explained in the Git Repository section.

For build configuration, you must provide information in the sections as given below:

  • Store Container Image
  • Build the Container Image
  • Advanced Options

Build Configuration

Store Container Image

The following fields are provided on the Store Container Image section:

Store Image

For Personal POC's, you can use any container registry and repository of your choice. Otherwise, use kapitol if you are working on an application for Kapitol.

FieldDescription
Container RegistrySelect the container registry from the drop-down list or you can click Add Container Registry. This registry will be used to store docker images.
Container RepositoryEnter the name of your container repository, preferably in the format username/repo-name. The repository that you specify here will store a collection of related docker images. Whenever an image is added here, it will be stored with a new tag version. If you are using docker hub account, you need to enter the repository name along with your username. For example - If my username is kartik579 and repo name is devtron-trial, then enter kartik579/devtron-trial instead of only devtron-trial.

Dockerhub

Build the Container Image

In order to deploy the application, we must build the container images to configure a fully operational container environment.

You can choose one of the following options to build your container image:

  • I have a Dockerfile
  • Create Dockerfile
  • Build without Dockerfile

Build Docker Image when you have a Dockerfile

A Dockerfile is a text document that contains all the commands which you can call on the command line to build an image.

Existing Dockerfile

FieldDescription
Select repository containing DockerfileSelect the Git checkout path of your repository. This repository is the same which you defined on the Git Repository section.
Dockerfile Path (Relative)Enter a relative file path where your docker file is located in Git repository. Ensure that the dockerfile is available on this path. This is a mandatory field.

Build Docker Image by creating Dockerfile

With the option Create Dockerfile, you can create a Dockerfile from the available templates. You can edit any selected Dockerfile template as per your build configuration requirements.

New Dockerfile

FieldDescription
LanguageSelect the programming language (e.g., Java, Go, Python, Node etc.) from the drop-down list you want to create a dockerfile as per compatibility to your system. Note We will be adding other programming languages in the future releases.
FrameworkSelect the framework (e.g., Maven, Gradle etc.) of the selected programming language. Note We will be adding other frameworks in the future releases.

Build Docker Image without Dockerfile

With the option Build without Dockerfile, you can use Buildpacks to automatically build the image for your preferred language and framework.

No Dockerfile

FieldDescription
Select repository containing codeSelect your code repository. This repository is the same which you defined on the Git Repository section.
Project Path (Relative)In case of monorepo, specify the path of the project from your Git repository.
LanguageSelect the programming language (e.g., Java, Go, Python, Node, Ruby, PHP etc.) from the drop-down list you want to build your container image as per the compatibility to your system. Note: We will be adding other programming languages in the future releases.
VersionSelect a language version from the drop-down list. If you do not find the version you need, then you can update the language version in Build Env Arguments. You can also select Autodetect in case if you want Builder to detect version by itself or its default version.
Select a builderA builder is an image that contains a set of buildpacks which provide your app's dependencies, a stack, and the OS layer for your app image. Select a buildpack provider from the following options: Heroku, GCR, Paketo.

Build Env Arguments

You can add Key/Value pair by clicking Add argument.

FieldDescription
KeyDefine the key parameter as per your selected language and builder. E.g., By default GOOGLE_RUNTIME_VERSION for GCR buildpack. Note: If you want to define env arguments for PHP and Ruby languages after selecting Heroku builder, please make sure to refer respective Heroku Ruby Support and Heroku PHP Support documentation for runtime information.
ValueDefine the value for the specified key. E.g. Version no. Note This fields are optional. If required, it can be overridden at CI step.

Advanced Options

Set Target Platform for the build Using this option, you can build images for a specific or multiple architectures and operating systems (target platforms). You can select the target platform from the drop-down list or can type to select a customized target platform.

Advance options 1

Advance options 2

If target platform is not set, Devtron will build image for architecture and operating system of the k8s node on which CI is running.

Docker Build Arguments

It is is a collapsed view including the following parameters:

  • Key
  • Value

Build Args

These fields will contain the key parameter and the value for the specified key for your docker build. This field is Optional. If required, this can be overridden at CI step.

Click Save Configuration.