一、出现场景
docker启动容器时,报错:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "gunicorn": executable file not found in $PATH: unknown.
原因为镜像为centos系统,自带了python2.7. 环境变量识别python2.7 里安装的内容.而我另外安装了python3,用python3 install gunicorn. 这些并没有写入环境变量.
二、解决办法
建立软连接,写入环境变量中
ln -s /usr/local/python3/bin/gunicorn /usr/local/bin/gunicorn