Rate This Document
Findability
Accuracy
Completeness
Readability

Rebuilding an Image

After the container image is migrated, address any dependency compatibility issues identified in the migration report, and include the relevant content in the output resource package. Next, in the build environment, use the local image build tool to rebuild the image from the resource package.

Procedure

  1. After the container migration is complete, a compatible file directory and an incompatible file directory are generated in the container image package output path.
    Figure 1 Task information
    Figure 2 Output file
    • incompatible: stores files that are incompatible with the Arm architecture. The directory structure is the same as that of the original image.
    • output: stores files that are compatible with the Arm architecture. The directory structure is the same as that of the original image.
  2. Obtain the software packages. If there are no dependency files to be migrated, proceed directly to step 6.

    Obtain the corresponding software package (RPM/DEB/JAR) or source code based on the Handling Suggestions under Architecture-Related Dependencies.

    Figure 3 Architecture-Related Dependencies
    • If the analysis result is Adaptable for Compatibility and the replacement status is Replaced, you can find the replaced software package in the output directory.
    • If the analysis result is Adaptable for Compatibility and the replacement status is Not replaced, you can find the related file in the incompatible directory. Click Download to obtain the corresponding software package (RPM/DEB/JAR), or click Go to Community to download the corresponding source code.
    • If the analysis result is To Be Confirmed, you can find the corresponding file in the incompatible directory and manually handle the problem as suggested.
  3. Obtain the dependency files.
    • RPM package
      • Method 1: Directly install the package to generate the dependency files.
        rpm -ivh package.rpm
      • (Recommended) Method 2: Extract the RPM package and find the dependency files.
        rpm2cpio package.rpm | cpio -idmv

      package indicates the name of the software package to be downloaded.

    • DEB package
      • Method 1: Directly install the package to generate the dependency files.
        dpkg -i package.deb
      • (Recommended) Method 2: Extract the DEB package and find the dependency files.
        dpkg-deb -x package.deb ./extract_dir
      • package indicates the name of the software package to be downloaded.
      • extract_dir indicates the extracted directory.
    • JAR package: Use the downloaded JAR package to replace the incompatible JAR package in the migration environment.
    • Source code: Click Go to Community to obtain the source code and install it based on the integrated guide to generate dependency files.
  4. Replace the dependency files in the Dependency File Path directory with the newly generated or extracted dependency files.

    The incompatible files in the original image package are stored in the incompatible directory. Use the dependency files obtained in 3 to replace the incompatible files in the corresponding directory.

  5. Include the relevant content in the output resource package.

    After resolving all incompatible files in the incompatible directory, merge all files into the output directory to obtain the final list of build dependency resources.

  6. Build an image again.

    Based on the Dockerfile file and build dependency resource files specified in the container migration result, run the docker build command to rebuild an Arm-compatible image.

    Figure 4 Dockerfile