Skip to content

Instantly share code, notes, and snippets.

@vitorcalvi
Last active May 6, 2024 09:13
Show Gist options
  • Save vitorcalvi/ed9146a62aef937e05223817c15c6ace to your computer and use it in GitHub Desktop.
Save vitorcalvi/ed9146a62aef937e05223817c15c6ace to your computer and use it in GitHub Desktop.
TensorFlow and Pytorch via JupyterLab on Dockerc no password
FROM tensorflow/tensorflow:2.14.0-gpu
ARG BUILD_DATE
ENV PORT 8888
LABEL org.opencontainers.image.authors="rinconyanezd@gmail.com" \
org.opencontainers.image.vendor="Diego, Rincon-Yanez" \
org.opencontainers.image.title="Tensorflow GPU Jupyter" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.version="2.9.3" \
org.opencontainers.image.revision="1.0" \
org.opencontainers.image.url="https://github.com/d1egoprog/docker-tensorflow-gpu-jupyter" \
org.opencontainers.image.documentation="https://github.com/d1egoprog/docker-tensorflow-gpu-jupyter"
RUN apt-get update -y
RUN apt-get install apt-utils git curl wget -y
USER root
#RUN adduser jupyter
#USER jupyter
#ENV PATH="${PATH}:/home/jupyter/.local/bin"
#MKDIR ~/jupyter
#WORKDIR ~/jupyter
#RUN mkdir ~/jupyter/data; mkdir /home/jupyter/notebooks
#COPY ../tests/gpu_check.ipynb /home/jupyter/
#COPY ../tests/env_preparation.ipynb /home/jupyter/
RUN python3 -m pip install --no-cache --upgrade setuptools pip
RUN pip install jupyter && pip install jupyterlab
EXPOSE $PORT
RUN apt-get update \
&& apt-get install -y curl \
&& apt-get -y autoclean
# nvm environment variables
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 4.4.7
# install nvm
# https://github.com/creationix/nvm#install-script
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.2/install.sh | bash
# install node and npm
RUN source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
# add node and npm to path so the commands are available
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# confirm installation
RUN node -v
RUN npm -v
ENTRYPOINT ["jupyter","lab","--ip=*","--NotebookApp.token=''","--NotebookApp.password=''", "--allow-root"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment