Help Center> CodeArts Build> User Guide> Other Operations> Custom Build Environments
Updated on 2023-12-21 GMT+08:00

Custom Build Environments

Background

If the common build environments cannot meet your requirements, customize an environment. To do this, add dependencies and tools required by the project to the base image of the custom environment, build the image into a Docker image and push it to SWR for public use. Then you can use the public image through SWR.

Base Image

CodeArts Build uses CentOS 7 and Ubuntu 18 as the base images, which are provided with multiple common environment tools. You can configure custom environments as required.

The built-in environment tools include:

JDK 1.8, Maven, Git, Ant, zip, unzip, GCC, CMake, and Make

Procedure

  1. Log in to the CodeArts Build homepage.
  2. In the upper right corner of CodeArts Build homepage, click More and choose Custom Build Environments from the drop-down list.
  3. On the Custom Build Environments page, click a base image to download the Dockerfile template.

  4. Edit the downloaded Dockerfile.

    You can add other dependencies and tools required by the project as required to customize the Dockerfile. The following figure shows an example of adding JDK and Maven tools.
    RUN yum install -y java-1.8.0-openjdk.x86_64
    RUN yum install -y maven
    RUN echo 'hello world!'
    RUN yum clean all