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.0 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
  1. # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/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 and conda packages
  16. RUN apt-get update && \
  17. apt-get install -y --no-install-recommends libgl1 && \
  18. # Install conda packages
  19. # mkl required to fix 'OSError: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory'
  20. conda config --set solver libmamba && \
  21. conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia && \
  22. conda install -c conda-forge ultralytics mkl && \
  23. # Remove extra build files
  24. rm -rf /var/lib/apt/lists/* /root/.config/Ultralytics/persistent_cache.json
  25. # Copy model
  26. ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt .
  27. # Usage Examples -------------------------------------------------------------------------------------------------------
  28. # Build and Push
  29. # t=ultralytics/ultralytics:latest-conda && sudo docker build -f docker/Dockerfile-conda -t $t . && sudo docker push $t
  30. # Run
  31. # t=ultralytics/ultralytics:latest-conda && sudo docker run -it --ipc=host $t
  32. # Pull and Run
  33. # t=ultralytics/ultralytics:latest-conda && sudo docker pull $t && sudo docker run -it --ipc=host $t
  34. # Pull and Run with local volume mounted
  35. # 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...