️ perf: reduce docker image size

This commit is contained in:
SigureMo 2022-01-28 15:05:56 +08:00
parent bbb349ae9a
commit 6f49b23515
No known key found for this signature in database
GPG Key ID: F99A3CD7BD76B247
2 changed files with 8 additions and 8 deletions

View File

@ -5,11 +5,11 @@ LABEL maintainer="siguremo" \
RUN set -x \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& apk add -q --progress --update --no-cache --virtual .build-deps gcc g++ build-base \
&& apk add -q --progress --update --no-cache ffmpeg python3 python3-dev py-pip linux-headers libffi-dev openssl-dev \
&& python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& python3 -m pip install --no-cache-dir --pre yutto[uvloop] \
&& apk del .build-deps
&& apk add -q --progress --update --no-cache --virtual .build-deps gcc g++ build-base python3-dev libffi-dev \
&& apk add -q --progress --update --no-cache ffmpeg python3 py-pip tzdata \
&& python3 -m pip install --no-cache-dir --pre yutto[uvloop] -i https://pypi.tuna.tsinghua.edu.cn/simple \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apk del --purge .build-deps
WORKDIR /app

View File

@ -1,5 +1,5 @@
VERSION := `poetry run python -c "import sys; from yutto.__version__ import VERSION as yutto_version; sys.stdout.write(yutto_version)"`
DOCKER_NAME := "siguremo/yutto:latest"
DOCKER_NAME := "siguremo/yutto"
run:
poetry run python -m yutto
@ -47,7 +47,7 @@ clean-builds:
rm -rf yutto.egg-info/
build-docker:
docker build -t {{DOCKER_NAME}} .
docker build -t "{{DOCKER_NAME}}:{{VERSION}}" -t "{{DOCKER_NAME}}:latest" .
publish-docker:
docker buildx build --platform=linux/amd64,linux/arm64 -t {{DOCKER_NAME}} . --push
docker buildx build --platform=linux/amd64,linux/arm64 -t "{{DOCKER_NAME}}:{{VERSION}}" -t "{{DOCKER_NAME}}:latest" . --push