Dockerfile-arm64 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
  2. # Builds ultralytics/yolov5:latest-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/yolov5
  3. # Image is aarch64-compatible for Apple M1 and other ARM architectures i.e. Jetson Nano and Raspberry Pi
  4. # Start FROM Ubuntu image https://hub.docker.com/_/ubuntu
  5. FROM arm64v8/ubuntu:20.04
  6. # Downloads to user config dir
  7. ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
  8. # Install linux packages
  9. RUN apt update
  10. RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y tzdata
  11. RUN apt install --no-install-recommends -y python3-pip git zip curl htop gcc \
  12. libgl1-mesa-glx libglib2.0-0 libpython3.8-dev
  13. # RUN alias python=python3
  14. # Install pip packages
  15. COPY requirements.txt .
  16. RUN python3 -m pip install --upgrade pip
  17. RUN pip install --no-cache -r requirements.txt gsutil notebook \
  18. tensorflow-aarch64
  19. # tensorflowjs \
  20. # onnx onnx-simplifier onnxruntime \
  21. # coremltools openvino-dev \
  22. # Create working directory
  23. RUN mkdir -p /usr/src/app
  24. WORKDIR /usr/src/app
  25. # Copy contents
  26. COPY . /usr/src/app
  27. RUN git clone https://github.com/ultralytics/yolov5 /usr/src/yolov5
  28. # Usage Examples -------------------------------------------------------------------------------------------------------
  29. # Build and Push
  30. # t=ultralytics/yolov5:latest-M1 && sudo docker build --platform linux/arm64 -f utils/docker/Dockerfile-arm64 -t $t . && sudo docker push $t
  31. # Pull and Run
  32. # t=ultralytics/yolov5:latest-M1 && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/datasets:/usr/src/datasets $t