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

Dockerfile 1.7KB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Start FROM Nvidia PyTorch image https://ngc.nvidia.com/catalog/containers/nvidia:pytorch
  2. FROM nvcr.io/nvidia/pytorch:21.05-py3
  3. # Install linux packages
  4. RUN apt update && apt install -y zip htop screen libgl1-mesa-glx
  5. # Install python dependencies
  6. COPY requirements.txt .
  7. RUN python -m pip install --upgrade pip
  8. RUN pip uninstall -y nvidia-tensorboard nvidia-tensorboard-plugin-dlprof
  9. RUN pip install --no-cache -r requirements.txt coremltools onnx gsutil notebook
  10. RUN pip install --no-cache -U torch torchvision
  11. # Create working directory
  12. RUN mkdir -p /usr/src/app
  13. WORKDIR /usr/src/app
  14. # Copy contents
  15. COPY . /usr/src/app
  16. # Set environment variables
  17. ENV HOME=/usr/src/app
  18. # --------------------------------------------------- Extras Below ---------------------------------------------------
  19. # Build and Push
  20. # t=ultralytics/yolov5:latest && sudo docker build -t $t . && sudo docker push $t
  21. # for v in {300..303}; do t=ultralytics/coco:v$v && sudo docker build -t $t . && sudo docker push $t; done
  22. # Pull and Run
  23. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all $t
  24. # Pull and Run with local directory access
  25. # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/coco:/usr/src/coco $t
  26. # Kill all
  27. # sudo docker kill $(sudo docker ps -q)
  28. # Kill all image-based
  29. # sudo docker kill $(sudo docker ps -qa --filter ancestor=ultralytics/yolov5:latest)
  30. # Bash into running container
  31. # sudo docker exec -it 5a9b5863d93d bash
  32. # Bash into stopped container
  33. # id=$(sudo docker ps -qa) && sudo docker start $id && sudo docker exec -it $id bash
  34. # Clean up
  35. # docker system prune -a --volumes