Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM nvcr.io/nvidia/cuda:10.2-cudnn8-devel-ubuntu18.04
  2. LABEL maintainer="Learning@home"
  3. LABEL repository="hivemind"
  4. WORKDIR /home
  5. # Set en_US.UTF-8 locale by default
  6. RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment
  7. # Install packages
  8. RUN apt-get update && apt-get install -y --no-install-recommends --force-yes \
  9. build-essential \
  10. wget \
  11. git \
  12. vim \
  13. && apt-get clean autoclean && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
  14. RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O install_miniconda.sh && \
  15. bash install_miniconda.sh -b -p /opt/conda && rm install_miniconda.sh
  16. ENV PATH="/opt/conda/bin:${PATH}"
  17. RUN conda install python~=3.8 pip && \
  18. pip install --no-cache-dir torch torchvision torchaudio && \
  19. conda clean --all
  20. COPY requirements.txt hivemind/requirements.txt
  21. COPY requirements-dev.txt hivemind/requirements-dev.txt
  22. COPY examples/albert/requirements.txt hivemind/examples/albert/requirements.txt
  23. RUN pip install --no-cache-dir -r hivemind/requirements.txt && \
  24. pip install --no-cache-dir -r hivemind/requirements-dev.txt && \
  25. pip install --no-cache-dir -r hivemind/examples/albert/requirements.txt && \
  26. rm -rf ~/.cache/pip
  27. COPY . hivemind/
  28. RUN cd hivemind && \
  29. pip install --no-cache-dir .[dev] && \
  30. conda clean --all && rm -rf ~/.cache/pip
  31. CMD bash