由于使用centos和ubuntu制作的python3.7.4的镜像太大所以又使用alpine 3.10制作了一个python3.7镜像,大小只有384M;centos由于自带python2的包,制作python3.7的docker镜像为800+M
Dockerfile:
FROM docker.io/alpine:latest
MAINTAINER author:weifeng email:weifeng_nuaa@126.com
COPY Python-3.7.4.tar.xz /root
WORKDIR /root
RUN echo “http://mirrors.aliyun.com/alpine/latest-stable/main”>/etc/apk/repositories
&& apk add gcc libffi-dev python-dev openssl-dev make zlib-dev libc-dev
&& tar -xf Python-3.7.4.tar.xz
&& rm -rf Python-3.7.4.tar.xz \
&& cd Python-3.7.4
&& ./configure
&& make
&& make install
&& pip3 install --upgrade pip
&& rm -rf /root/Python-3.7.4
CMD /bin/sh
alpine 3.10制作python 3.74的docker镜像
最新推荐文章于 2024-04-03 15:02:30 发布