将特使Dockerfile基本映像更新为python 3.6+;
我尝试将特使库图像中的python版本更新为将特使Dockerfile基本映像更新为python 3.6+;,python,docker,envoyproxy,Python,Docker,Envoyproxy,我尝试将特使库图像中的python版本更新为python-3.6。但它不起作用 这里是我必须使用的基本图像(特使代理),默认情况下它具有python-3.5.2 这是我的deadsnake/ppa apt-get-update版本 FROM envoyproxy/envoy:latest RUN apt-get update && apt-get -q install -y \ curl \ software-properties-common \ p
python-3.6
。但它不起作用
这里是我必须使用的基本图像(特使代理),默认情况下它具有python-3.5.2
这是我的deadsnake/ppa apt-get-update版本
FROM envoyproxy/envoy:latest
RUN apt-get update && apt-get -q install -y \
curl \
software-properties-common \
python-software-properties
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get -q install -y \
python3.6 \
python3-pip
RUN python3 --version && pip3 --version
RUN pip3 install gunicorn
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r ./requirements.txt
RUN mkdir /code
WORKDIR /code
COPY . /code
ADD ./boot.sh /usr/local/bin/boot.sh
RUN chmod u+x /usr/local/bin/boot.sh
ENTRYPOINT /usr/local/bin/boot.sh
非常感谢您的帮助或一些提示,以便我自己找到解决方案。python3和pip3exec指向系统python3.5 我建议在python3.6上安装pip,并始终使用python3.6和pip3.6来引用新版本
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
RUN python3.6 --version && pip3.6 --version
RUN pip3.6 install --no-cache-dir -r ./requirements.txt
所以我用@pbacterio建议更新了Dockerfile,它现在可以工作了!多谢各位
FROM envoyproxy/envoy:latest
RUN apt-get update && apt-get -q install -y \
curl \
software-properties-common \
python-software-properties
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get -q install -y \
python3.6 \
python3-pip
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
RUN python3.6 --version && pip3.6 --version
COPY requirements.txt .
RUN pip3.6 install --no-cache-dir -r ./requirements.txt
RUN pip3.6 install gunicorn
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN mkdir /code
WORKDIR /code
COPY . /code
ADD ./boot.sh /usr/local/bin/boot.sh
RUN chmod u+x /usr/local/bin/boot.sh
ENTRYPOINT /usr/local/bin/boot.sh
啊哈。看来你还没有完全解决。“但它不工作”-请详细解释:a)未安装python3.6,b)python3.6未运行?嗨,Alex,再次感谢您的帮助。如果我使用“docker run-it sh”运行容器并查找已安装的版本,则会安装python 3.6,但当我键入“python3”时,会执行python 3.5.2。对不起,我知识不多。
FROM envoyproxy/envoy:latest
RUN apt-get update && apt-get -q install -y \
curl \
software-properties-common \
python-software-properties
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update && apt-get -q install -y \
python3.6 \
python3-pip
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
RUN python3.6 --version && pip3.6 --version
COPY requirements.txt .
RUN pip3.6 install --no-cache-dir -r ./requirements.txt
RUN pip3.6 install gunicorn
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN mkdir /code
WORKDIR /code
COPY . /code
ADD ./boot.sh /usr/local/bin/boot.sh
RUN chmod u+x /usr/local/bin/boot.sh
ENTRYPOINT /usr/local/bin/boot.sh