You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

pytorch.dockerfile 1.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # syntax = docker/dockerfile:experimental
  2. #
  3. # NOTE: To build this you will need a docker version > 18.06 with
  4. # experimental enabled and DOCKER_BUILDKIT=1
  5. #
  6. # If you do not use buildkit you are not going to have a good time
  7. #
  8. # For reference:
  9. # https://docs.docker.com/develop/develop-images/build_enhancements/
  10. # ARG BASE_IMAGE=reg.docker.alibaba-inc.com/pai-dlc/pytorch-training:1.10PAI-gpu-py36-cu113-ubuntu18.04
  11. # FROM ${BASE_IMAGE} as dev-base
  12. # FROM reg.docker.alibaba-inc.com/pai-dlc/pytorch-training:1.10PAI-gpu-py36-cu113-ubuntu18.04 as dev-base
  13. FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-devel
  14. # FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
  15. # config pip source
  16. RUN mkdir /root/.pip
  17. COPY docker/rcfiles/pip.conf.tsinghua /root/.pip/pip.conf
  18. COPY docker/rcfiles/sources.list.aliyun /etc/apt/sources.list
  19. # Install essential Ubuntu packages
  20. RUN apt-get update &&\
  21. apt-get install -y software-properties-common \
  22. build-essential \
  23. git \
  24. wget \
  25. vim \
  26. curl \
  27. zip \
  28. zlib1g-dev \
  29. unzip \
  30. pkg-config \
  31. libsndfile1
  32. # install modelscope and its python env
  33. WORKDIR /opt/modelscope
  34. COPY . .
  35. RUN pip install -r requirements.txt
  36. # RUN --mount=type=cache,target=/opt/ccache \
  37. # python setup.py install
  38. # opencv-python-headless conflict with opencv-python installed
  39. RUN python setup.py install \
  40. && pip uninstall -y opencv-python-headless
  41. # prepare modelscope libs
  42. COPY docker/scripts/install_libs.sh /tmp/
  43. RUN bash /tmp/install_libs.sh && \
  44. rm -rf /tmp/install_libs.sh
  45. ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/modelscope/lib64
  46. WORKDIR /workspace