Skip to content

Instantly share code, notes, and snippets.

@lobrien
Created November 23, 2023 21:16
Show Gist options
  • Save lobrien/ad9bf8bf3fabda844b88523550f54985 to your computer and use it in GitHub Desktop.
Save lobrien/ad9bf8bf3fabda844b88523550f54985 to your computer and use it in GitHub Desktop.
Dockerfile for FIRST Robotics with PyTorch, robotpy and Jupyter Server
#FROM bitnami/pytorch:latest
# Use Ubuntu as base image because Debian doesn't have g++-11, required by robotpy
FROM anibali/pytorch:2.0.1-cuda11.8
USER root
# Update the system and install basic dev packages
RUN apt-get update && apt-get install -y binutils gcc g++ make git wget libicu-dev gradle && \
apt install -y openjdk-11-jdk vim software-properties-common gnupg
# Install additional Python packages
RUN pip install --upgrade pip && pip install jupyter jupyterlab jupytext matplotlib numpy pandas scipy scikit-learn seaborn sympy
#FRC
RUN apt update && apt install -y build-essential g++-11
RUN pip install robotpy
# Disable auth and allow root in Jupyter (DANGEROUS! Only do this for local development!)
RUN mkdir //.jupyter && cd //.jupyter && jupyter lab --generate-config && \
echo "c.PasswordIdentityProvider.hashed_password = " >> jupyter_lab_config.py && \
echo "c.NotebookApp.allow_root = True" >> jupyter_lab_config.py && \
echo "c.NotebookApp.token = '' " >> jupyter_lab_config.py && \
echo "c.PasswordIdentityProvider.password_required= False" >> jupyter_lab_config.py
# Run Jupyter at 8888. Start image with, e.g., -p 8888:8888
EXPOSE 8888
#ENTRYPOINT [ "/bin/bash" ]
# Set listen IP to 0.0.0.0 so that outside Web browsers can connect
ENTRYPOINT ["jupyter", "lab", "--allow-root", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--NotebookApp.token=''"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment