自动化构建 Python 3.10
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
0fbc6465b8
commit
3abdbf05e2
22
.drone.yml
22
.drone.yml
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: ssh
|
type: ssh
|
||||||
name: Remote SSH
|
name: 自动构建Python3.10镜像
|
||||||
|
|
||||||
server:
|
server:
|
||||||
host: 38.55.104.160
|
host: 38.55.104.160
|
||||||
|
@ -10,6 +10,24 @@ server:
|
||||||
from_secret: aus_pw
|
from_secret: aus_pw
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: greeting
|
- name: Show System Env
|
||||||
commands:
|
commands:
|
||||||
- echo hello world
|
- 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
|
||||||
|
|
|
@ -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"]
|
Loading…
Reference in New Issue