From 708d9951a16c89795c4ae8f560bfffde6f807e23 Mon Sep 17 00:00:00 2001 From: darkatse Date: Tue, 19 Apr 2022 18:30:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDockerfile=E7=9A=84?= =?UTF-8?q?=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3ec3b53..0b88053 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,9 @@ FROM python:3-alpine -LABEL maintainer="mailto@wolfbolin.com" +LABEL maintainer="x.yangtze.river@gmail.com" ENV CRON_SIGNIN='30 9 * * *' ENV MULTI=TRUE ENV TZ=Asia/Shanghai -RUN adduser app -D RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ && apk add --no-cache tzdata @@ -12,7 +11,6 @@ WORKDIR /tmp ADD requirements.txt ./ RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt -USER app WORKDIR /var/app COPY . /var/app From 771262e13c1397004a8c702e7c09b8a48b2ab297 Mon Sep 17 00:00:00 2001 From: Darkatse <39111369+Darkatse@users.noreply.github.com> Date: Mon, 18 Jul 2022 17:53:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Docker=E6=96=B9=E5=BC=8F=E6=B7=BB=E5=8A=A0A?= =?UTF-8?q?rm=E6=9E=B6=E6=9E=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.arm32v6 | 18 ++++++++++++++++++ Dockerfile.arm32v7 | 18 ++++++++++++++++++ Dockerfile.arm64v8 | 18 ++++++++++++++++++ make-docker.sh | 18 ------------------ 4 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 Dockerfile.arm32v6 create mode 100644 Dockerfile.arm32v7 create mode 100644 Dockerfile.arm64v8 delete mode 100644 make-docker.sh diff --git a/Dockerfile.arm32v6 b/Dockerfile.arm32v6 new file mode 100644 index 0000000..6dd4a56 --- /dev/null +++ b/Dockerfile.arm32v6 @@ -0,0 +1,18 @@ +FROM arm32v6/python:3-alpine +COPY qemu-arm-static /usr/bin/ +LABEL maintainer="x.yangtze.river@gmail.com" + +ENV CRON_SIGNIN='30 9 * * *' +ENV MULTI=TRUE +ENV TZ=Asia/Shanghai +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ + && apk add --no-cache tzdata + +WORKDIR /tmp +ADD requirements.txt ./ +RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt + +WORKDIR /var/app +COPY . /var/app + +CMD ["python3", "./docker.py" ] diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 new file mode 100644 index 0000000..288f953 --- /dev/null +++ b/Dockerfile.arm32v7 @@ -0,0 +1,18 @@ +FROM arm32v7/python:3-alpine +COPY qemu-arm-static /usr/bin/ +LABEL maintainer="x.yangtze.river@gmail.com" + +ENV CRON_SIGNIN='30 9 * * *' +ENV MULTI=TRUE +ENV TZ=Asia/Shanghai +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ + && apk add --no-cache tzdata + +WORKDIR /tmp +ADD requirements.txt ./ +RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt + +WORKDIR /var/app +COPY . /var/app + +CMD ["python3", "./docker.py" ] diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 new file mode 100644 index 0000000..e34e2d5 --- /dev/null +++ b/Dockerfile.arm64v8 @@ -0,0 +1,18 @@ +FROM arm64v8/python:3-alpine +COPY qemu-arm-static /usr/bin/ +LABEL maintainer="x.yangtze.river@gmail.com" + +ENV CRON_SIGNIN='30 9 * * *' +ENV MULTI=TRUE +ENV TZ=Asia/Shanghai +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ + && apk add --no-cache tzdata + +WORKDIR /tmp +ADD requirements.txt ./ +RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt + +WORKDIR /var/app +COPY . /var/app + +CMD ["python3", "./docker.py" ] diff --git a/make-docker.sh b/make-docker.sh deleted file mode 100644 index e6e5008..0000000 --- a/make-docker.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -docker_name="mihoyo-bbs" -docker stop ${docker_name} -docker rm ${docker_name} -echo -e "\033[5;36mOrz 旧容器(镜像)已清理\033[0m" - -time_now=$(date "+%m%d%H") -docker build -f Dockerfile --tag ${docker_name}:"${time_now}" . -echo -e "\033[5;36mOrz 镜像重建完成\033[0m" - -docker run -itd \ - --name ${docker_name} \ - --log-opt max-size=1m \ - -v $(pwd):/var/app \ - ${docker_name}:"${time_now}" -echo -e "\033[5;36mOrz 镜像启动完成\033[0m" -docker ps -a -docker logs ${docker_name} -f \ No newline at end of file