ubuntu1604-Python35-cuda9-cudnn7-gpu-dockerfile

First, there are the following files in a directory:

-rw-r - r-- 1 root root 1643293725 dated. 9 11:46 cuda_9.0.176_384.81_linux.run 2
-rw-R & lt - r--. 1 the root the root. 9 dated 1250 17:45 Dockerfile. 3
-RW- r - r-- 1 root root 102521974 dated. 9 19:18 libcudnn7_7.0.5.15-1 + cuda9.0_amd64.deb 2
. -rwxr the root. 1-XR X-dated the root. 8 111 258 448 21 16:58 NVIDIA-Linux- x86_64-430.40.run
-rw-R & lt - r--. 1 the root. 8 20,766,931 dated the root-3.5.5.tgz the Python 12:15 30
-rw-R & lt - r-- the root 720. the root. 1 at 3:55 on September 31 the sources.list
-rw-R & lt - r--. 1 the root the root. 9 258 835 666 dated 3 17:17 tensorflow_gpu-1.11.0-cp35- cp35m-linux_x86_64.whl
Second, the directory build command executed, a long time, such as:

docker build -t "ubuntu1604-python35-nvidia-cuda90-cudnn7-dockerfil" .

三,使用
nvidia-docker run -it --rm --privileged=true -v $PWD:/data ubuntu1604-python35-nvidia-cuda90-cudnn7-dockerfil /bin/bash

Do not add --privileged = true container does not work properly nvidia-smi

Dockerfile default no-entry command, i.e. from the container without command followed by mountains, such as no / bin / bash

Fourth, the catalog operation in 192.168.0.154:/gpu/cuda/1604-py3.5-tensor1.11-keras2.2.4

Attachment:

Dockerfile

FROM ubuntu:16.04
MAINTAINER yon
ENV PATH /usr/local/cuda-9.0/bin:$PATH
ENV LD_LIBRARY_PATH /usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH
ADD Python-3.5.5.tgz /opt
ADD sources.list /etc/apt/sources.list
RUN apt-get update && apt-get install -y

Installation depends

RUN apt-get install gcc -y && apt-get install make -y && apt-get install vim -y && apt-get install openssl -y && apt-get install libssl-dev -y && apt-get install python3-pip -y
RUN ./opt/Python-3.5.5/configure --prefix=/usr/local/python3.5 && make && make install

COPY libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb /
COPY cuda_9.0.176_384.81_linux.run /
COPY NVIDIA-Linux-x86_64-430.40.run /
COPY tensorflow_gpu-1.11.0-cp35-cp35m-linux_x86_64.whl /
RUN apt-get -y -q install gcc kmod  
&& sh NVIDIA-Linux-x86_64-430.40.run -a -N --ui=none --no-kernel-module && sh cuda_9.0.176_384.81_linux.run --no-opengl-libs --toolkit -silent && dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb && pip3 install -i https://mirrors.aliyun.com/pypi/simple/ tensorflow_gpu-1.11.0-cp35-cp35m-linux_x86_64.whl && pip3 install -i https://mirrors.aliyun.com/pypi/simple/ Keras==2.2.4

CMD [""]


sources.list

deb http://mirrors.aliyun.com/ubuntu/ great main
deb-src http://mirrors.aliyun.com/ubuntu/ great main

deb http://mirrors.aliyun.com/ubuntu/ great-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ great-updates main

deb http://mirrors.aliyun.com/ubuntu/ great universe
deb-src http://mirrors.aliyun.com/ubuntu/ great universe
deb http://mirrors.aliyun.com/ubuntu/ great-updates universe
deb -SR http://mirrors.aliyun.com/ubuntu/ great-updates universe

deb http://mirrors.aliyun.com/ubuntu/ great-security main
deb-src http://mirrors.aliyun.com/ubuntu/ great-security main
deb http://mirrors.aliyun.com/ubuntu/ great -security universe
deb-src http://mirrors.aliyun.com/ubuntu/ great-security universe

Guess you like

Origin www.cnblogs.com/g2thend/p/11515569.html