From efb0c17881eb613e1fe403eb3a629fe19b9b70ae Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 29 Sep 2024 13:28:36 +0200 Subject: [PATCH] Use `apt-get` in Dockerfiles (#16535) Signed-off-by: UltralyticsAssistant Co-authored-by: UltralyticsAssistant --- docker/Dockerfile | 6 ++++-- docker/Dockerfile-arm64 | 6 ++++-- docker/Dockerfile-conda | 6 ++++-- docker/Dockerfile-cpu | 6 ++++-- docker/Dockerfile-jetson-jetpack4 | 6 ++++-- docker/Dockerfile-jetson-jetpack5 | 6 ++++-- docker/Dockerfile-jetson-jetpack6 | 6 ++++-- docker/Dockerfile-python | 6 ++++-- 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index aa34bf338f7..20184ebff08 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,8 +21,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ # Install linux packages # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package # libsm6 required by libqxcb to create QT-based windows for visualization; set 'QT_DEBUG_PLUGINS=1' to test in docker -RUN apt update \ - && apt install --no-install-recommends -y gcc git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 libsm6 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + gcc git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 libsm6 \ + && rm -rf /var/lib/apt/lists/* # Security updates # https://security.snyk.io/vuln/SNYK-UBUNTU1804-OPENSSL-3314796 diff --git a/docker/Dockerfile-arm64 b/docker/Dockerfile-arm64 index 786061e773b..81faee90982 100644 --- a/docker/Dockerfile-arm64 +++ b/docker/Dockerfile-arm64 @@ -20,8 +20,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ # Install linux packages # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package # pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow' -RUN apt update \ - && apt install --no-install-recommends -y python3-pip git zip unzip wget curl htop gcc libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + python3-pip git zip unzip wget curl htop gcc libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 \ + && rm -rf /var/lib/apt/lists/* # Create working directory WORKDIR /ultralytics diff --git a/docker/Dockerfile-conda b/docker/Dockerfile-conda index 343b8001e7e..fe7b91c77e5 100644 --- a/docker/Dockerfile-conda +++ b/docker/Dockerfile-conda @@ -17,8 +17,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ /root/.config/Ultralytics/ # Install linux packages -RUN apt update \ - && apt install --no-install-recommends -y libgl1 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + libgl1 \ + && rm -rf /var/lib/apt/lists/* # Copy contents ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt . diff --git a/docker/Dockerfile-cpu b/docker/Dockerfile-cpu index f6b691c5faa..bf0815d4aca 100644 --- a/docker/Dockerfile-cpu +++ b/docker/Dockerfile-cpu @@ -18,8 +18,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ # Install linux packages # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package -RUN apt update \ - && apt install --no-install-recommends -y python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 \ + && rm -rf /var/lib/apt/lists/* # Create working directory WORKDIR /ultralytics diff --git a/docker/Dockerfile-jetson-jetpack4 b/docker/Dockerfile-jetson-jetpack4 index 4ea29852e6c..c4b968a74df 100644 --- a/docker/Dockerfile-jetson-jetpack4 +++ b/docker/Dockerfile-jetson-jetpack4 @@ -20,8 +20,10 @@ RUN wget -q -O - https://repo.download.nvidia.com/jetson/jetson-ota-public.asc | echo "deb https://repo.download.nvidia.com/jetson/t194 r32.7 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list # Install dependencies -RUN apt update && \ - apt install --no-install-recommends -y git python3.8 python3.8-dev python3-pip python3-libnvinfer libopenmpi-dev libopenblas-base libomp-dev gcc +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + git python3.8 python3.8-dev python3-pip python3-libnvinfer libopenmpi-dev libopenblas-base libomp-dev gcc \ + && rm -rf /var/lib/apt/lists/* # Create symbolic links for python3.8 and pip3 RUN ln -sf /usr/bin/python3.8 /usr/bin/python3 diff --git a/docker/Dockerfile-jetson-jetpack5 b/docker/Dockerfile-jetson-jetpack5 index afd1f002937..35796372c21 100644 --- a/docker/Dockerfile-jetson-jetpack5 +++ b/docker/Dockerfile-jetson-jetpack5 @@ -20,8 +20,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ # g++ required to build 'tflite_support' and 'lap' packages # libusb-1.0-0 required for 'tflite_support' package when exporting to TFLite # pkg-config and libhdf5-dev (not included) are needed to build 'h5py==3.11.0' aarch64 wheel required by 'tensorflow' -RUN apt update \ - && apt install --no-install-recommends -y gcc git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + gcc git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 \ + && rm -rf /var/lib/apt/lists/* # Create working directory WORKDIR /ultralytics diff --git a/docker/Dockerfile-jetson-jetpack6 b/docker/Dockerfile-jetson-jetpack6 index ccc87276561..3f465edaf6a 100644 --- a/docker/Dockerfile-jetson-jetpack6 +++ b/docker/Dockerfile-jetson-jetpack6 @@ -17,8 +17,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ /root/.config/Ultralytics/ # Install dependencies -RUN apt update && \ - apt install --no-install-recommends -y git python3-pip libopenmpi-dev libopenblas-base libomp-dev +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + git python3-pip libopenmpi-dev libopenblas-base libomp-dev \ + && rm -rf /var/lib/apt/lists/* # Create working directory WORKDIR /ultralytics diff --git a/docker/Dockerfile-python b/docker/Dockerfile-python index 56348dbb4cd..f89839dd4b3 100644 --- a/docker/Dockerfile-python +++ b/docker/Dockerfile-python @@ -18,8 +18,10 @@ ADD https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf \ # Install linux packages # g++ required to build 'tflite_support' and 'lap' packages, libusb-1.0-0 required for 'tflite_support' package -RUN apt update \ - && apt install --no-install-recommends -y python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + python3-pip git zip unzip wget curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0 \ + && rm -rf /var/lib/apt/lists/* # Create working directory WORKDIR /ultralytics