This commit is contained in:
tastelikefeet
2026-03-09 13:58:47 +08:00
parent b5b13476cc
commit 1c8f467439
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
FROM {base_image}
RUN cd modelscope && pip install . -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
RUN cd /tmp && GIT_LFS_SKIP_SMUDGE=1 git clone -b {modelscope_branch} --single-branch https://github.com/modelscope/modelscope.git && \
cd modelscope && pip install . -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && \
cd / && rm -fr /tmp/modelscope && pip cache purge;
SHELL ["/bin/bash", "-c"]

View File

@@ -128,6 +128,8 @@ class OldCPUImageBuilder(Builder):
'modelscope-registry.us-west-1.cr.aliyuncs.com/modelscope-repo/modelscope:'
'ubuntu22.04-py311-torch2.3.1-1.33.0-test')
content = content.replace('{base_image}', old_cpu_image)
content = content.replace('{modelscope_branch}',
self.args.modelscope_branch)
return content
def image(self) -> str:
@@ -183,6 +185,8 @@ class OldGPUImageBuilder(Builder):
with open('docker/Dockerfile.ubuntu.old', 'r') as f:
content = f.read()
content = content.replace('{base_image}', old_gpu_image)
content = content.replace('{modelscope_branch}',
self.args.modelscope_branch)
return content
def image(self) -> str: