错误细节:

所执行的命令:

# 启动Django Web服务
python manage.py runserver 0.0.0.0:8000

 所报错误:

PermissionError: [Errno 1] Operation not permitted: ‘/opt/conda/bin/python‘

错误原因:docker版本过低(version 20.x)而容器对应的基础镜像版本过高,如Ubuntu22.04、Debian12等,执行Django服务程序时无法多线程执行。可参考:

This is because the default seccomp profile of Docker 20.10.9 is not adjusted to support the clone() syscall wrapper of glibc 2.34 adopted in Ubuntu 21.10 and Fedora 35.

解决方法:

1、拉取低版本的镜像(Ubuntu20.04及以下版本、Debian11及以下版本),使用新镜像重新运行封装容器(推荐:不会影响已有的docker镜像与容器),如:

# 原始的高版本镜像
docker pull bitnami/pytorch:latest
docker pull bitnami/pytorch:2.2.2-debian-12-r0
 
# 新拉取的低版本镜像
docker pull bitnami/pytorch:2.0.0-debian-11-r0


2、卸载旧版本的docker安装/升级docker至新版本(version 21.x以上),重新运行容器(不推荐:新版本安装过程时间长且容易带来其它问题,可能影响已有的docker镜像与容器);

sudo apt-get upgrade docker-ce

更多推荐