diff --git a/cuda9.1-devel-python3.6/Dockerfile b/cuda9.1-devel-python3.6/Dockerfile new file mode 100644 index 0000000..e8b926c --- /dev/null +++ b/cuda9.1-devel-python3.6/Dockerfile @@ -0,0 +1,135 @@ +FROM nvidia/cuda:9.1-devel + +LABEL maintainer="Sebastian Ramirez " + +# Install buildpack-deps:latest with its base image parts, as it is the base for official Python + +# buildpack-deps:curl https://github.com/docker-library/buildpack-deps/blob/master/stretch/curl/Dockerfile +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + netbase \ + wget \ + && rm -rf /var/lib/apt/lists/* + +RUN set -ex; \ + if ! command -v gpg > /dev/null; then \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + gnupg \ + dirmngr \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + fi +# End buildpack-deps:curl + +# buildpack-deps:scm https://github.com/docker-library/buildpack-deps/blob/master/stretch/scm/Dockerfile + +# procps is very common in build systems, and is a reasonably small package +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzr \ + git \ + mercurial \ + openssh-client \ + subversion \ + \ + procps \ + && rm -rf /var/lib/apt/lists/* + +# End buildpack-deps:scm + +# buildpack-deps:latest https://github.com/docker-library/buildpack-deps/blob/master/stretch/Dockerfile + +RUN set -ex; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + autoconf \ + automake \ + bzip2 \ + dpkg-dev \ + file \ + g++ \ + gcc \ + imagemagick \ + libbz2-dev \ + libc6-dev \ + libcurl4-openssl-dev \ + libdb-dev \ + libevent-dev \ + libffi-dev \ + libgdbm-dev \ + libgeoip-dev \ + libglib2.0-dev \ + libgmp-dev \ + libjpeg-dev \ + libkrb5-dev \ + liblzma-dev \ + libmagickcore-dev \ + libmagickwand-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libpng-dev \ + libpq-dev \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + libtool \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + libyaml-dev \ + make \ + patch \ + unzip \ + xz-utils \ + zlib1g-dev \ + \ +# https://lists.debian.org/debian-devel-announce/2016/09/msg00000.html + $( \ +# if we use just "apt-cache show" here, it returns zero because "Can't select versions from package 'libmysqlclient-dev' as it is purely virtual", hence the pipe to grep + if apt-cache show 'default-libmysqlclient-dev' 2>/dev/null | grep -q '^Version:'; then \ + echo 'default-libmysqlclient-dev'; \ + else \ + echo 'libmysqlclient-dev'; \ + fi \ + ) \ + ; \ + rm -rf /var/lib/apt/lists/* + +# End buildpack-deps:latest + +ENV PYTHON_VERSION=3.6 + +# Conda, fragments from: https://github.com/ContinuumIO/docker-images/blob/master/miniconda3/Dockerfile +# Explicit install of Python 3.7 with: +# /opt/conda/bin/conda install -y python=$PYTHON_VERSION && \ +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 +ENV PATH /opt/conda/bin:$PATH + +RUN apt-get update --fix-missing && \ + apt-get install -y wget bzip2 ca-certificates curl git && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.12-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + /opt/conda/bin/conda install -y python=$PYTHON_VERSION && \ + /opt/conda/bin/conda clean -tipsy && \ + ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ + echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate base" >> ~/.bashrc + +# End Conda + +# Tini: https://github.com/krallin/tini +ENV TINI_VERSION v0.18.0 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini +ENTRYPOINT ["/tini", "--"] +# End Tini + +COPY ./start.sh /start.sh +RUN chmod +x /start.sh + +CMD [ "/start.sh" ] diff --git a/cuda9.1-devel-python3.6/start.sh b/cuda9.1-devel-python3.6/start.sh new file mode 100644 index 0000000..1e15670 --- /dev/null +++ b/cuda9.1-devel-python3.6/start.sh @@ -0,0 +1,8 @@ +#! /usr/bin/env sh +set -e + +echo "conda version: $(conda --version)" + +python -c 'import sys; print("python version: {}.{}".format(sys.version_info.major, sys.version_info.minor))' + +nvidia-smi diff --git a/docker-compose.build.stage01.yml b/docker-compose.build.stage01.yml index 6579c57..e325201 100644 --- a/docker-compose.build.stage01.yml +++ b/docker-compose.build.stage01.yml @@ -15,3 +15,6 @@ services: cuda9.1-python3.6: build: ./cuda9.1-python3.6 image: tiangolo/python-machine-learning:cuda9.1-python3.6 + cuda9.1-devel-python3.6: + build: ./cuda9.1-devel-python3.6 + image: tiangolo/python-machine-learning:cuda9.1-devel-python3.6 diff --git a/tests/test_cuda/test_conda_cuda.py b/tests/test_cuda/test_conda_cuda.py index 88983d5..2f460d5 100644 --- a/tests/test_cuda/test_conda_cuda.py +++ b/tests/test_cuda/test_conda_cuda.py @@ -18,6 +18,7 @@ def verify_container(logs, python_version): [ ("tiangolo/python-machine-learning:cuda9.1-python3.6", "3.6"), ("tiangolo/python-machine-learning:cuda9.1-python3.7", "3.7"), + ("tiangolo/python-machine-learning:cuda9.1-devel-python3.6", "3.6"), ], ) def test_defaults(image, python_version):