ultralytics/docker/Dockerfile-runner
2026-01-02 03:29:19 +01:00

39 lines
2 KiB
Text

# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# Builds GitHub actions CI runner image for deployment to DockerHub https://hub.docker.com/r/ultralytics/ultralytics
# Image is CUDA-optimized for YOLO single/multi-GPU training and inference tests
# Start FROM Ultralytics GPU image
FROM ultralytics/ultralytics:latest
# Set additional environment variables for runner
ARG RUNNER_VERSION=2.329.0
ENV RUNNER_ALLOW_RUNASROOT=1 \
DEBIAN_FRONTEND=noninteractive
# Set the working directory
WORKDIR /actions-runner
# Download and unpack the runner from https://github.com/actions/runner and install dependencies
RUN FILENAME=actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz && \
curl -fLso "$FILENAME" "https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/${FILENAME}" && \
tar xzf "$FILENAME" && \
rm "$FILENAME" && \
# Install runner dependencies \
uv pip install --system pytest-cov && \
./bin/installdependencies.sh && \
apt-get update && \
apt-get install -y --no-install-recommends libicu-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 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"]
# Usage --------------------------------------------------------------------------------------------------------------
# Production builds: https://github.com/ultralytics/ultralytics/blob/main/.github/workflows/docker.yml
# Example (build): t=ultralytics/ultralytics:latest-runner && docker build -f docker/Dockerfile-runner -t $t .
# Example (push): docker push $t
# Example (pull): t=ultralytics/ultralytics:latest-runner && docker pull $t
# Example (run): docker run -d --restart unless-stopped -e GITHUB_RUNNER_TOKEN=TOKEN -e GITHUB_RUNNER_NAME=NAME --ipc=host --runtime=nvidia --gpus all $t