Dockerfile
- I installed jupyter notebook so I can experiment with it remotely.
1
2
3
4
# -U is to upgrade to the latest version
RUN python3 -m pip install -U jupyter notebook
# jupyter notebook port
EXPOSE 8888
Docker Runtime Args
--runtime=nvidia: enable Nvidia Container Runtime, a “runtime” that connects Nvidia GPU with docker. If your laptop doesn’t have an Nvidia GPU, simply remove this arg.-p 8888to expose the Jupyter Notebook Portjupyter notebook --ip=0.0.0.0 --no-browser --allow-rootfollows the image name. This is the command to run. without-d, docker will run this process in the foreground, which will terminates the container uponSIGINT(ctrl-C)- Make sure
/dev/shmis shared properly- On the same machine, ROS2 uses the directory for messaging
- But this wouldn’t work
-d /dev/shm:/dev/shm - use
-vinstead
Push To Docker Hub
1
2
3
docker login #put in docker creds
docker tag <MY_IMAGE>:latest <MY_USERNAME>/<MY_IMAGE>:latest
docker push <MY_USERNAME>/<MY_IMAGE>:latest
- Docker Hub requires images to be pushed to the repo that corresponds to our Docker Hub username. So, we need to tag the image with the proper username.