Update Docker COPY permissions (#13200)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-05-29 11:41:31 +02:00 committed by GitHub
parent a07d6492eb
commit d80bd840d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 33 deletions

View file

@ -5,6 +5,9 @@
# Start FROM Ubuntu image https://hub.docker.com/_/ubuntu
FROM ubuntu:23.10
# Set environment variables
ENV APP_HOME /usr/src/ultralytics
# 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 \
@ -16,12 +19,13 @@ RUN apt update \
&& apt install --no-install-recommends -y python3-pip git zip curl htop libgl1 libglib2.0-0 libpython3-dev gnupg g++ libusb-1.0-0
# Create working directory
WORKDIR /usr/src/ultralytics
WORKDIR $APP_HOME
# Copy contents
# COPY . /usr/src/ultralytics # git permission issues inside container
RUN git clone https://github.com/ultralytics/ultralytics -b main /usr/src/ultralytics
ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt /usr/src/ultralytics/
# Copy contents (previously used git clone to avoid permission errors)
COPY . $APP_HOME
RUN chown -R root:root $APP_HOME
# RUN git clone https://github.com/ultralytics/ultralytics -b main $APP_HOME
ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME
# Remove python3.11/EXTERNALLY-MANAGED or use 'pip install --break-system-packages' avoid 'externally-managed-environment' Ubuntu nightly error
RUN rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED