开发者
资源
我要评分
获取效率
正确性
完整性
易理解
在线提单
论坛求助

容器镜像迁移功能说明

命令功能

可以通过命令行工具进行容器镜像迁移,基于用户导出的镜像包和Dockerfile文件进行分析,可生成迁移后的Dockerfile和构建镜像资源文件,以及兼容性分析报告。

容器迁移支持命令行和WebUI两种方式。

  • (推荐)命令行端:基于用户提供的镜像包和Dockerfile,可生成迁移后的镜像Dockerfile和兼容性扫描结果文件,便于用户构建Arm架构镜像。
  • WebUI端:仅提供容器部署能力,不对原始镜像进行分析。

命令格式

仅支持Linux环境。
1
devkit sys-mig [-h | --help] {-c container_mig | --command container_mig} {-i image_path | --image image_path} [-dockerfile dockerfile_path | --dockerfile dockerfile_path] [-o report_dir | --output report_dir] [-l {0,1,2,3} | --log-level {0,1,2,3}]

参数说明

表1 参数说明

参数

参数选项

说明

-h/--help

-

可选参数,获取帮助信息。

-c/--command

stmt/sbom/mvn_analyse/container_mig

必选参数,收集信息的模式。

  • stmt(默认):收集台账信息,可生成CSV报告。
  • sbom:收集成分信息,可生成HTML或JSON报告。
  • mvn_analyse:Maven工程源码迁移分析,可生成HTML报告。
  • container_mig:容器镜像迁移,可生成Dockerfile、构建依赖资源文件,以及HTML和JSON报告。

-i/--image

-

必选参数,输入需要迁移的x86镜像包,该镜像包可通过docker save导出。

例如:/home/image-centos.tar。

说明:

“-c”“container_mig”时,该参数为必选参数。

-dockerfile/--dockerfile

-

可选参数,输入构建镜像时使用的Dockerfile文件。

例如:/home/Dockerfile-image-centos。

-o/--output

-

可选参数,报告输出目录,默认为sys-mig二进制所在report目录。

例如:/home/report。

-l/--log-level

0/1/2/3

可选参数,设置日志级别,默认为1。
  • 0:日志级别为DEBUG。
  • 1:日志级别为INFO。
  • 2:日志级别为WARNING。
  • 3:日志级别为ERROR。

使用示例

此处以扫描my-test-image-centos-3.tar镜像包、Dockerfile为Dockerfile-my-test-image-centos-3、日志级别为DEBUG为例,请根据实际情况修改。
devkit sys-mig -c container_mig --image /home/demo/os_image/my-test-image-centos-3.tar --dockerfile /home/demo/os_image/Dockerfile-my-test-image-centos-3 -l 0

返回信息如下。

debug: Enter the second level command: sys-mig

[2026-05-19 19:31:54,499] [INFO] Creating file indexing...
[2026-05-19 19:31:54,499] [INFO] Parsing...

The analysis may take some time if the source package is large or has many files. Please wait...
Scanning start time: 2026/05/19 19:31:54

[2026-05-19 19:31:54,499] [INFO] Start container migration process.
[2026-05-19 19:31:54,499] [INFO] input image: /home/demo/os_image/my-test-image-centos-3.tar
[2026-05-19 19:31:54,499] [INFO] input dockerfile: /home/demo/os_image/Dockerfile-my-test-image-centos-3
[2026-05-19 19:31:54,500] [INFO] log_level: 0
[2026-05-19 19:31:54,500] [INFO] output: /home/demo/DevKit-CLI-26.1.RC1-Linux-Kunpeng/sys-mig/report
[2026-05-19 19:31:54,559] [INFO] Start to parse dockerfile...
[2026-05-19 19:31:54,562] [INFO] Dockerfile base image is specified to AMD64.
[2026-05-19 19:31:54,562] [INFO] Dockerfile specified base image is not in the whitelist. Will check if base exists: centos:7

Parse image package metadata and layer information
[2026-05-19 19:31:54,563] [INFO] Start to perform image analysis.
[2026-05-19 19:31:54,564] [INFO] Start to unzip image package to target directory: /home/demo/DevKit-CLI-26.1.RC1-Linux-Kunpeng/sys-mig/report/container_parser_work/image_rootfs.
...
Generating the migration report
[2026-05-19 19:32:58,438] [INFO] Generating Migration Report and Output Bundle:
[2026-05-19 19:32:58,439] [INFO] Start to generate migration report...
[2026-05-19 19:32:58,439] [INFO] Generate scan report file start.
[2026-05-19 19:32:58,486] [INFO] Generating Migration Report and Output Bundle Successful.

Configuration
   Input Path: /home/demo/os_image/my-test-image-centos-3.tar
   Output Path: /home/DevKit-CLI-26.1.RC1-Linux-Kunpeng/sys-mig/report/sys-mig_xx.xx.xx.xx_20260519193154
   Mode: dockerfile_and_image
   Image: my-test-image-centos-3:latest
   OS: CentOS Linux 7 (Core)
   Dockerfile: /home/demo/os_image/Dockerfile-my-test-image-centos-3

Statistics on Files to Be Migrated Dependencies
   Total Files: 11
   Adaptable for Compatibility: 10
   To Be Confirmed: 1

Migration task status: Success
   The container image migration assessment was successful. Resolve the dependencies according to 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.

For the details information, please check:
/home/DevKit-CLI-26.1.RC1-Linux-Kunpeng/sys-mig/report/sys-mig_xx.xx.xx.xx_20260519193154/Container_Mig_20260519193154_zh.json
/home/DevKit-CLI-26.1.RC1-Linux-Kunpeng/sys-mig/report/sys-mig_xx.xx.xx.xx_20260519193154/Container_Mig_20260519193154_en.json
/home/DevKit-CLI-26.1.RC1-Linux-Kunpeng/sys-mig/report/sys-mig_xx.xx.xx.xx_20260519193154/Container_Mig_20260519193154.html

Generated dockerfile: /home/DevKit-CLI-26.1.RC1-Linux-Kunpeng/sys-mig/report/sys-mig_xx.xx.xx.xx_20260519193154/Dockerfile

容器镜像迁移完成后,需要根据迁移报告处理可兼容依赖并重新构建镜像,具体操作请参见重新构建镜像

  • “For the details information”为迁移报告存放路径。
  • “Generated dockerfile”为Dockerfile输出结果的存放路径。