Skip to content

Instantly share code, notes, and snippets.

@derek-pappas
Last active January 17, 2018 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derek-pappas/6cb33015868eaa97d383f524c763b72e to your computer and use it in GitHub Desktop.
Save derek-pappas/6cb33015868eaa97d383f524c763b72e to your computer and use it in GitHub Desktop.
nvidia-docker modification to support python
# Docker file for squeezeDet
# docker build -t nvidia-docker-mod-tensorflow_2_7 --build-arg USER_ID=`id -u $USER` .
#
# nvidia-docker run -it -v ~/squeezedet:/squeezedet nvidia-docker-mod-python_3.5 bash
FROM gcr.io/tensorflow/tensorflow:latest-gpu
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
# ***
# Do any custom logic needed prior to adding your code here
# ***
# install python
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get -yqq install python3.5
RUN apt-get -yqq install python3-pip
RUN apt-get -yqq install pandoc
RUN apt-get -yqq install graphviz
RUN apt-get -yqq install python-opencv
# Install app dependencies
RUN pip install --upgrade pip
# Misc. install
RUN apt-get -yqq install git
# Install Python packages
RUN pip install Cython
RUN pip install gensim
RUN pip install h5py
RUN pip install ioutils
RUN pip install matplotlib
RUN pip install numpy
RUN pip install opencv-python
RUN pip install pandas
RUN pip install pillow
RUN pip install pydot
RUN pip install pydot-ng
RUN pip install pypandoc
RUN pip install pandoc
RUN pip install seaborn
RUN pip install sklearn
RUN pip install tensorflow-gpu
RUN pip install keras
RUN pip install keras_diagram
RUN pip install opencv-python
RUN pip install easydict
RUN pip install joblib
# Python 2.7 GPU support
# select a url to install based on your version requirements
# https://www.tensorflow.org/install/install_linux#the_url_of_the_tensorflow_python_package
#ENV tfBinaryURL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp35-cp35m-linux_x86_64.whl
ENV tfBinaryURL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp27-none-linux_x86_64.whl
RUN pip install --upgrade $tfBinaryURL
ARG USER_ID
RUN useradd --shell /bin/bash -o --create-home --user-group -u $USER_ID app
ENV SQDT_ROOT=/squeezeDet
# Change to the user.
USER app
#
# ENV DATA_USER=depappas
#
# ENV DATA_GROUP=depappas
#
# RUN chmod -R 700 ${SQDT_ROOT}
#
# RUN groupadd -r ${DATA_GROUP} \
# && useradd -r -g ${DATA_GROUP} ${DATA_USER}
# RUN mkdir -p ${SQDT_ROOT} \
# && chown -R ${DATA_GROUP}:${DATA_USER} ${SQDT_ROOT}
# VOLUME ${SQDT_ROOT}
#
# # Change to the app user.
# USER ${DATA_USER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment