I previously created a jupyterlab environment using an existing docker image.
technoxs-stacker.hatenablog.com
I thought I might run pytrorch on jupyterlab in the future, so I created an image with jupyterlab installed based on the previous docker image.
contents
- contents
- abstract
- 1.requirement
- 2.Creating a Dockerfile
- 3.Creation of image
- 4.docker container startup
- 5.Starting jupyterlab
- 6.reference
スポンサーリンク
abstract
how to building a jupyterlab environment that we can use pytorch in using Jetson Xavier NX and docker.
1.requirement
Jetson Xavier NX
ubuntu18.04
docker
python3.x
2.Creating a Dockerfile
FROM nvcr.io/nvidia/l4t-ml:r32.5.0-py3 RUN apt-get update && apt-get upgrade -y && apt-get clean RUN apt-get -y install vim RUN pip3 install --upgrade pip RUN pip3 install --ignore-installed PyYAML RUN pip3 install jupyterlab ARG USERNAME=user ARG GROUPNAME=user ARG UID=1000 ARG GID=1000 ARG PASSWORD=xxxxxxxx RUN groupadd -g $GID $GROUPNAME && \ useradd -m -s /bin/bash -u $UID -g $GID -G sudo $USERNAME && \ echo $USERNAME:$PASSWORD | chpasswd && \ echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers USER $USERNAME
3.Creation of image
Create an image with the following command.
sudo docker build . -t xxxx
4.docker container startup
sudo docker run -v path/to/mount/:/mount/name/ -it --rm -p port:port --gpus all --name image_name xxxx
some of the options used in this project are described
->Please refer to docker's official website for more information.
-v : Specify the directory you want to mount -p : Specify the port connecting the container to the machine --name : Specify the name of the container xxxx : Specify the created image
5.Starting jupyterlab
jupyter notebook --port [port number] --allow-root --ip 0.0.0.0
6.reference
スポンサーリンク