docker跨平台构建镜像
amd和arm架构
docker hub中每个镜像基本都提供了两种不同的cpu架构


下载镜像的指定架构版本到本地,可以通过DIGEST这个值来下载,否则下载的是当前系统的架构版本
docker pull telicent/telicent-python3.11 下载当前宿主机cpu架构的镜像
docker pull telicent/telicent-python3.11@sha256:57902d0f4aed717362699687c7eeab8a2a7a4844493ae219d7b57e85bdebf77a

镜像构建
arm的docker镜像无法在amd的宿主机上启动,必须在arm架构主机上运行

在arm主机上构建

自定义镜像操作

docker cp /root/LLM_BigData_Classify/LLM_BigData_Classify 2f5800c17ac4:/home/user/ cd LLM_BigData_Classify/ (app-venv) [user@2f5800c17ac4 LLM_BigData_Classify]$ pip3 install -r requirements.txt -i https://pypi.doubanio.com/simple/ pip3 install -r requirements.txt -i https://pypi.doubanio.com/simple/ docker commit 2f5800c17ac4 bigdata:v1 docker save -o bigdata.tar a2f523be3064 gzip bigdata.tar docker run --network=host -ti bigdata:v1 /bin/sh /home/user/LLM_BigData_Classify/startweb.sh docker inspect your-image:tag | grep "Architecture"
定制镜像打包成功
本文来自博客园,作者:不懂123,转载请注明原文链接:https://www.cnblogs.com/yxh168/p/18952203
浙公网安备 33010602011771号