39 lines
1.2 KiB
Docker
39 lines
1.2 KiB
Docker
FROM python:3.10
|
|
|
|
# image info
|
|
LABEL Project="PythonUniversal"
|
|
LABEL Author="lzwang"
|
|
LABEL Email="zhuangwang82@gmail.com"
|
|
LABEL Version="20220903"
|
|
|
|
# setup volume
|
|
VOLUME /project
|
|
|
|
# setup workdir
|
|
WORKDIR /project
|
|
|
|
# setup mirrors of pip
|
|
# https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
|
|
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
# setup timezone
|
|
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
&& date
|
|
|
|
# setup mirrors of apt
|
|
# https://mirrors.tuna.tsinghua.edu.cn/help/debian/
|
|
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free" > /etc/apt/sources.list \
|
|
&& echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list \
|
|
&& echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free" >> /etc/apt/sources.list \
|
|
&& echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free" >> /etc/apt/sources.list
|
|
|
|
# update apt packages
|
|
RUN apt-get update -y && apt-get upgrade -y \
|
|
&& apt-get install apt-utils -y \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# setup alias
|
|
RUN echo "alias ll='ls -la'" >> /root/.bashrc
|
|
|
|
CMD ["python3"]
|