Building a Docker Image

Docker Image is a file, comprised of multiple layers, that is used to execute code in a Docker container. This approach allow us to build very customized environments and package it in a file to quickly run a specific application.

The Docker Image is used in Carol for the optimization and isolation of processes. The developer can build, validate and deploy the Docker Image, after that, run it on top of Carol to deliver the desired value that his application needs.

If you need more information about Docker, please, refer to its official documentation: https://www.docker.io

Carol allows the user to build the Docker Image through two different flows, with its own characteristics:

703703

For the following steps, it is being used the public repository for Carol Apps: https://github.com/totvslabs/carolapp-samples

Jupyter Lab Flow

The flow in Jupyter Lab allows the user to build the Docker Image using the project in the Jupyter Lab instance (the local storage). This brings more flexibility to the user allowing to build any image (without push code to Github).

steps

  • clone the repository (link here)
  • make sure you have a Docker file
  • click on build image
  • choose the right DOcker file
  • review the name and tag
  • ask to build

The first step is to clone the Github repository, in this case, I am using the repository: https://github.com/totvslabs/carolapp-samples

16421642

After cloning the repository, we can see that the button "Build Image" button is enabled, since our project has the file "Dockerfile".

16361636

Clicking on the button "Build Image", the following screen will show up, we need to make sure we are selecting the file "/carolapp-samples/batch_carolapp/Dockerfile". This file has the Docker definition, needed to build the custom Image for our application.

This file was created through the steps to create a new Carol App (Online or Batch), following this documentation: https://docs.carol.ai/docs/carol-app-dev

901901

After that, you need to specify the Image name and the Tag.

📘

Update the manifest file with the Docker Image Name and Tag

Remember to make sure that the manifest file has the same Docker Image Name you are defining here. You can follow the documentation about the manifest file here: https://docs.carol.ai/docs/manifest-file

900900

Once everything is set we can hit the button "Build Image".

902902

The process will take a few minutes, that task will have the path for this new Docker Image.

Carol App Flow (Github)

The flow in Carol App allows the user to build the Docker Image using a specific repository, as specified in the manifest file (more details here).

Before starting the flow, it is possible to visualize the button "Build" is disabled, it happens because this application does not have a valid "manifest" file uploaded.

16361636

After uploading the manifest file we just generated through the documentation to build a Batch Carol App, the Build button shows enabled.

16351635

Clicking on the button, it will open the following screen where it is needed to select the Carol Ap process to build the Docker Image.

🚧

External Private Git Repository

In case the Github repository is private, you need to paste the Github Token. To get more information on how to generate the token, please, refer to the following link: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

899899

On the next screen, you can inform the tag for this new Docker Image. The name is not editable since it is coming from the manifest file.

In case you choose a different tag, you need to update the manifest file and upload it over again.

900900

Once you hit on Build Image, the following screen will show up saying Carol is building the Docker Image.

902902