chore: add optional build argument for Dockerfile

This commit is contained in:
XuehaiPan 2021-10-12 19:43:26 +08:00
parent d2dad65c89
commit 7e9ddd38bb
2 changed files with 4 additions and 1 deletions

View file

@ -1,4 +1,5 @@
FROM nvidia/driver:418.87.01-ubuntu18.04
ARG basetag="418.87.01-ubuntu18.04"
FROM nvidia/driver:"${basetag}"
ENV DEBIAN_FRONTEND=noninteractive

View file

@ -200,6 +200,8 @@ docker build --tag nvitop:latest . # build the Docker image
docker run -it --rm --runtime=nvidia --gpus=all --pid=host nvitop:latest -m # 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).
**NOTE:** Don't forget to add the `--pid=host` option when running the container.
#### For SSH Users