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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. # install modelscope and its python env
  32. WORKDIR /opt/modelscope
  33. COPY . .
  34. RUN pip install -r requirements.txt
  35. # RUN --mount=type=cache,target=/opt/ccache \
  36. # python setup.py install
  37. # opencv-python-headless conflict with opencv-python installed
  38. RUN python setup.py install \
  39. && pip uninstall -y opencv-python-headless
  40. # prepare modelscope libs
  41. COPY docker/scripts/install_libs.sh /tmp/
  42. RUN bash /tmp/install_libs.sh && \
  43. rm -rf /tmp/install_libs.sh
  44. ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/modelscope/lib64
  45. WORKDIR /workspace