使用Docker Hub镜像构建深度学习容器执行bash命令报错求助
解决Docker运行continuumio镜像时/bin/bash无法执行的问题
问题根源:你使用的
continuumio/conda-ci-linux-64-python3.7镜像是基于x86_64架构构建的,若本地机器为ARM架构(比如Apple Silicon系列Mac),Docker默认直接运行x86镜像会出现二进制兼容问题,导致无法执行bash。解决方案1:指定架构运行
添加--platform linux/amd64参数强制Docker以x86_64架构运行镜像,修改后的命令为:docker run -it --platform linux/amd64 --name test_conda continuumio/conda-ci-linux-64-python3.7:latest bash解决方案2:更换适配本地架构的镜像
若为ARM架构机器,可使用支持多架构的conda镜像(如condaforge/miniforge3),示例命令:docker run -it --name test_conda condaforge/miniforge3:latest bash进入容器后可自行搭建Python 3.7环境:
conda create -n py37 python=3.7 conda activate py37验证方法:先查看本地Docker架构:
docker info | grep Architecture再查看镜像支持的架构:
docker inspect continuumio/conda-ci-linux-64-python3.7:latest | grep -i architecture两者不一致则会触发该错误。
内容的提问来源于stack exchange,提问作者nothing
相关产品推荐
相关产品推荐

