arm和x86架构服务器拉取arm64架构的docker镜像

dockerhub提供的镜像部分支持arm64架构

Docker

arm架构服务器拉取docker镜像,默认是arm架构

复制代码
# docker pull centos
Using default tag: latest
latest: Pulling from library/centos
52f9ef134af7: Pull complete 
Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177
Status: Downloaded newer image for centos:latest
docker.io/library/centos:latest

查看docker镜像的架构

复制代码
$ docker inspect centos | grep -i 'architecture'
        "Architecture": "arm64",

x86平台拉取arm平台的docker镜像

对docker版本有限制

docker运行其他平台容器,需要使用--platform参数指定容器

docker19.03.9及以上版本才支持--platform参数

查看是否开启experimental功能

--platform 参数需要experimental为true,通过下面的命令可以验证是否开启

复制代码
docker info | grep -i 'experimental'

开启experimental功能

修改daemon.json文件,增加下面的参数

复制代码
"experimental": true

修改完成后,重启docker来验证

复制代码
systemctl daemon reload
systemctl restart docker

docker info | grep -i 'experimental'

拉取arm平台的镜像

复制代码
docker pull --platform arm64 centos

查看镜像使用的平台

复制代码
$ docker inspect centos | grep -i 'architecture'
        "Architecture": "arm64",

如果不加 --platform参数,默认拉取自己当前cpu平台的镜像

如果本地有相同tag的镜像,只是平台不同的情况下,需要注意区分tag,不然直接docker pull就会覆盖掉之前的镜像,之前的镜像tag会变为<node>

相关推荐
zandy101119 小时前
Agentic BI 架构实战:当AI Agent接管数据建模、指标计算与可视化全链路
人工智能·架构
薪火铺子21 小时前
微服务认证方案对比与选型
微服务·云原生·架构
运维全栈笔记1 天前
K8S部署Redis高可用全攻略:1主2从3哨兵架构实战
redis·docker·云原生·容器·架构·kubernetes·bootstrap
山后太阳1 天前
Keil5(MDK-ARM)完整下载安装教程+入门教程:从零搭建STM32开发环境
arm开发·stm32·嵌入式硬件
zz_lzh1 天前
arm版AI牛马:armbian(rk3588)设备部署openclaw
arm开发·人工智能·arm
weixin_446260851 天前
城市智能化的底层基石:基于腾讯地图服务生态的移动定位与导航架构指引
大数据·人工智能·架构
SCBAiotAigc1 天前
2026.5.1:`DockerDesktop must be owned by an elevated account`错误的解决办法
人工智能·docker·具身智能
@#¥&~是乱码鱼啦1 天前
Spring分层架构:Controller、Service、Mapper数据链路,IOC的真实工作意义
java·spring·架构
vortex51 天前
SafeLine 雷池WAF 真实体验,谈谈架构与原理
架构
该昵称用户已存在1 天前
MyEMS 开源能源管理系统:模块化架构赋能精细化能源管控
架构·开源·能源