mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-21 06:45:24 -06:00
fix(Dockerfile): migrate docker image repo to nvcr.io/nvidia/driver
Signed-off-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
This commit is contained in:
parent
c04fbb9bbc
commit
72646edd45
2 changed files with 15 additions and 7 deletions
20
Dockerfile
20
Dockerfile
|
|
@ -1,5 +1,5 @@
|
|||
ARG basetag="418.87.01-ubuntu18.04" # Ubuntu only
|
||||
FROM nvidia/driver:"${basetag}"
|
||||
ARG basetag="470-signed-ubuntu22.04" # Ubuntu only
|
||||
FROM nvcr.io/nvidia/driver:"${basetag}"
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
|
|
@ -11,19 +11,27 @@ RUN . /etc/os-release && [ "${NAME}" = "Ubuntu" ] && \
|
|||
|
||||
# Install Python 3
|
||||
RUN apt-get update && \
|
||||
apt-get install --quiet --yes --no-install-recommends \
|
||||
python3-dev python3-pip python3-setuptools python3-wheel locales && \
|
||||
apt-get install --quiet --yes --no-install-recommends python3-dev python3-venv locales && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Setup locale
|
||||
ENV LC_ALL=C.UTF-8
|
||||
RUN update-locale LC_ALL="C.UTF-8"
|
||||
|
||||
# Setup environment
|
||||
RUN python3 -m venv /venv && \
|
||||
. /venv/bin/activate && \
|
||||
python3 -m pip install --upgrade pip setuptools && \
|
||||
rm -rf /root/.cache && \
|
||||
echo && echo && echo "source /venv/bin/activate" >> /root/.bashrc
|
||||
ENV SHELL /bin/bash
|
||||
|
||||
# Install nvitop
|
||||
COPY . /nvitop
|
||||
WORKDIR /nvitop
|
||||
RUN pip3 install --compile . && \
|
||||
RUN . /venv/bin/activate && \
|
||||
python3 -m pip install . && \
|
||||
rm -rf /root/.cache
|
||||
|
||||
# Entrypoint
|
||||
ENTRYPOINT [ "python3", "-m", "nvitop" ]
|
||||
ENTRYPOINT [ "/venv/bin/python3", "-m", "nvitop" ]
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ docker build --tag nvitop:latest . # build the Docker image
|
|||
docker run -it --rm --runtime=nvidia --gpus=all --pid=host nvitop:latest # run the Docker container
|
||||
```
|
||||
|
||||
The [`Dockerfile`](Dockerfile) has a optional build argument `basetag` (default: `418.87.01-ubuntu18.04`) for the tag of image [`nvidia/driver`](https://hub.docker.com/r/nvidia/driver/tags).
|
||||
The [`Dockerfile`](Dockerfile) has a optional build argument `basetag` (default: `470-signed-ubuntu22.04`) for the tag of image [`nvcr.io/nvidia/driver`](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/driver/tags).
|
||||
|
||||
**NOTE:** Don't forget to add the `--pid=host` option when running the container.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue