One - One Code All

Blog Content

基于Ubuntu的python3的Docker镜像

Python 容器化 运维   2019-11-18 11:27:12

ubuntu版本及python版本对应

ubuntu-18.04 : python-3.6

ubuntu-19.10 : python-3.7

ubuntu-20.04 : python-3.8


镜像Dockerfile

FROM docker.io/ubuntu:19.10

RUN mkdir -p  /opt/workspace/
COPY ./app  /opt/workspace/
WORKDIR /opt/workspace/

RUN apt-get update && \
    apt-get install -y python3 \
                        python3-dev \
                        python3-pip \
                        iputils-ping \
    && apt-get clean \
    && apt-get autoclean \
    && python3 -m pip install --upgrade pip  --no-cache-dir -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com \

    && python3 -m pip install --no-cache-dir --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple/ \
    			wheel==0.34.2 \

    && python3 -m pip install --no-cache-dir --trusted-host mirrors.aliyun.com -i http://mirrors.aliyun.com/pypi/simple/ \
                bert-serving-client==1.10.0 \
                Flask==1.1.2 \
        		Flask-RESTful==0.3.8 \
                gevent==1.4.0 \
                greenlet==0.4.16 \
                gunicorn==20.0.4 \
                numpy==1.19.0 \
                pymilvus==0.2.13 \
                requests==2.24.0 \
                scikit_learn==0.23.1 \
    && rm -rf /var/lib/apt/lists/*
    
EXPOSE 80
CMD ["bash"]



上一篇:npm离线安装elasticdump工具
下一篇:redis4.0.14编译安装

The minute you think of giving up, think of the reason why you held on so long.