diff --git a/docker/Dockerfile.ubuntu.old b/docker/Dockerfile.ubuntu.old index 36dde59a..6784702e 100644 --- a/docker/Dockerfile.ubuntu.old +++ b/docker/Dockerfile.ubuntu.old @@ -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"] diff --git a/docker/build_image.py b/docker/build_image.py index 7e8400e5..80ed93b3 100644 --- a/docker/build_image.py +++ b/docker/build_image.py @@ -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: