mirror of
https://github.com/NVIDIA/dgx-spark-playbooks.git
synced 2026-04-25 03:13:53 +00:00
27 lines
563 B
Docker
27 lines
563 B
Docker
FROM ubuntu:22.04
|
|
|
|
# Install required packages
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
docker.io \
|
|
bc \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy the monitoring script
|
|
COPY gpu_memory_monitor.sh /usr/local/bin/
|
|
RUN chmod +x /usr/local/bin/gpu_memory_monitor.sh
|
|
|
|
# Create a non-root user
|
|
RUN useradd -m -s /bin/bash monitor
|
|
|
|
# Set environment variables with defaults
|
|
ENV CHECK_INTERVAL=60
|
|
ENV MIN_AVAILABLE_PERCENT=70
|
|
ENV AUTO_FIX=true
|
|
|
|
# Run as non-root user
|
|
USER monitor
|
|
WORKDIR /home/monitor
|
|
|
|
CMD ["/usr/local/bin/gpu_memory_monitor.sh"]
|