diff --git a/.drone.yml b/.drone.yml index 5150b94..89c433f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,7 @@ --- kind: pipeline type: ssh -name: Remote SSH +name: 自动构建Python3.10镜像 server: host: 38.55.104.160 @@ -10,6 +10,24 @@ server: from_secret: aus_pw steps: - - name: greeting + - name: Show System Env commands: - echo hello world + - whoami + - date + - ls + - name: Show Docker Env + commands: + - docker ps + - docker images + - name: Build Docker Image + environment: + USERNAME: + from_secret: docker_hub_username + TOKEN: + from_secret: docker_hub_token + commands: + - echo $USERNAME + - docker build . -t lzwang/python3.10:vps -f ./python3.10/Dockerfile + - docker login -u $USERNAME -p $TOKEN + - docker push lzwang/python3.10:nightly diff --git a/python3.10/Dockerfile b/python3.10/Dockerfile index e69de29..ee2bfd7 100644 --- a/python3.10/Dockerfile +++ b/python3.10/Dockerfile @@ -0,0 +1,38 @@ +FROM python:3.10 + +# image info +LABEL Project="Python3.10_debian11" +LABEL Author="lzwang" +LABEL Email="zhuangwang82@gmail.com" +LABEL Version="nightly" + +# 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"]