Skip to main content

Initial image build

Why do we only automate the first build?

We make a first build of the image to deploy your apps faster, as we take advantage of the already active infrastructure. New images are built when services are published in deployments.

Info: CLI Tool

Builds and Deployments can be automated with our CLI tool. More info here.

How and when does Sleakops builds the image?

When a project is created, you need to point to a path within the git repository where the Dockerfile is. Sleakops scans the Dockerfile in search of arguments that are necessary for the build and asks you for values to make this first build. The project list indicates the state of every project, and whether some extra information is required. The values you provide for this initial build aren't meant to be permanent and can be modified for future builds.

The first image is built once the ProjectEnv is created, other images should be created on-demand by the user. You should know that SleakOps will always use the last commit to make a Build unless you set the specific commit but to do this you have to manage it creating a Build manually on the Build form, for more info read Build documentation. When you have provided all the arguments for the Dockerfile, a Kubernetes job is launched, along with a persistent volume for storage and the corresponding authentication secrets.

Finally, the image is pushed to the ECR of the project, which is hosted in an AWS ECR as described on the Project documentation . The resulting image has the ProjectEnv name which will be a combination of both Environment name and Project name.

Summary of resources created in the cluster

As previously discussed when the Kaniko job is launched, all the resources listed below are also created inside the respective cluster:

  • A cluster secret containing the ECR credentials needed to push the image.
  • A persistent volume for the Kaniko tasks to store the context it needs.
  • The respective persistent volume claim.
  • The job itself.