日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

構建python3 docker鏡像

系統 1776 0

在打包鏡像時,centos原生鏡像中python版本為2.7。如果我們的服務基于python3版本,則需要手動安裝。在安裝時,有一點需要注意的是:由于系統中某些服務以來python2.7版本,因此不要去刪除或修改系統中python的默認版本,否則會產生不可預知的后果。下面給出一個python3鏡像打包示例:

            
              # base image
FROM centos:7.2.1511
# install related packages and python3
ENV ENVIRONMENT DOCKER_PROD
RUN cd / && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && yum makecache \
    && yum install -y wget aclocal automake autoconf make gcc gcc-c++ python-devel mysql-devel bzip2 libffi-devel epel-release\
    && wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz \
    && tar -xvf Python-3.7.0.tar.xz -C /usr/local/\
    && rm -rf Python-3.7.0.tar.xz \
    && cd /usr/local/Python-3.7.0 \
    && ./configure && make && make install \
    && yum clean all

# install related python packages
RUN yum install -y python-pip \
    && yum install -y python-setuptools \
    && pip3 install --upgrade pip -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com \
    && pip3 install setuptools==33.1.1 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com \
    && pip3 install jieba==0.39 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com \
    && pip3 install gensim==3.7.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com \
    && pip3 install scipy==1.2.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com \
    && pip3 install pandas==0.24.0 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com \
    && pip3 install tensorflow==1.13.1 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com \

            
          

在進行安裝時,使用 && 連接多行的原因時:減少鏡像層數量,壓縮鏡像體積。


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 庆城县| 梅河口市| 休宁县| 梁山县| 宾阳县| 赣榆县| 辰溪县| 辉南县| 苗栗市| 汉阴县| 中卫市| 镇巴县| 太白县| 康乐县| 石嘴山市| 门源| 平舆县| 石城县| 遵化市| 湄潭县| 浦东新区| 札达县| 富裕县| 湖北省| 天等县| 宁夏| 朝阳区| 浦北县| 漾濞| 阳原县| 通州区| 固始县| 始兴县| 綦江县| 新津县| 新宁县| 舒城县| 阿荣旗| 城市| 屯门区| 巴中市|