---
title: 制作适配鲲鹏架构的Docker镜像的一般方法
description: "通过docker commit命令制作适配的Docker镜像，以httpd为例。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengcpfs/ecosystemEnable/Docker/kunpengdocker_03_0011.html
sourcePath: /source/zh/kunpengcpfs/ecosystemEnable/Docker/kunpengdocker_03_0011.html
indexId: 17d67a091b3230e8eda25621ce62e7af0e5f276358892e4a58f3b7488d00e72272
---
# 制作适配鲲鹏架构的Docker镜像的一般方法

通过docker commit命令制作适配的Docker镜像，以httpd为例。


#### 前提条件

在鲲鹏架构的主机上已有Docker服务运行。


#### 操作步骤

1. 启动一个CentOS的Docker容器。
  1 docker run -itd -p 5000:80 --name xx --privileged centos:latest init

2. 进入该容器中。
  1 docker exec -it xx /bin/bash

3. 安装httpd服务。
  1 yum -y install httpd.aarch64

4. 启动httpd服务。
  1 2 systemctl enable httpd systemctl start httpd

5. 此时该容器就是可以在鲲鹏主机上运行的，一个安装了httpd服务的CentOS容器，通过docker commit将其导出为镜像。
  1 docker commit -m "Commit message" -a "Author" CONTAINER REPOSITORY[:TAG]

  通过此命令创建的镜像就是一个自带httpd服务的Docker镜像。
