Skip to content

Instantly share code, notes, and snippets.

@alvitawa
Created January 25, 2023 13:04
Show Gist options
  • Save alvitawa/0ed2a54619cd4323623cb58561c6310c to your computer and use it in GitHub Desktop.
Save alvitawa/0ed2a54619cd4323623cb58561c6310c to your computer and use it in GitHub Desktop.
# Dockerfile for tensorflow 2 with gpu
FROM dromni/nerfstudio:0.1.15
USER root
# Add local user binary folder to PATH variable.
ENV PATH="${PATH}:/root/.local/bin"
SHELL ["/bin/bash", "-c"]
# Upgrade pip and install packages.
RUN python3.10 -m pip install --upgrade pip setuptools pathtools promise
# Install pytorch and submodules.
RUN python3.10 -m pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116
# Install tynyCUDNN.
RUN python3.10 -m pip install git+https://github.com/NVlabs/tiny-cuda-nn.git#subdirectory=bindings/torch
# Install OpenJDK-8
RUN apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;
# Fix certificate issues
RUN apt-get update && \
apt-get install ca-certificates-java && \
apt-get clean && \
update-ca-certificates -f;
#RUN apt-get install snapd -y
#RUN snap install pycharm-professional --classic
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
RUN export JAVA_HOME
RUN apt-get install tmux -y
RUN mkdir /root/nerfstudio
COPY pyproject.toml /root/nerfstudio/pyproject.toml
# Install nerfstudio dependencies.
RUN cd /root/nerfstudio && \
python3.10 -m pip install -e . && \
cd ..
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
RUN apt-get update && apt-get -y install google-chrome-stable
# Copy nerfstudio folder and give ownership to user.
ADD . /root/nerfstudio
# Again but with full folder added
RUN cd /root/nerfstudio && \
python3.10 -m pip install -e . && \
cd ..
# Install nerfstudio cli auto completion and enter shell if no command was provided.
CMD ns-install-cli --mode install && /bin/bash
# Change working directory
WORKDIR /root/nerfstudio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment