2025-03-23 21:15:19 +00:00
|
|
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
|
|
|
|
2023-08-27 19:05:14 +00:00
|
|
|
# Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
|
2025-08-12 18:01:07 +00:00
|
|
|
# Image is CUDA-optimized for YOLO single/multi-GPU training and inference tests
|
2023-08-27 19:05:14 +00:00
|
|
|
|
|
|
|
|
# Start FROM Ultralytics GPU image
|
|
|
|
|
FROM ultralytics/ultralytics:latest
|
|
|
|
|
|
2025-08-12 12:57:13 +00:00
|
|
|
# Set additional environment variables for runner
|
2025-11-18 00:14:46 +00:00
|
|
|
ARG RUNNER_VERSION=2.329.0
|
2025-08-13 11:33:09 +00:00
|
|
|
ENV RUNNER_ALLOW_RUNASROOT=1 \
|
2024-08-06 16:21:48 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
2023-08-27 19:05:14 +00:00
|
|
|
# Set the working directory
|
|
|
|
|
WORKDIR /actions-runner
|
|
|
|
|
|
2025-08-12 10:00:55 +00:00
|
|
|
# Download and unpack the latest runner from https://github.com/actions/runner and install dependencies
|
2025-09-11 11:40:04 +00:00
|
|
|
RUN FILENAME=actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \
|
|
|
|
|
curl -o "$FILENAME" -L "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/${FILENAME}" && \
|
|
|
|
|
tar xzf "$FILENAME" && \
|
|
|
|
|
rm "$FILENAME" && \
|
|
|
|
|
# Install runner dependencies \
|
2025-08-12 10:00:55 +00:00
|
|
|
uv pip install --system pytest-cov && \
|
|
|
|
|
./bin/installdependencies.sh && \
|
2023-08-27 19:05:14 +00:00
|
|
|
apt-get -y install libicu-dev
|
|
|
|
|
|
2025-08-12 12:57:13 +00:00
|
|
|
# JSON ENTRYPOINT command to configure and start runner with default TOKEN and NAME
|
|
|
|
|
ENTRYPOINT ["sh", "-c", "./config.sh --url https://github.com/ultralytics/ultralytics --token ${GITHUB_RUNNER_TOKEN:-TOKEN} --name ${GITHUB_RUNNER_NAME:-NAME} --labels gpu-latest --replace && ./run.sh"]
|
2023-08-27 19:05:14 +00:00
|
|
|
|
|
|
|
|
# Usage Examples -------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# Build and Push
|
|
|
|
|
# t=ultralytics/ultralytics:latest-runner && sudo docker build -f docker/Dockerfile-runner -t $t . && sudo docker push $t
|
|
|
|
|
|
|
|
|
|
# Pull and Run in detached mode with access to GPUs 0 and 1
|
|
|
|
|
# t=ultralytics/ultralytics:latest-runner && sudo docker run -d -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host --gpus '"device=0,1"' $t
|