制作适配鲲鹏架构的Docker镜像的一般方法

通过docker commit命令制作适配的Docker镜像,以httpd为例。
前提条件
在鲲鹏架构的主机上已有Docker服务运行。
操作步骤
- 启动一个CentOS的Docker容器。
1
docker run -itd -p 5000:80 --name xx --privileged centos:latest init
- 进入该容器中。
1
docker exec -it xx /bin/bash
- 安装httpd服务。
1
yum -y install httpd.aarch64
- 启动httpd服务。
1 2
systemctl enable httpd systemctl start httpd
- 此时该容器就是可以在鲲鹏主机上运行的,一个安装了httpd服务的CentOS容器,通过docker commit将其导为镜像。
1
docker commit -m "Commit message" -a "Author" CONTAINER REPOSITORY[:TAG]
通过此命令创建的镜像就是一个自带httpd服务的Docker镜像。
父主题: 更多资源