Simplify Dockerfile WORKDIR (#14750)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-07-28 17:49:07 +02:00 committed by GitHub
parent f8454f1ab7
commit 01977dac41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 28 additions and 47 deletions

View file

@ -6,7 +6,6 @@
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime
# Set environment variables
ENV APP_HOME /usr/src/ultralytics
# Avoid DDP error "MKL_THREADING_LAYER=INTEL is incompatible with libgomp.so.1 library" https://github.com/pytorch/pytorch/issues/37377
ENV MKL_THREADING_LAYER=GNU
@ -26,12 +25,12 @@ RUN apt update \
RUN apt upgrade --no-install-recommends -y openssl tar
# Create working directory
WORKDIR $APP_HOME
WORKDIR /ultralytics
# Copy contents and assign permissions
COPY . $APP_HOME
COPY . .
RUN git remote set-url origin https://github.com/ultralytics/ultralytics.git
ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt $APP_HOME
ADD https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt .
# Install pip packages
RUN python3 -m pip install --upgrade pip wheel
@ -62,7 +61,7 @@ RUN rm -rf tmp
# t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus '"device=2,3"' $t
# Pull and Run with local directory access
# t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/shared/datasets:/usr/src/datasets $t
# t=ultralytics/ultralytics:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/shared/datasets:/datasets $t
# Kill all
# sudo docker kill $(sudo docker ps -q)