mirror of
https://github.com/modelscope/modelscope.git
synced 2026-02-24 12:10:09 +01:00
35 lines
1.4 KiB
Docker
35 lines
1.4 KiB
Docker
FROM {base_image}
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
ENV TZ=Asia/Shanghai
|
|
ENV arch=x86_64
|
|
|
|
COPY docker/scripts/modelscope_env_init.sh /usr/local/bin/ms_env_init.sh
|
|
RUN apt-get update && \
|
|
apt-get install -y libsox-dev unzip libaio-dev zip iputils-ping telnet sudo git net-tools && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
{extra_content}
|
|
|
|
COPY {meta_file} /tmp/install.sh
|
|
|
|
RUN sh /tmp/install.sh {version_args}
|
|
|
|
RUN pip install --no-cache-dir https://modelscope.oss-cn-beijing.aliyuncs.com/packages/imageio_ffmpeg-0.4.9-py3-none-any.whl --force
|
|
|
|
RUN pip uninstall ms-swift modelscope -y
|
|
|
|
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 .[all] -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html && cd / && rm -fr /tmp/modelscope && pip cache purge;
|
|
|
|
RUN cd /tmp && GIT_LFS_SKIP_SMUDGE=1 git clone -b {swift_branch} --single-branch https://github.com/modelscope/ms-swift.git && cd ms-swift && pip install .[all] && cd / && rm -fr /tmp/ms-swift && pip cache purge;
|
|
|
|
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple && \
|
|
pip config set install.trusted-host mirrors.aliyun.com && \
|
|
cp /tmp/resources/ubuntu2204.aliyun /etc/apt/sources.list
|
|
|
|
ENV SETUPTOOLS_USE_DISTUTILS=stdlib
|
|
ENV VLLM_USE_MODELSCOPE=True
|
|
ENV LMDEPLOY_USE_MODELSCOPE=True
|
|
ENV MODELSCOPE_CACHE=/mnt/workspace/.cache/modelscope
|