updated to non-docker-compose build and run

This commit is contained in:
Christoph Schranz 2020-07-14 17:11:06 +02:00
parent ffe73f572f
commit 708643b60c
2 changed files with 20 additions and 7 deletions

View File

@ -5,6 +5,7 @@
FROM nvidia/cuda:10.1-base-ubuntu18.04 FROM nvidia/cuda:10.1-base-ubuntu18.04
LABEL maintainer="Christoph Schranz <christoph.schranz@salzburgresearch.at>" LABEL maintainer="Christoph Schranz <christoph.schranz@salzburgresearch.at>"
# This is a concatenated Dockerfile, the maintainers of subsequent sections may vary. # This is a concatenated Dockerfile, the maintainers of subsequent sections may vary.
RUN chmod 1777 /tmp && chmod 1777 /var/tmp
############################################################################ ############################################################################
#################### Dependency: jupyter/base-image ######################## #################### Dependency: jupyter/base-image ########################

View File

@ -29,7 +29,7 @@ The image of this repository is available on [Dockerhub](https://hub.docker.com/
The CUDA toolkit is not required on the host system, as it will be deployed The CUDA toolkit is not required on the host system, as it will be deployed
in [NVIDIA-docker](https://github.com/NVIDIA/nvidia-docker). in [NVIDIA-docker](https://github.com/NVIDIA/nvidia-docker).
You can be sure that you can access your GPU within Docker, You can be sure that you can access your GPU within Docker,
if the command `docker run --runtime nvidia nvidia/cuda:10.1-base-ubuntu18.04 nvidia-smi` if the command `docker run --gpus all nvidia/cuda:10.1-base-ubuntu18.04 nvidia-smi`
returns a result similar to this one: returns a result similar to this one:
```bash ```bash
Mon Jun 22 09:06:28 2020 Mon Jun 22 09:06:28 2020
@ -58,19 +58,31 @@ The image of this repository is available on [Dockerhub](https://hub.docker.com/
## Quickstart ## Quickstart
First of all, it is necessary to generate the `Dockerfile` based on the First of all, it is necessary to generate the `Dockerfile` based on the NIVIDA base image and the
[docker-stacks](https://github.com/jupyter/docker-stacks). [docker-stacks](https://github.com/jupyter/docker-stacks).
As soon as you have access to your GPU within Docker containers As soon as you have access to your GPU within Docker containers
(make sure the command `docker run --runtime nvidia nvidia/cuda:10.1-base-ubuntu18.04 nvidia-smi` shows your (make sure the command `docker run --gpus all nvidia/cuda:10.1-base-ubuntu18.04 nvidia-smi` shows your
GPU statistics), you can generate a Dockerfile and build it via docker-compose. GPU statistics), you can generate a Dockerfile, build and run it.
The two commands will start *GPU-Jupyter* on [localhost:8848](http://localhost:8848) with the default The following commands will start *GPU-Jupyter* on [localhost:8848](http://localhost:8848) with the default
password `asdf`. password `asdf`.
```bash ```bash
./generate-Dockerfile.sh ./generate_Dockerfile.sh
./start-local.sh -p 8848 # where -p stands for the port, default 8888 docker build -t gpu-jupyter .build/ # will take a while
docker run -d -p [port]:8888 gpu-jupyter # starts gpu-jupyter WITHOUT GPU support
``` ```
To run the container with GPU support, a local data volume and , run:
```bash
docker run -d -it --rm --gpus all -p [JUPYTER_PORT]:8888 -v ./data:/home/jovyan/work -e GRANT_SUDO="yes" -e JUPYTER_ENABLE_LAB="yes" gpu-jupyter
```
Or on windows:
```bash
docker run -d -it --rm --gpus all -p [JUPYTER_PORT]:8888 -v /${PWD}/data:/home/jovyan/work -e GRANT_SUDO="yes" -e JUPYTER_ENABLE_LAB="yes" gpu-jupyter
```
## Parameter ## Parameter
The script `generate-Dockerfile.sh` has multiple parameters: The script `generate-Dockerfile.sh` has multiple parameters: