From 15c8a22f704056dbb7f03829d964a85289b9aa2e Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 20 Nov 2024 21:00:57 +0100 Subject: [PATCH] Update Dockerfile-cpu to `ubuntu:latest` (#17670) Signed-off-by: UltralyticsAssistant Co-authored-by: Francesco Mattioli Co-authored-by: UltralyticsAssistant --- docker/Dockerfile | 1 - docker/Dockerfile-cpu | 12 ++++++------ docker/Dockerfile-runner | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 931326f891..a25fbdcce5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -56,7 +56,6 @@ RUN pip install numpy==1.23.5 # Remove extra build files RUN rm -rf tmp /root/.config/Ultralytics/persistent_cache.json - # Usage Examples ------------------------------------------------------------------------------------------------------- # Build and Push diff --git a/docker/Dockerfile-cpu b/docker/Dockerfile-cpu index fe8d88521f..ee7dfff1c0 100644 --- a/docker/Dockerfile-cpu +++ b/docker/Dockerfile-cpu @@ -2,8 +2,8 @@ # Builds ultralytics/ultralytics:latest-cpu image on DockerHub https://hub.docker.com/r/ultralytics/ultralytics # Image is CPU-optimized for ONNX, OpenVINO and PyTorch YOLO11 deployments -# Start FROM Ubuntu image https://hub.docker.com/_/ubuntu -FROM ubuntu:23.10 +# Use official Python base image for reproducibility (3.11.10 for export and 3.12.6 for inference) +FROM python:3.11.10-slim-bookworm # Set environment variables ENV PYTHONUNBUFFERED=1 \ @@ -39,14 +39,14 @@ RUN pip install -e ".[export]" --extra-index-url https://download.pytorch.org/wh RUN yolo export model=tmp/yolo11n.pt format=edgetpu imgsz=32 RUN yolo export model=tmp/yolo11n.pt format=ncnn imgsz=32 # Requires Python<=3.10, bug with paddlepaddle==2.5.0 https://github.com/PaddlePaddle/X2Paddle/issues/991 -# RUN pip install "paddlepaddle>=2.6.0" x2paddle - -# Creates a symbolic link to make 'python' point to 'python3' -RUN ln -sf /usr/bin/python3 /usr/bin/python +RUN pip install "paddlepaddle>=2.6.0" x2paddle # Remove extra build files RUN rm -rf tmp /root/.config/Ultralytics/persistent_cache.json +# Set default command to bash +CMD ["/bin/bash"] + # Usage Examples ------------------------------------------------------------------------------------------------------- # Build and Push diff --git a/docker/Dockerfile-runner b/docker/Dockerfile-runner index 539f0aa03e..514ca53f42 100644 --- a/docker/Dockerfile-runner +++ b/docker/Dockerfile-runner @@ -35,7 +35,6 @@ ENTRYPOINT sh -c './config.sh --url https://github.com/ultralytics/ultralytics \ --replace && \ ./run.sh' - # Usage Examples ------------------------------------------------------------------------------------------------------- # Build and Push