Skip to content

Instantly share code, notes, and snippets.

@MohamedKari
Last active May 22, 2020 10:30
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 MohamedKari/ab9760875a0de500272d773141a462b5 to your computer and use it in GitHub Desktop.
Save MohamedKari/ab9760875a0de500272d773141a462b5 to your computer and use it in GitHub Desktop.
CUDA with Python Dockerfile
FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
SHELL ["/bin/bash", "-c"]
ENV PYENV_ROOT="/.pyenv"
# Install pyenv dependencies & fetch pyenv
# see: https://github.com/pyenv/pyenv/wiki/common-build-problems
RUN apt-get update && \
apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git && \
git clone --single-branch --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT
ENV PATH="$PYENV_ROOT/bin:$PATH"
ENV PATH="$PYENV_ROOT/shims:$PATH"
ARG PYTHON_VERSION=3.6.4
RUN pyenv install ${PYTHON_VERSION} && \
pyenv global ${PYTHON_VERSION}
ENTRYPOINT [ "python" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment