docker打包 arm32v7/debian 问题总结

1.架构不同

我的宿主是x86 ,但是打包的是arm架构

安装qemu

sudo apt-get install binfmt-support qemu qemu-user-static

然后使用buildx打包

docker buildx build --no-cache --platform linux/arm/v7 -t tdc_post:1.0.1 . --load

保存tar

docker save -o tdc_post.tar tdc_post:1.0.0

2. 安装库报错

直接pip3 install -r requestments.txt 的时候报错

修改为执行apt-get install python3-xxx

python 复制代码
FROM arm32v7/debian AS build


# Run installs
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    apt-utils \
    python3 \
    python3-pip \
    python3-dev \
    python3-fastapi \
    python3-sqlalchemy

# pip install needed libraries with cert
RUN pip3 install requests --break-system-packages

RUN pip3 install pyyaml --break-system-packages
# Create a directory for the app
WORKDIR /app

# Copy the necessary Python files
COPY . .


# Set the entry point command
CMD ["python3", "start.py"]
相关推荐
Johny_Zhao2 小时前
Docker + CentOS 部署 Zookeeper 集群 + Kubernetes Operator 自动化运维方案
linux·网络安全·docker·信息安全·zookeeper·kubernetes·云计算·系统运维
zwjapple3 小时前
docker-compose一键部署全栈项目。springboot后端,react前端
前端·spring boot·docker
代码老y5 小时前
Docker:容器化技术的基石与实践指南
运维·docker·容器
DuelCode6 小时前
Windows VMWare Centos Docker部署Springboot 应用实现文件上传返回文件http链接
java·spring boot·mysql·nginx·docker·centos·mybatis
两斤半10 小时前
Debian TTY环境乱码
linux·debian
杨浦老苏10 小时前
开源服务运行监控工具Lunalytics
docker·群晖·网站监控
呆萌的代Ma16 小时前
解决Mac上的老版本docker desktop 无法启动/启动后一直转圈/无法登陆账号的问题
macos·docker·eureka
feilieren17 小时前
Docker 安装 Elasticsearch 9
运维·elasticsearch·docker·es
KaiwuDB17 小时前
使用Docker实现KWDB数据库的快速部署与配置
数据库·docker
cleble18 小时前
(转)使用DockerCompose部署微服务
docker