in Docker
supervisor @ docker means a single container/multi process. So if you want to use python3 on the main process, you think that want to run supervisor via python3 too. Unfortunately, supervisor only supports python2..
via python:3.7-slim & deb's supervisor
use python:3.7-slim
docker image and apt install supervisor
.
- When you type
supervisor
system use /usr/bin/python (= python 2.7) - when you type
python
, it means/usr/local/bin/python
run as root (= python 3.7)
You must set /usr/local/bin
in $PATH higher priority than /usr/bin
.
via multi-stage build (failed)
Create virtualenv via python:2.7 container & copy venv artifacts to python:3.7 container by docker's. But venv don't contain system shared library (such as libpython.so) although make virtualenv with --always-copy
options.
Solutions
- Omunibus. (But i will not consume my time for chef)
- pyenv. (So fat!)