学习是一个逐步发现自己无知的过程!

构建python运行环境的镜像

FROM centos:7

LABEL maintainer="XIN LIU <sitliux@foxmail.com>"
LABEL version="1.0.0"

#定义时区参数
ENV TZ=GMT

#安装必要应用
RUN yum -y install make gcc kde-l10n-Chinese glibc-common epel-release vim openssl-devel bzip2-devel libffi-devel xz-devel groupinstall "Development Tools"

RUN ln -snf /usr/share/zoneinfo/GMT /etc/localtime && echo "$TZ" > /etc/timezone &&\
    localedef -c -f UTF-8 -i zh_CN zh_CN.utf8

WORKDIR /app

#设置环境变量
ENV LC_ALL zh_CN.utf8

ADD Python-3.8.6.tgz /app

RUN cd /app/Python-3.8.6 && \
    ./configure --enable-optimizations &&\
    make altinstall

RUN pip3.8 install datetime &&\
    pip3.8 install requests

RUN pip3.8 install urllib3==1.25.11

#COPY send_ssl_time.py /app
COPY start.sh /app

#CMD ["sh","-c","./start.sh","/usr/local/bin/python3.8", "./send_ssl_time.py"]
CMD ["sh","-c","./start.sh"]
赞(0)
未经允许不得转载:劉大帥 » 构建python运行环境的镜像

你的评论可能会一针见血! 抢沙发

登录

找回密码

注册