glenn-jocher commited on
Commit
5e077bf
·
unverified ·
1 Parent(s): 8a4175c

Add Dockerfile-M1 (#7720)

Browse files

* Add Dockerfile-M1

* Update

* Update

* Update Dockerfile-M1

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