GPU镜像生成

  1. Dockerfile
    1. huanjin.txt
  2. 安装keytab文件认证

Dockerfile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
ARG UBUNTU_VERSION=16.04
ARG ARCH=
ARG CUDA=10.1
FROM nvidia/cuda${ARCH:+-$ARCH}:${CUDA}-base-ubuntu${UBUNTU_VERSION} as base

ARG ARCH
ARG CUDA
ARG CUDNN=7.6.4.38-1
ARG CUDNN_MAJOR_VERSION=7
ARG LIB_DIR_PREFIX=x86_64
ARG LIBNVINFER=6.0.1-1
ARG LIBNVINFER_MAJOR_VERSION=6

SHELL ["/bin/bash", "-c"]

RUN sed -i s:/archive.ubuntu.com:/mirrors.aliyun.com/ubuntu:g /etc/apt/sources.list;\
sed -i s:/archive.ubuntu.com:/mirrors.tuna.tsinghua.edu.cn/ubuntu:g /etc/apt/sources.list && apt-get clean && apt-get -y update --fix-missing;\
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cuda-command-line-tools-${CUDA/./-} \
libcublas10 \
cuda-cufft-${CUDA/./-} \
cuda-curand-${CUDA/./-} \
cuda-cusolver-${CUDA/./-} \
cuda-cusparse-${CUDA/./-} \
curl \
libcudnn7=${CUDNN}+cuda${CUDA} \
libfreetype6-dev \
libhdf5-serial-dev \
libzmq3-dev \
pkg-config \
software-properties-common \
unzip zip

RUN [[ "${ARCH}" = "ppc64le" ]] || { apt-get update && \
apt-get install -y --no-install-recommends libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \
libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*; }

ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/ln:/usr/cuda_files:$LD_LIBRARY_PATH
ARG USE_PYTHON_3_NOT_2
ARG _PY_SUFFIX=${USE_PYTHON_3_NOT_2:+3}
ARG PIP=pip3
ARG TF_PACKAGE=tensorflow-gpu
ARG TF_PACKAGE_VERSION=2.0.0
ENV LANG C.UTF-8
COPY huanjin.txt /root/huanjin.txt
COPY hadoop /hadoop
COPY hive_client /hive_client

RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \
&& echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \
&& ldconfig;\
apt-get update && apt-get install -y \
python3.5 \
python3-pip \
gcc \
libkrb5-dev \
lrzsz \
libsasl2-dev \
libsasl2-2 \
libsasl2-modules-gssapi-mit \
openjdk-8-*

RUN ${PIP} --no-cache-dir install --upgrade -i https://pypi.douban.com/simple \
pip \
setuptools;\
ln -s $(which ${PYTHON}) /usr/local/bin/python;\
${PIP} install ${TF_PACKAGE}${TF_PACKAGE_VERSION:+==${TF_PACKAGE_VERSION}} -i https://pypi.douban.com/simple;\
${PIP} install -r /root/huanjin.txt -i https://pypi.douban.com/simple;\
mkdir /ln;ln -s /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudart.so.10.1 /ln/libcudart.so.10.0;ln -s /usr/lib64/stubs/libcublas.so /ln/libcublas.so.10.0;ln -s /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcufft.so.10 /ln/libcufft.so.10.0;ln -s /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcurand.so.10 /ln/libcurand.so.10.0;ln -s /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcusolver.so.10 /ln/libcusolver.so.10.0;ln -s /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcusparse.so.10 /ln/libcusparse.so.10.0;ln -s /hadoop/lib/native/libhdfs.so /ln/libhdfs.so;ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so /ln/libjvm.so
ENV PATH /hadoop/bin/:$PATH
ENV HADOOP_HOME /hadoop
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV HOME /root


7.6.5.32-1+
cuda10.2_amd64.deb

huanjin.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
############huanjin.txt############
pip install -i https://pypi.douban.com/simple
pandas==0.22.0
pyarrow==0.9.0
impyla==0.14.1
krbcontext==0.9
pure_sasl==0.5.1
thrift_sasl==0.2.1
thrift==0.9.3
bitarray==0.8.3
thriftpy==0.3.9
Cython==0.29.21

torch==1.0.0
torchvision==0.2.2
jieba==0.39
scikit-learn==0.19.1
scikit-image==0.14.1
joblib==0.14.1
pytorch_pretrained_bert==0.6.2
gensim==3.5.0
Cython==0.29.21

安装keytab文件认证

1
2
3
4
5
#############安装#############
docker build -t forecast:1.2 .
apt-get install krb5-user -y

*******.******.com

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 zoubinbf@163.com

×

喜欢就点赞,疼爱就打赏