From b0b039ad2154d9867ae77bd484367fc6a8d1d2c7 Mon Sep 17 00:00:00 2001 From: Kenn Zhang Date: Sat, 17 Feb 2024 09:57:18 +0000 Subject: [PATCH] =?UTF-8?q?Docker=E9=95=9C=E5=83=8F=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=AF=B9=E4=BA=8E=E9=95=9C=E5=83=8F=E7=9A=84?= =?UTF-8?q?Tag=E5=A2=9E=E5=8A=A0Git=20Commit=E7=9A=84Hash=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E4=BE=BF=E4=BA=8E=E7=9F=A5=E9=81=93=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E4=B8=AD=E5=BA=94=E7=94=A8=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 4 +++- dockerbuild.sh | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index dc39f76..4eca27b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,4 +3,6 @@ logs output reference SoVITS_weights -.git \ No newline at end of file +GPT_weights +TEMP +.git diff --git a/dockerbuild.sh b/dockerbuild.sh index 1b3dcee..3a4a1e1 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -2,13 +2,20 @@ # 获取当前日期,格式为 YYYYMMDD DATE=$(date +%Y%m%d) +# 获取最新的 Git commit 哈希值的前 7 位 +COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-7) # 构建 full 版本的镜像 docker build --build-arg IMAGE_TYPE=full -t breakstring/gpt-sovits:latest . # 为同一个镜像添加带日期的标签 docker tag breakstring/gpt-sovits:latest breakstring/gpt-sovits:dev-$DATE +# 为同一个镜像添加带当前代码库Commit哈希值的标签 +docker tag breakstring/gpt-sovits:latest breakstring/gpt-sovits:dev-$COMMIT_HASH -# 构建 elite 版本的镜像 + +# 构建 elite 版本的镜像(无模型下载步骤,需手工将模型下载安装进容器) docker build --build-arg IMAGE_TYPE=elite -t breakstring/gpt-sovits:latest-elite . # 为同一个镜像添加带日期的标签 docker tag breakstring/gpt-sovits:latest-elite breakstring/gpt-sovits:dev-$DATE-elite +# 为同一个镜像添加带当前代码库Commit哈希值的标签 +docker tag breakstring/gpt-sovits:latest-elite breakstring/gpt-sovits:dev-$COMMIT_HASH-elite