Spaces:
Build error
Build error
| # Ultralytics ๐ AGPL-3.0 License - https://ultralytics.com/license | |
| # Builds ultralytics/ultralytics:latest-arm64 image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics | |
| # Image is aarch64-compatible for Apple M1, M2, M3, Raspberry Pi and other ARM architectures | |
| # Start FROM Ubuntu image https://hub.docker.com/_/ubuntu with "FROM arm64v8/ubuntu:22.04" (deprecated) | |
| # Start FROM Debian image for arm64v8 https://hub.docker.com/r/arm64v8/debian (deprecated) | |
| # Start FROM official arm64v8 Ubuntu 24.04 image https://hub.docker.com/layers/arm64v8/ubuntu/24.04/ | |
| FROM arm64v8/ubuntu:24.04 | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PIP_BREAK_SYSTEM_PACKAGES=1 | |
| # Downloads to user config dir | |
| ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ | |
| https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.Unicode.ttf \ | |
| /root/.config/Ultralytics/ | |
| # Install linux packages | |
| # pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow' | |
| # gnupg required for Edge TPU install | |
| RUN apt update && \ | |
| apt upgrade -y && \ | |
| apt install -y --no-install-recommends \ | |
| python3-pip git zip unzip wget curl htop gcc libgl1 libglib2.0-0 gnupg && \ | |
| apt clean && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Create working directory | |
| WORKDIR /ultralytics | |
| # Copy contents and configure git | |
| COPY . . | |
| RUN sed -i '/^\[http "https:\/\/github\.com\/"\]/,+1d' .git/config && \ | |
| sed -i'' -e 's/"opencv-python/"opencv-python-headless/' pyproject.toml | |
| ADD https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt . | |
| # Install pip packages, create python symlink, and remove build files | |
| RUN pip install uv && \ | |
| uv pip install --system -e ".[export]" --break-system-packages && \ | |
| # Creates a symbolic link to make 'python' point to 'python3' | |
| ln -sf /usr/bin/python3 /usr/bin/python && \ | |
| # Remove extra build files | |
| rm -rf /root/.config/Ultralytics/persistent_cache.json | |
| # Usage Examples ------------------------------------------------------------------------------------------------------- | |
| # Build and Push | |
| # t=ultralytics/ultralytics:latest-arm64 && sudo docker build --platform linux/arm64 -f docker/Dockerfile-arm64 -t $t . && sudo docker push $t | |
| # Run | |
| # t=ultralytics/ultralytics:latest-arm64 && sudo docker run -it --ipc=host $t | |
| # Pull and Run | |
| # t=ultralytics/ultralytics:latest-arm64 && sudo docker pull $t && sudo docker run -it --ipc=host $t | |
| # Pull and Run with local volume mounted | |
| # t=ultralytics/ultralytics:latest-arm64 && sudo docker pull $t && sudo docker run -it --ipc=host -v "$(pwd)"/shared/datasets:/datasets $t | |