Skip to content

Instantly share code, notes, and snippets.

@MohamedKari
Last active May 22, 2020
Embed
What would you like to do?
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