|
| 1 | +# Copyright 2025 "Google LLC" |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# Using Debian 12.10 as the base image |
| 16 | +FROM debian:12.10 |
| 17 | + |
| 18 | +# Set the working directory in the container |
| 19 | +WORKDIR /app |
| 20 | + |
| 21 | +# Copy the local directory to the container |
| 22 | +COPY app/* /app/ |
| 23 | + |
| 24 | +ENV PATH $PATH:/var/lib/nvidia/bin:/var/lib/nvidia/lib64:/usr/local/nvidia/bin:/usr/local/nvidia/lib64/ |
| 25 | +ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/var/lib/nvidia/bin:/var/lib/nvidia/lib64:/usr/local/nvidia/bin:/usr/local/nvidia/lib64 |
| 26 | + |
| 27 | + |
| 28 | +# Install system dependencies |
| 29 | +RUN apt-get update && \ |
| 30 | + apt-get install -y util-linux pciutils \ |
| 31 | + build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev \ |
| 32 | + libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev \ |
| 33 | + acpica-tools kmod usbutils procps nano python3-pip python3.11-venv |
| 34 | + |
| 35 | +RUN wget https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tgz |
| 36 | + |
| 37 | +RUN tar -xvf Python-3.13.1.tgz |
| 38 | + |
| 39 | +RUN cd Python-3.13.1 && ./configure --enable-optimizations && \ |
| 40 | + make -j $(nproc) && make altinstall |
| 41 | + |
| 42 | + |
| 43 | +RUN ln -s /usr/local/bin/pip3.13 /usr/local/bin/pip3 && \ |
| 44 | + ln -s /usr/local/bin/python3.13 /usr/local/bin/python3 |
| 45 | + |
| 46 | +# Create and activate a virtual environment. |
| 47 | +RUN python3 -m venv .venv |
| 48 | + |
| 49 | +RUN . .venv/bin/activate |
| 50 | + |
| 51 | +# Install Python dependencies |
| 52 | +RUN .venv/bin/pip install --no-cache-dir -r requirements.txt |
| 53 | + |
| 54 | +ENTRYPOINT [".venv/bin/python", "gce-cos-nvidia-bug-report.py"] |
0 commit comments