我从ubuntu:18.04制作了镜像并安装了python。
然而,当我在docker-compose中这样做的时候
command: python manage.py runserver它显示路径错误。
也许我没有设定路径??
但是我如何为docker用户设置路径??
ERROR: for django Cannot start service django: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"python\": executable file not found in $PATH": unknown
ERROR: Encountered errors while bringing up the project.
FROM ubuntu:18.04
ENV PYTHONUNBUFFERED 1
RUN apt-get -y update
RUN apt-get -y install emacs wget
RUN apt-get -y install apache2-dev mysql-client
RUN apt-get -y install mysql-server libmysqlclient-dev
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN apt-get install -y python3.7
RUN apt-get install -y python-pip
RUN pip install uwsgi django mysqlclient tensorflow_hub django-mysql django-extensions djangorestframework django-filter requests_oauthlib mecab-python3 neologdn gensim janome --no-input
RUN pip install keras tensorflow==1.14.0 --no-cache-dir --no-input
RUN mkdir /code
WORKDIR /code
ADD ./src /code/发布于 2020-03-26 15:14:15
你可以用两种方法来解决这个问题(对我来说很有效):
在docker-compose add中:
command: bash -c 'python manage.py runserver'或者您可以在Dockerfile中添加CMD命令:
CMD: python manage.py runserverhttps://stackoverflow.com/questions/60858868
复制相似问题