Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile-conda 2.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  1. # Ultralytics YOLO 🚀, AGPL-3.0 license
  2. # Builds ultralytics/ultralytics:latest-conda image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics
  3. # Image is optimized for Ultralytics Anaconda (https://anaconda.org/conda-forge/ultralytics) installation and usage
  4. # Start FROM miniconda3 image https://hub.docker.com/r/continuumio/miniconda3
  5. FROM continuumio/miniconda3:latest
  6. # Set environment variables
  7. ENV PYTHONUNBUFFERED=1 \
  8. PYTHONDONTWRITEBYTECODE=1 \
  9. PIP_NO_CACHE_DIR=1 \
  10. PIP_BREAK_SYSTEM_PACKAGES=1
  11. # Downloads to user config dir
  12. ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \
  13. https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \
  14. /root/.config/Ultralytics/
  15. # Install linux packages
  16. RUN apt-get update && \
  17. apt-get install -y --no-install-recommends \
  18. libgl1 \
  19. && rm -rf /var/lib/apt/lists/*
  20. # Copy contents
  21. ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
  22. # Install conda packages
  23. # mkl required to fix 'OSError: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory'
  24. RUN conda config --set solver libmamba && \
  25. conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia && \
  26. conda install -c conda-forge ultralytics mkl
  27. # conda install -c pytorch -c nvidia -c conda-forge pytorch torchvision pytorch-cuda=12.1 ultralytics mkl
  28. # Remove extra build files
  29. RUN rm -rf /root/.config/Ultralytics/persistent_cache.json
  30. # Usage Examples -------------------------------------------------------------------------------------------------------
  31. # Build and Push
  32. # t=ultralytics/ultralytics:latest-conda && sudo docker build -f docker/Dockerfile-cpu -t $t . && sudo docker push $t
  33. # Run
  34. # t=ultralytics/ultralytics:latest-conda && sudo docker run -it --ipc=host $t
  35. # Pull and Run
  36. # t=ultralytics/ultralytics:latest-conda && sudo docker pull $t && sudo docker run -it --ipc=host $t
  37. # Pull and Run with local volume mounted
  38. # t=ultralytics/ultralytics:latest-conda && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/shared/datasets:/datasets $t
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...